#!/bin/sh
#
# Do not edit!
# This file was generated from configure.in by BSDbuild 2.4.
#
# To regenerate this file, get the latest BSDbuild release from
# http://hypertriton.com/bsdbuild/, and use the command:
#
# $ cat configure.in | mkconfigure > configure
#
# Copyright (c) 2001-2008 Hypertriton, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
optarg=
for arg
do
case "$arg" in
-*=*)
optarg=`echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case "$arg" in
--prefix=*)
prefix=$optarg
;;
--sysconfdir=*)
sysconfdir=$optarg
;;
--bindir=*)
bindir=$optarg
;;
--libdir=*)
libdir=$optarg
;;
--sharedir=*)
sharedir=$optarg
;;
--localedir=*)
localedir=$optarg
;;
--mandir=*)
mandir=$optarg
;;
--infodir=*)
infodir=$optarg
;;
--enable-*)
option=`echo $arg | sed -e 's/--enable-//' -e 's/=.*//'`
option=`echo $option | sed 's/-/_/g'`
case "$arg" in
*=*)
eval "enable_${option}='$optarg'"
;;
*)
eval "enable_${option}=yes"
;;
esac
;;
--disable-*)
option=`echo $arg | sed -e 's/--disable-//'`;
option=`echo $option | sed 's/-/_/g'`
eval "enable_${option}=no"
;;
--with-*)
option=`echo $arg | sed -e 's/--with-//' -e 's/=.*//'`
option=`echo $option | sed 's/-/_/g'`
case "$arg" in
*=*)
eval "with_${option}='$optarg'"
;;
*)
eval "with_${option}=yes"
;;
esac
;;
--without-*)
option=`echo $arg | sed -e 's/--without-//'`;
option=`echo $option | sed 's/-/_/g'`
eval "with_${option}=no"
;;
--help)
help=yes
;;
--srcdir=*)
srcdir=$optarg
;;
--testdir=*)
testdir=$optarg
;;
--cache=*)
cache=$optarg
;;
--includes=*)
includes=$optarg
;;
*)
echo "invalid argument: $arg"
echo "try ./configure --help"
exit 1
;;
esac
done
if [ -e "/bin/echo" ]; then
/bin/echo -n ""
if [ $? = 0 ]; then
ECHO_N="/bin/echo -n"
else
ECHO_N="echo -n"
fi
else
ECHO_N="echo -n"
fi
if [ "${prefix}" != "" ]; then
PREFIX="$prefix"
else
PREFIX="/usr/local"
fi
if [ "${srcdir}" != "" ]; then
echo "* Separate build (source in ${srcdir})"
SRC=${srcdir}
perl ${SRC}/mk/mkconcurrent.pl ${SRC}
if [ $? != 0 ]; then
exit 1;
fi
else
SRC=`pwd`
fi
BLD=`pwd`
SRCDIR="${SRC}"
BLDDIR="${BLD}"
if [ "${testdir}" != "" ]; then
echo "Configure tests will be executed in ${testdir}"
if [ ! -e "${testdir}" ]; then
echo "Creating ${testdir}"
mkdir ${testdir}
fi
else
testdir="."
fi
if [ "${includes}" = "" ]; then
includes="yes"
fi
if [ "${includes}" = "link" ]; then
if [ "${with_proj_generation}" ]; then
echo "Cannot use --includes=link with --with-proj-generation!"
exit 1
fi
elif [ "${includes}" = "yes" ]; then
noop=1
elif [ "${includes}" = "no" ]; then
noop=1
else
echo "Usage: --includes [yes|no|link]"
exit 1
fi
if [ "${help}" = "yes" ]; then
echo "Usage: ./configure [args]"
echo " --prefix Installation prefix [/usr/local]"
echo " --sysconfdir System-wide configuration prefix [/etc]"
echo " --bindir Executable directory [$PREFIX/bin]"
echo " --libdir Library directory [$PREFIX/lib]"
echo " --sharedir Share directory [$PREFIX/share]"
echo " --localedir Locale directory [$PREFIX/share/locale]"
echo " --mandir Manpage directory [$PREFIX/share/man]"
echo " --infodir Info directory [$PREFIX/share/info]"
echo " --srcdir Source tree for concurrent build [.]"
echo " --testdir Directory in which to execute tests [.]"
echo " --cache Cache directory for test results [none]"
echo " --with-manpages Manual pages (-mdoc) [yes]"
echo " --with-manlinks Manual pages links for functions [no]"
echo " --with-ctags Automatically generate tag files [no]"
echo " --with-docs Printable docs (-me/tbl/eqn/pic/refer) [no]"
echo " --includes Preprocess headers (yes|no|link) [yes]"
echo " --with-libtool Specify path to libtool [use bundled]"
echo " --with-cygwin Add cygwin dependencies under cygwin [no]"
echo " --enable-nls Native Language Support [no]"
echo " --with-gettext Use gettext tools [check]"
echo " --enable- Libraries (gui|vg|rg|math|dev) [default: all]"
echo " --enable-warnings Suggested compiler warnings [default: no]"
echo " --enable-threads Thread safety [default: check]"
echo " --enable-debug General debugging [default: no]"
echo " --enable-debug Debugging (obj|class|event) [default: none]"
echo " --enable-legacy Deprecated interfaces [default: yes]"
echo " --enable-network CORE: Network support [default: check]"
echo " --with-sdl GUI: SDL rendering support [default: check]"
echo " --with-gl GUI: OpenGL rendering support [default: check]"
echo " --enable-bpp GUI: FB depths (8|16|24|32) [default: all]"
echo " --with-jpeg GUI: JPEG screenshot support [default: check]"
echo " --with-freetype GUI: Enable FreeType support [default: check]"
echo " --enable-utf8 GUI: UTF8 text support [default: yes]"
echo " --with-sse M: SSE[123] optimizations [default: no]"
echo " --with-altivec M: AltiVec optimizations [default: check]"
echo " --with--inline M: Inline ops (sse2|sse3|altivec) [default: no]"
echo " --with--fp M: Mode (single|double|quad) [default: double]"
exit 1
fi
MACHINE=`uname -m 2>/dev/null` || MACHINE=unknown
OSRELEASE=`uname -r 2>/dev/null` || OSRELEASE=unknown
SYSTEM=`uname -s 2>/dev/null` || SYSTEM=unknown
HOST="$SYSTEM-$OSRELEASE-$MACHINE"
echo "# File generated by configure script (BSDbuild 2.4)." > Makefile.config
echo "# Host: ${HOST}" >> Makefile.config
echo "" >> Makefile.config
echo "SRCDIR=${SRC}" >> Makefile.config
echo "BLDDIR=${BLD}" >> Makefile.config
echo "Host: $HOST"
echo "Machine: $MACHINE" > config.log
echo "Release: $OSRELEASE" >> config.log
echo "System: $SYSTEM" >> config.log
for arg
do
echo "Argument: $arg" >> config.log
done
if [ -e "config" ]; then
if [ -f "config" ]; then
echo "File ./config is in the way. Please remove it first."
exit 1;
else
rm -fR config;
fi
fi
mkdir config
if [ $? != 0 ]; then
echo "Could not create ./config/ directory."
exit 1
fi
# Process built-in documentation options.
HAVE_MANDOC="no"
NROFF=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/nroff" ]; then
NROFF="${path}/nroff"
fi
done
if [ "${NROFF}" != "" ]; then
echo | ${NROFF} -Tmandoc >/dev/null
if [ "$?" = "0" ]; then
HAVE_MANDOC="yes"
fi
fi
if [ "${HAVE_MANDOC}" = "no" ]; then
if [ "${with_manpages}" = "yes" ]; then
echo "*"
echo "* --with-manpages was requested, but either the nroff(1)"
echo "* utility or the mdoc(7) macro package was not found."
echo "*"
exit 1
fi
echo "HAVE_MANDOC=no" >> Makefile.config
echo "NOMAN=yes" >> Makefile.config
echo "NOMANLINKS=yes" >> Makefile.config
else
echo "HAVE_MANDOC=yes" >> Makefile.config
if [ "${with_manpages}" = "no" ]; then
echo "NOMAN=yes" >> Makefile.config
echo "NOMANLINKS=yes" >> Makefile.config
else
if [ "${with_manlinks}" != "yes" ]; then
echo "NOMANLINKS=yes" >> Makefile.config
fi
fi
fi
if [ "${with_docs}" = "no" ]; then
echo "NODOC=yes" >> Makefile.config
fi
# Process NLS options.
if [ "${enable_nls}" = "yes" ]; then
ENABLE_NLS="yes"
echo "#ifndef ENABLE_NLS" > config/enable_nls.h
echo "#define ENABLE_NLS 1" >> config/enable_nls.h
echo "#endif /* ENABLE_NLS */" >> config/enable_nls.h
msgfmt=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/msgfmt" ]; then
msgfmt=${path}/msgfmt
fi
done
if [ "${msgfmt}" != "" ]; then
HAVE_GETTEXT="yes"
else
HAVE_GETTEXT="no"
fi
else
ENABLE_NLS="no"
HAVE_GETTEXT="no"
echo "#undef ENABLE_NLS" > config/enable_nls.h
fi
echo "ENABLE_NLS=${ENABLE_NLS}" >> Makefile.config
echo "HAVE_GETTEXT=${HAVE_GETTEXT}" >> Makefile.config
# Process ctags option.
CTAGS=""
if [ "${with_ctags}" = "yes" ]; then
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/ectags" ]; then
CTAGS="${path}/ectags"
fi
done
if [ "${CTAGS}" = "" ]; then
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/ctags" ]; then
CTAGS="${path}/ctags"
fi
done
fi
fi
echo "CTAGS=${CTAGS}" >> Makefile.config
# Default to bundled libtool.
LIBTOOL_BUNDLED="yes"
LIBTOOL=\${TOP}/mk/libtool/libtool
echo "LIBTOOL=${LIBTOOL}" >> Makefile.config
#
# Process the installation paths.
#
echo "PREFIX?=${PREFIX}" >> Makefile.config
echo "#ifndef PREFIX" > config/prefix.h
echo "#define PREFIX \"${PREFIX}\"" >> config/prefix.h
echo "#endif /* PREFIX */" >> config/prefix.h
if [ "${bindir}" != "" ]; then
BINDIR="${bindir}"
else
BINDIR="${PREFIX}/bin"
fi
echo "BINDIR=${BINDIR}" >> Makefile.config
echo "#ifndef BINDIR" > config/bindir.h
echo "#define BINDIR \"${BINDIR}\"" >> config/bindir.h
echo "#endif /* BINDIR */" >> config/bindir.h
if [ "${libdir}" != "" ]; then
LIBDIR="${libdir}"
else
LIBDIR="${PREFIX}/lib"
fi
echo "LIBDIR=${LIBDIR}" >> Makefile.config
echo "#ifndef LIBDIR" > config/libdir.h
echo "#define LIBDIR \"${LIBDIR}\"" >> config/libdir.h
echo "#endif /* LIBDIR */" >> config/libdir.h
if [ "${sharedir}" != "" ]; then
SHAREDIR="${sharedir}"
else
SHAREDIR="${PREFIX}/share"
fi
echo "SHAREDIR=${SHAREDIR}" >> Makefile.config
echo "#ifndef SHAREDIR" > config/sharedir.h
echo "#define SHAREDIR \"${SHAREDIR}\"" >> config/sharedir.h
echo "#endif /* SHAREDIR */" >> config/sharedir.h
if [ "${localedir}" != "" ]; then
LOCALEDIR="${localedir}"
else
LOCALEDIR="${SHAREDIR}/locale"
fi
echo "LOCALEDIR=${LOCALEDIR}" >> Makefile.config
echo "#ifndef LOCALEDIR" > config/localedir.h
echo "#define LOCALEDIR \"${LOCALEDIR}\"" >> config/localedir.h
echo "#endif /* LOCALEDIR */" >> config/localedir.h
if [ "${mandir}" != "" ]; then
MANDIR="${mandir}"
else
MANDIR="${SHAREDIR}/man"
fi
echo "MANDIR=${MANDIR}" >> Makefile.config
echo "#ifndef MANDIR" > config/mandir.h
echo "#define MANDIR \"${MANDIR}\"" >> config/mandir.h
echo "#endif /* MANDIR */" >> config/mandir.h
if [ "${infodir}" != "" ]; then
INFODIR="${infodir}"
else
INFODIR="${SHAREDIR}/info"
fi
echo "INFODIR=${INFODIR}" >> Makefile.config
echo "#ifndef INFODIR" > config/infodir.h
echo "#define INFODIR \"${INFODIR}\"" >> config/infodir.h
echo "#endif /* INFODIR */" >> config/infodir.h
if [ "${sysconfdir}" != "" ]; then
SYSCONFDIR="${sysconfdir}"
else
SYSCONFDIR="${PREFIX}/etc"
fi
echo "SYSCONFDIR=${SYSCONFDIR}" >> Makefile.config
echo "#ifndef SYSCONFDIR" > config/sysconfdir.h
echo "#define SYSCONFDIR \"${SYSCONFDIR}\"" >> config/sysconfdir.h
echo "#endif /* SYSCONFDIR */" >> config/sysconfdir.h
VERSION="1.3.4-beta"
echo "#ifndef VERSION" > config/version.h
echo "#define VERSION \"$VERSION\"" >> config/version.h
echo "#endif" >> config/version.h
echo "hdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
RELEASE="Pandemonic Incantation"
echo "#ifndef RELEASE" > config/release.h
echo "#define RELEASE \"$RELEASE\"" >> config/release.h
echo "#endif" >> config/release.h
echo "hdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
SHAREDIR="\${PREFIX}/share/agar"
echo "SHAREDIR=$SHAREDIR" >>Makefile.config
echo "mdefs[\"SHAREDIR\"] = \"$SHAREDIR\"" >>configure.lua
SHAREDIR="$PREFIX/share/agar"
echo "#ifndef SHAREDIR" > config/sharedir.h
echo "#define SHAREDIR \"$SHAREDIR\"" >> config/sharedir.h
echo "#endif" >> config/sharedir.h
echo "hdefs[\"SHAREDIR\"] = \"$SHAREDIR\"" >>configure.lua
LOCALEDIR="\${PREFIX}/share/agar/locale"
echo "LOCALEDIR=$LOCALEDIR" >>Makefile.config
echo "mdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
LOCALEDIR="$PREFIX/share/agar/locale"
echo "#ifndef LOCALEDIR" > config/localedir.h
echo "#define LOCALEDIR \"$LOCALEDIR\"" >> config/localedir.h
echo "#endif" >> config/localedir.h
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
TTFDIR="\${PREFIX}/share/agar/fonts"
echo "TTFDIR=$TTFDIR" >>Makefile.config
echo "mdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
TTFDIR="$PREFIX/share/agar/fonts"
echo "#ifndef TTFDIR" > config/ttfdir.h
echo "#define TTFDIR \"$TTFDIR\"" >> config/ttfdir.h
echo "#endif" >> config/ttfdir.h
echo "hdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
INCLDIR="\${PREFIX}/include/agar"
echo "INCLDIR=$INCLDIR" >>Makefile.config
echo "mdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
INCLDIR="$PREFIX/include/agar"
echo "#ifndef INCLDIR" > config/incldir.h
echo "#define INCLDIR \"$INCLDIR\"" >> config/incldir.h
echo "#endif" >> config/incldir.h
echo "hdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
$ECHO_N "checking for a usable C compiler..."
$ECHO_N "checking for a usable C compiler..." >> config.log
if [ "$CC" = "" ]; then
for i in `echo $PATH |sed 's/:/ /g'`; do
if [ -x "${i}/cc" ]; then
if [ -f "${i}/cc" ]; then
CC="${i}/cc"
break
fi
elif [ -x "${i}/gcc" ]; then
if [ -f "${i}/gcc" ]; then
CC="${i}/gcc"
break
fi
fi
done
if [ "$CC" = "" ]; then
echo "Unable to find a C compiler in PATH. Please set your compiler"
echo "explicitely with the CC environment variable."
echo "Unable to find a C compiler in PATH." >> config.log
exit 1
fi
fi
cat << 'EOT' > conftest.c
int main(int argc, char *argv[]) { return (0); }
EOT
$CC -o conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "Test C program (conftest.c) failed to compile."
echo "Test C program (conftest.c) failed to compile." >> config.log
exit 1
fi
EXECSUFFIX=""
for OUTFILE in conftest.exe conftest conftest.*; do
if [ -f $OUTFILE ]; then
case $OUTFILE in
*.c | *.o | *.obj | *.bb | *.bbg | *.d | *.pdb | *.tds | *.xcoff | *.dSYM | *.xSYM )
;;
*.* )
EXECSUFFIX=`expr "$OUTFILE" : '[^.]*\(\..*\)'`
break ;;
* )
break ;;
esac;
fi
done
if [ "$EXECSUFFIX" != "" ]; then
echo "Detected executable suffix: $EXECSUFFIX" >> config.log
fi
echo "EXECSUFFIX=$EXECSUFFIX" >> Makefile.config
echo "#ifndef EXECSUFFIX" > config/execsuffix.h
echo "#define EXECSUFFIX \"${EXECSUFFIX}\"" >> config/execsuffix.h
echo "#endif /* EXECSUFFIX */" >> config/execsuffix.h
echo "yes"
rm -f conftest.c conftest$EXECSUFFIX
TEST_CFLAGS=""
$ECHO_N "checking for compiler warning options..."
$ECHO_N "checking for compiler warning options..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_CC_WARNINGS" ]; then
HAVE_CC_WARNINGS=`cat ${cache}/ctest-HAVE_CC_WARNINGS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_CC_WARNINGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int main(int argc, char *argv[]) { return (0); }
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_CC_WARNINGS="yes"
echo "HAVE_CC_WARNINGS=$HAVE_CC_WARNINGS" >>Makefile.config
echo "mdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
echo "#ifndef HAVE_CC_WARNINGS" > config/have_cc_warnings.h
echo "#define HAVE_CC_WARNINGS \"$HAVE_CC_WARNINGS\"" >> config/have_cc_warnings.h
echo "#endif" >> config/have_cc_warnings.h
echo "hdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_CC_WARNINGS="no"
echo "HAVE_CC_WARNINGS=$HAVE_CC_WARNINGS" >>Makefile.config
echo "mdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
echo "#undef HAVE_CC_WARNINGS" >config/have_cc_warnings.h
echo "hdefs[\"HAVE_CC_WARNINGS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_CC_WARNINGS" > ${cache}/ctest-HAVE_CC_WARNINGS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_CC_WARNINGS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall -Werror"
fi;
$ECHO_N "checking for gcc..."
$ECHO_N "checking for gcc..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GCC" ]; then
HAVE_GCC=`cat ${cache}/ctest-HAVE_GCC`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GCC`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int main(int argc, char *argv[]) {
#if !defined(__GNUC__)
# error "Not GCC"
#endif
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GCC="yes"
echo "HAVE_GCC=$HAVE_GCC" >>Makefile.config
echo "mdefs[\"HAVE_GCC\"] = \"$HAVE_GCC\"" >>configure.lua
echo "#ifndef HAVE_GCC" > config/have_gcc.h
echo "#define HAVE_GCC \"$HAVE_GCC\"" >> config/have_gcc.h
echo "#endif" >> config/have_gcc.h
echo "hdefs[\"HAVE_GCC\"] = \"$HAVE_GCC\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GCC="no"
echo "HAVE_GCC=$HAVE_GCC" >>Makefile.config
echo "mdefs[\"HAVE_GCC\"] = \"$HAVE_GCC\"" >>configure.lua
echo "#undef HAVE_GCC" >config/have_gcc.h
echo "hdefs[\"HAVE_GCC\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GCC" > ${cache}/ctest-HAVE_GCC
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GCC
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for IEEE754 floating point..."
$ECHO_N "checking for IEEE754 floating point..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_IEEE754" ]; then
HAVE_IEEE754=`cat ${cache}/ctest-HAVE_IEEE754`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_IEEE754`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int
main(int argc, char *argv[])
{
float f = 1.5;
double d = 2.5;
f = 0;
d = 0;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_IEEE754="yes"
echo "HAVE_IEEE754=$HAVE_IEEE754" >>Makefile.config
echo "mdefs[\"HAVE_IEEE754\"] = \"$HAVE_IEEE754\"" >>configure.lua
echo "#ifndef HAVE_IEEE754" > config/have_ieee754.h
echo "#define HAVE_IEEE754 \"$HAVE_IEEE754\"" >> config/have_ieee754.h
echo "#endif" >> config/have_ieee754.h
echo "hdefs[\"HAVE_IEEE754\"] = \"$HAVE_IEEE754\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_IEEE754="no"
echo "HAVE_IEEE754=$HAVE_IEEE754" >>Makefile.config
echo "mdefs[\"HAVE_IEEE754\"] = \"$HAVE_IEEE754\"" >>configure.lua
echo "#undef HAVE_IEEE754" >config/have_ieee754.h
echo "hdefs[\"HAVE_IEEE754\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_IEEE754" > ${cache}/ctest-HAVE_IEEE754
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_IEEE754
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking aligned attribute..."
$ECHO_N "checking aligned attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_ALIGNED_ATTRIBUTE" ]; then
HAVE_ALIGNED_ATTRIBUTE=`cat ${cache}/ctest-HAVE_ALIGNED_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_ALIGNED_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int main(int argc, char *argv[])
{
struct s1 { int x,y,z; } __attribute__ ((aligned(16)));
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_ALIGNED_ATTRIBUTE="yes"
echo "HAVE_ALIGNED_ATTRIBUTE=$HAVE_ALIGNED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_ALIGNED_ATTRIBUTE" > config/have_aligned_attribute.h
echo "#define HAVE_ALIGNED_ATTRIBUTE \"$HAVE_ALIGNED_ATTRIBUTE\"" >> config/have_aligned_attribute.h
echo "#endif" >> config/have_aligned_attribute.h
echo "hdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_ALIGNED_ATTRIBUTE="no"
echo "HAVE_ALIGNED_ATTRIBUTE=$HAVE_ALIGNED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_ALIGNED_ATTRIBUTE" >config/have_aligned_attribute.h
echo "hdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_ALIGNED_ATTRIBUTE" > ${cache}/ctest-HAVE_ALIGNED_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_ALIGNED_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking bounded attribute..."
$ECHO_N "checking bounded attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_BOUNDED_ATTRIBUTE" ]; then
HAVE_BOUNDED_ATTRIBUTE=`cat ${cache}/ctest-HAVE_BOUNDED_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_BOUNDED_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
void foo(char *, int) __attribute__ ((__bounded__(__string__,1,2)));
void foo(char *a, int c) { }
int main(int argc, char *argv[])
{
char buf[32];
foo(buf, sizeof(buf));
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_BOUNDED_ATTRIBUTE="yes"
echo "HAVE_BOUNDED_ATTRIBUTE=$HAVE_BOUNDED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_BOUNDED_ATTRIBUTE" > config/have_bounded_attribute.h
echo "#define HAVE_BOUNDED_ATTRIBUTE \"$HAVE_BOUNDED_ATTRIBUTE\"" >> config/have_bounded_attribute.h
echo "#endif" >> config/have_bounded_attribute.h
echo "hdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_BOUNDED_ATTRIBUTE="no"
echo "HAVE_BOUNDED_ATTRIBUTE=$HAVE_BOUNDED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_BOUNDED_ATTRIBUTE" >config/have_bounded_attribute.h
echo "hdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_BOUNDED_ATTRIBUTE" > ${cache}/ctest-HAVE_BOUNDED_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_BOUNDED_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking const attribute..."
$ECHO_N "checking const attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_CONST_ATTRIBUTE" ]; then
HAVE_CONST_ATTRIBUTE=`cat ${cache}/ctest-HAVE_CONST_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_CONST_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int foo(int) __attribute__ ((const));
int foo(int x) { return (x*x); }
int main(int argc, char *argv[])
{
int x = foo(1);
return (x);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_CONST_ATTRIBUTE="yes"
echo "HAVE_CONST_ATTRIBUTE=$HAVE_CONST_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_CONST_ATTRIBUTE" > config/have_const_attribute.h
echo "#define HAVE_CONST_ATTRIBUTE \"$HAVE_CONST_ATTRIBUTE\"" >> config/have_const_attribute.h
echo "#endif" >> config/have_const_attribute.h
echo "hdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_CONST_ATTRIBUTE="no"
echo "HAVE_CONST_ATTRIBUTE=$HAVE_CONST_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_CONST_ATTRIBUTE" >config/have_const_attribute.h
echo "hdefs[\"HAVE_CONST_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_CONST_ATTRIBUTE" > ${cache}/ctest-HAVE_CONST_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_CONST_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking deprecated attribute..."
$ECHO_N "checking deprecated attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_DEPRECATED_ATTRIBUTE" ]; then
HAVE_DEPRECATED_ATTRIBUTE=`cat ${cache}/ctest-HAVE_DEPRECATED_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_DEPRECATED_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
void foo(void) __attribute__ ((deprecated));
void foo(void) { }
int main(int argc, char *argv[])
{
/* foo(); */
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_DEPRECATED_ATTRIBUTE="yes"
echo "HAVE_DEPRECATED_ATTRIBUTE=$HAVE_DEPRECATED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_DEPRECATED_ATTRIBUTE" > config/have_deprecated_attribute.h
echo "#define HAVE_DEPRECATED_ATTRIBUTE \"$HAVE_DEPRECATED_ATTRIBUTE\"" >> config/have_deprecated_attribute.h
echo "#endif" >> config/have_deprecated_attribute.h
echo "hdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_DEPRECATED_ATTRIBUTE="no"
echo "HAVE_DEPRECATED_ATTRIBUTE=$HAVE_DEPRECATED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_DEPRECATED_ATTRIBUTE" >config/have_deprecated_attribute.h
echo "hdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_DEPRECATED_ATTRIBUTE" > ${cache}/ctest-HAVE_DEPRECATED_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_DEPRECATED_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking format attribute..."
$ECHO_N "checking format attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_FORMAT_ATTRIBUTE" ]; then
HAVE_FORMAT_ATTRIBUTE=`cat ${cache}/ctest-HAVE_FORMAT_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_FORMAT_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
void foo1(char *, ...)
__attribute__((__format__ (printf, 1, 2)));
void foo2(char *, ...)
__attribute__((__format__ (__printf__, 1, 2)))
__attribute__((__nonnull__ (1)));
void foo1(char *a, ...) {}
void foo2(char *a, ...) {}
int main(int argc, char *argv[])
{
foo1("foo %s", "bar");
foo2("foo %d", 1);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_FORMAT_ATTRIBUTE="yes"
echo "HAVE_FORMAT_ATTRIBUTE=$HAVE_FORMAT_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_FORMAT_ATTRIBUTE" > config/have_format_attribute.h
echo "#define HAVE_FORMAT_ATTRIBUTE \"$HAVE_FORMAT_ATTRIBUTE\"" >> config/have_format_attribute.h
echo "#endif" >> config/have_format_attribute.h
echo "hdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_FORMAT_ATTRIBUTE="no"
echo "HAVE_FORMAT_ATTRIBUTE=$HAVE_FORMAT_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_FORMAT_ATTRIBUTE" >config/have_format_attribute.h
echo "hdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_FORMAT_ATTRIBUTE" > ${cache}/ctest-HAVE_FORMAT_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_FORMAT_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking nonnull attribute..."
$ECHO_N "checking nonnull attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_NONNULL_ATTRIBUTE" ]; then
HAVE_NONNULL_ATTRIBUTE=`cat ${cache}/ctest-HAVE_NONNULL_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_NONNULL_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
void foo(char *) __attribute__((__nonnull__ (1)));
void foo(char *a) { }
int main(int argc, char *argv[])
{
foo("foo");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_NONNULL_ATTRIBUTE="yes"
echo "HAVE_NONNULL_ATTRIBUTE=$HAVE_NONNULL_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = \"$HAVE_NONNULL_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_NONNULL_ATTRIBUTE" > config/have_nonnull_attribute.h
echo "#define HAVE_NONNULL_ATTRIBUTE \"$HAVE_NONNULL_ATTRIBUTE\"" >> config/have_nonnull_attribute.h
echo "#endif" >> config/have_nonnull_attribute.h
echo "hdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = \"$HAVE_NONNULL_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_NONNULL_ATTRIBUTE="no"
echo "HAVE_NONNULL_ATTRIBUTE=$HAVE_NONNULL_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = \"$HAVE_NONNULL_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_NONNULL_ATTRIBUTE" >config/have_nonnull_attribute.h
echo "hdefs[\"HAVE_NONNULL_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_NONNULL_ATTRIBUTE" > ${cache}/ctest-HAVE_NONNULL_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_NONNULL_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking noreturn attribute..."
$ECHO_N "checking noreturn attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_NORETURN_ATTRIBUTE" ]; then
HAVE_NORETURN_ATTRIBUTE=`cat ${cache}/ctest-HAVE_NORETURN_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_NORETURN_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
void foo(void) __attribute__ ((noreturn));
void foo(void) { _exit(0); }
int main(int argc, char *argv[])
{
foo();
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_NORETURN_ATTRIBUTE="yes"
echo "HAVE_NORETURN_ATTRIBUTE=$HAVE_NORETURN_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_NORETURN_ATTRIBUTE" > config/have_noreturn_attribute.h
echo "#define HAVE_NORETURN_ATTRIBUTE \"$HAVE_NORETURN_ATTRIBUTE\"" >> config/have_noreturn_attribute.h
echo "#endif" >> config/have_noreturn_attribute.h
echo "hdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_NORETURN_ATTRIBUTE="no"
echo "HAVE_NORETURN_ATTRIBUTE=$HAVE_NORETURN_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_NORETURN_ATTRIBUTE" >config/have_noreturn_attribute.h
echo "hdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_NORETURN_ATTRIBUTE" > ${cache}/ctest-HAVE_NORETURN_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_NORETURN_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking packed attribute..."
$ECHO_N "checking packed attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PACKED_ATTRIBUTE" ]; then
HAVE_PACKED_ATTRIBUTE=`cat ${cache}/ctest-HAVE_PACKED_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PACKED_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int main(int argc, char *argv[])
{
struct s1 { char c; int x,y,z; } __attribute__ ((packed));
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PACKED_ATTRIBUTE="yes"
echo "HAVE_PACKED_ATTRIBUTE=$HAVE_PACKED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_PACKED_ATTRIBUTE" > config/have_packed_attribute.h
echo "#define HAVE_PACKED_ATTRIBUTE \"$HAVE_PACKED_ATTRIBUTE\"" >> config/have_packed_attribute.h
echo "#endif" >> config/have_packed_attribute.h
echo "hdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PACKED_ATTRIBUTE="no"
echo "HAVE_PACKED_ATTRIBUTE=$HAVE_PACKED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_PACKED_ATTRIBUTE" >config/have_packed_attribute.h
echo "hdefs[\"HAVE_PACKED_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PACKED_ATTRIBUTE" > ${cache}/ctest-HAVE_PACKED_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PACKED_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking pure attribute..."
$ECHO_N "checking pure attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PURE_ATTRIBUTE" ]; then
HAVE_PURE_ATTRIBUTE=`cat ${cache}/ctest-HAVE_PURE_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PURE_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int foo(int) __attribute__ ((pure));
int foo(int x) { return (x*x); }
int main(int argc, char *argv[])
{
int x = foo(1);
return (x);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PURE_ATTRIBUTE="yes"
echo "HAVE_PURE_ATTRIBUTE=$HAVE_PURE_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_PURE_ATTRIBUTE" > config/have_pure_attribute.h
echo "#define HAVE_PURE_ATTRIBUTE \"$HAVE_PURE_ATTRIBUTE\"" >> config/have_pure_attribute.h
echo "#endif" >> config/have_pure_attribute.h
echo "hdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PURE_ATTRIBUTE="no"
echo "HAVE_PURE_ATTRIBUTE=$HAVE_PURE_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_PURE_ATTRIBUTE" >config/have_pure_attribute.h
echo "hdefs[\"HAVE_PURE_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PURE_ATTRIBUTE" > ${cache}/ctest-HAVE_PURE_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PURE_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking warn_unused_result attribute..."
$ECHO_N "checking warn_unused_result attribute..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" ]; then
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=`cat ${cache}/ctest-HAVE_WARN_UNUSED_RESULT_ATTRIBUTE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_WARN_UNUSED_RESULT_ATTRIBUTE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int foo(void) __attribute__ ((warn_unused_result));
int foo(void) { return (1); }
int main(int argc, char *argv[])
{
int rv = foo();
return (rv);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE="yes"
echo "HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
echo "#ifndef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" > config/have_warn_unused_result_attribute.h
echo "#define HAVE_WARN_UNUSED_RESULT_ATTRIBUTE \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >> config/have_warn_unused_result_attribute.h
echo "#endif" >> config/have_warn_unused_result_attribute.h
echo "hdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE="no"
echo "HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
echo "#undef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" >config/have_warn_unused_result_attribute.h
echo "hdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE" > ${cache}/ctest-HAVE_WARN_UNUSED_RESULT_ATTRIBUTE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_WARN_UNUSED_RESULT_ATTRIBUTE
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking for long double..."
$ECHO_N "checking for long double..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_LONG_DOUBLE" ]; then
HAVE_LONG_DOUBLE=`cat ${cache}/ctest-HAVE_LONG_DOUBLE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_LONG_DOUBLE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int
main(int argc, char *argv[])
{
long double ld = 0.1;
ld = 0;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_LONG_DOUBLE="yes"
echo "#ifndef HAVE_LONG_DOUBLE" > config/have_long_double.h
echo "#define HAVE_LONG_DOUBLE \"$HAVE_LONG_DOUBLE\"" >> config/have_long_double.h
echo "#endif" >> config/have_long_double.h
echo "hdefs[\"HAVE_LONG_DOUBLE\"] = \"$HAVE_LONG_DOUBLE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_LONG_DOUBLE="no"
echo "#undef HAVE_LONG_DOUBLE" >config/have_long_double.h
echo "hdefs[\"HAVE_LONG_DOUBLE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_LONG_DOUBLE" > ${cache}/ctest-HAVE_LONG_DOUBLE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_LONG_DOUBLE
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for long long..."
$ECHO_N "checking for long long..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_LONG_LONG" ]; then
HAVE_LONG_LONG=`cat ${cache}/ctest-HAVE_LONG_LONG`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_LONG_LONG`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int
main(int argc, char *argv[])
{
long long ll = 0.0;
unsigned long long ull = 0.0;
ll = 1.0;
ull = 1.0;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_LONG_LONG="yes"
echo "#ifndef HAVE_LONG_LONG" > config/have_long_long.h
echo "#define HAVE_LONG_LONG \"$HAVE_LONG_LONG\"" >> config/have_long_long.h
echo "#endif" >> config/have_long_long.h
echo "hdefs[\"HAVE_LONG_LONG\"] = \"$HAVE_LONG_LONG\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_LONG_LONG="no"
echo "#undef HAVE_LONG_LONG" >config/have_long_long.h
echo "hdefs[\"HAVE_LONG_LONG\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_LONG_LONG" > ${cache}/ctest-HAVE_LONG_LONG
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_LONG_LONG
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for cygwin environment..."
$ECHO_N "checking for cygwin environment..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_CYGWIN" ]; then
HAVE_CYGWIN=`cat ${cache}/ctest-HAVE_CYGWIN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_CYGWIN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
#include
int
main(int argc, char *argv[]) {
struct stat sb;
DWORD rv;
rv = GetFileAttributes("foo");
stat("foo", &sb);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -mcygwin -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -mcygwin -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_CYGWIN="yes"
echo "HAVE_CYGWIN=$HAVE_CYGWIN" >>Makefile.config
echo "mdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
echo "#ifndef HAVE_CYGWIN" > config/have_cygwin.h
echo "#define HAVE_CYGWIN \"$HAVE_CYGWIN\"" >> config/have_cygwin.h
echo "#endif" >> config/have_cygwin.h
echo "hdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_CYGWIN="no"
echo "HAVE_CYGWIN=$HAVE_CYGWIN" >>Makefile.config
echo "mdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
echo "#undef HAVE_CYGWIN" >config/have_cygwin.h
echo "hdefs[\"HAVE_CYGWIN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_CYGWIN" > ${cache}/ctest-HAVE_CYGWIN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_CYGWIN
fi
rm -f conftest.c $testdir/conftest
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
if [ "${with_cygwin}" != "yes" ]; then
echo "* Disabling cygwin compatibility layer"
CFLAGS="$CFLAGS -mno-cygwin"
echo "CFLAGS=$CFLAGS" >> Makefile.config
else
echo "* Using cygwin compatibility layer"
fi
fi
$ECHO_N "checking for ..."
$ECHO_N "checking for ..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_SYS_TYPES_H" ]; then
_MK_HAVE_SYS_TYPES_H=`cat ${cache}/ctest-_MK_HAVE_SYS_TYPES_H`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_SYS_TYPES_H`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
size_t len = 1;
len++;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_SYS_TYPES_H="yes"
echo "_MK_HAVE_SYS_TYPES_H=$_MK_HAVE_SYS_TYPES_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_SYS_TYPES_H\"] = \"$_MK_HAVE_SYS_TYPES_H\"" >>configure.lua
echo "#ifndef _MK_HAVE_SYS_TYPES_H" > config/_mk_have_sys_types_h.h
echo "#define _MK_HAVE_SYS_TYPES_H \"$_MK_HAVE_SYS_TYPES_H\"" >> config/_mk_have_sys_types_h.h
echo "#endif" >> config/_mk_have_sys_types_h.h
echo "hdefs[\"_MK_HAVE_SYS_TYPES_H\"] = \"$_MK_HAVE_SYS_TYPES_H\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_SYS_TYPES_H="no"
echo "_MK_HAVE_SYS_TYPES_H=$_MK_HAVE_SYS_TYPES_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_SYS_TYPES_H\"] = \"$_MK_HAVE_SYS_TYPES_H\"" >>configure.lua
echo "#undef _MK_HAVE_SYS_TYPES_H" >config/_mk_have_sys_types_h.h
echo "hdefs[\"_MK_HAVE_SYS_TYPES_H\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_SYS_TYPES_H" > ${cache}/ctest-_MK_HAVE_SYS_TYPES_H
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_SYS_TYPES_H
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${_MK_HAVE_SYS_TYPES_H}" = "yes" ]; then
$ECHO_N "checking for 64-bit types..."
$ECHO_N "checking for 64-bit types..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_64BIT" ]; then
HAVE_64BIT=`cat ${cache}/ctest-HAVE_64BIT`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_64BIT`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
int64_t i64 = 0;
u_int64_t u64 = 0;
i64 = 1;
u64 = 1;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_64BIT="yes"
echo "HAVE_64BIT=$HAVE_64BIT" >>Makefile.config
echo "mdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
echo "#ifndef HAVE_64BIT" > config/have_64bit.h
echo "#define HAVE_64BIT \"$HAVE_64BIT\"" >> config/have_64bit.h
echo "#endif" >> config/have_64bit.h
echo "hdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_64BIT="no"
echo "HAVE_64BIT=$HAVE_64BIT" >>Makefile.config
echo "mdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
echo "#undef HAVE_64BIT" >config/have_64bit.h
echo "hdefs[\"HAVE_64BIT\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_64BIT" > ${cache}/ctest-HAVE_64BIT
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_64BIT
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for conflicting typedefs..."
$ECHO_N "checking for conflicting typedefs..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS" ]; then
_MK_HAVE_UNSIGNED_TYPEDEFS=`cat ${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_UNSIGNED_TYPEDEFS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
Uchar foo = 0;
Uint bar = 0;
Ulong baz = 0;
foo = 1; bar = 2; baz = 3;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_UNSIGNED_TYPEDEFS="yes"
echo "_MK_HAVE_UNSIGNED_TYPEDEFS=$_MK_HAVE_UNSIGNED_TYPEDEFS" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
echo "#ifndef _MK_HAVE_UNSIGNED_TYPEDEFS" > config/_mk_have_unsigned_typedefs.h
echo "#define _MK_HAVE_UNSIGNED_TYPEDEFS \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >> config/_mk_have_unsigned_typedefs.h
echo "#endif" >> config/_mk_have_unsigned_typedefs.h
echo "hdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_UNSIGNED_TYPEDEFS="no"
echo "_MK_HAVE_UNSIGNED_TYPEDEFS=$_MK_HAVE_UNSIGNED_TYPEDEFS" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
echo "#undef _MK_HAVE_UNSIGNED_TYPEDEFS" >config/_mk_have_unsigned_typedefs.h
echo "hdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_UNSIGNED_TYPEDEFS" > ${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_UNSIGNED_TYPEDEFS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
else
echo "#undef HAVE_64BIT" >config/have_64bit.h
echo "hdefs[\"HAVE_64BIT\"] = nil" >>configure.lua
$ECHO_N "checking for conflicting typedefs..."
$ECHO_N "checking for conflicting typedefs..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS" ]; then
_MK_HAVE_UNSIGNED_TYPEDEFS=`cat ${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_UNSIGNED_TYPEDEFS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int main(int argc, char *argv[]) {
Uchar foo = 0;
Uint bar = 0;
Ulong baz = 0;
foo = 1; bar = 2; baz = 3;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_UNSIGNED_TYPEDEFS="yes"
echo "_MK_HAVE_UNSIGNED_TYPEDEFS=$_MK_HAVE_UNSIGNED_TYPEDEFS" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
echo "#ifndef _MK_HAVE_UNSIGNED_TYPEDEFS" > config/_mk_have_unsigned_typedefs.h
echo "#define _MK_HAVE_UNSIGNED_TYPEDEFS \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >> config/_mk_have_unsigned_typedefs.h
echo "#endif" >> config/_mk_have_unsigned_typedefs.h
echo "hdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_UNSIGNED_TYPEDEFS="no"
echo "_MK_HAVE_UNSIGNED_TYPEDEFS=$_MK_HAVE_UNSIGNED_TYPEDEFS" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = \"$_MK_HAVE_UNSIGNED_TYPEDEFS\"" >>configure.lua
echo "#undef _MK_HAVE_UNSIGNED_TYPEDEFS" >config/_mk_have_unsigned_typedefs.h
echo "hdefs[\"_MK_HAVE_UNSIGNED_TYPEDEFS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_UNSIGNED_TYPEDEFS" > ${cache}/ctest-_MK_HAVE_UNSIGNED_TYPEDEFS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_UNSIGNED_TYPEDEFS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
fi;
$ECHO_N "checking for ..."
$ECHO_N "checking for ..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_STDLIB_H" ]; then
_MK_HAVE_STDLIB_H=`cat ${cache}/ctest-_MK_HAVE_STDLIB_H`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_STDLIB_H`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
void *foo = malloc(1);
free(foo);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_STDLIB_H="yes"
echo "_MK_HAVE_STDLIB_H=$_MK_HAVE_STDLIB_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
echo "#ifndef _MK_HAVE_STDLIB_H" > config/_mk_have_stdlib_h.h
echo "#define _MK_HAVE_STDLIB_H \"$_MK_HAVE_STDLIB_H\"" >> config/_mk_have_stdlib_h.h
echo "#endif" >> config/_mk_have_stdlib_h.h
echo "hdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_STDLIB_H="no"
echo "_MK_HAVE_STDLIB_H=$_MK_HAVE_STDLIB_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
echo "#undef _MK_HAVE_STDLIB_H" >config/_mk_have_stdlib_h.h
echo "hdefs[\"_MK_HAVE_STDLIB_H\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_STDLIB_H" > ${cache}/ctest-_MK_HAVE_STDLIB_H
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_STDLIB_H
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for ..."
$ECHO_N "checking for ..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_UNISTD_H" ]; then
_MK_HAVE_UNISTD_H=`cat ${cache}/ctest-_MK_HAVE_UNISTD_H`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_UNISTD_H`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[]) {
uid_t uid = 0;
pid_t pid = 0;
uid = getuid();
pid = getpid();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_UNISTD_H="yes"
echo "_MK_HAVE_UNISTD_H=$_MK_HAVE_UNISTD_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNISTD_H\"] = \"$_MK_HAVE_UNISTD_H\"" >>configure.lua
echo "#ifndef _MK_HAVE_UNISTD_H" > config/_mk_have_unistd_h.h
echo "#define _MK_HAVE_UNISTD_H \"$_MK_HAVE_UNISTD_H\"" >> config/_mk_have_unistd_h.h
echo "#endif" >> config/_mk_have_unistd_h.h
echo "hdefs[\"_MK_HAVE_UNISTD_H\"] = \"$_MK_HAVE_UNISTD_H\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_UNISTD_H="no"
echo "_MK_HAVE_UNISTD_H=$_MK_HAVE_UNISTD_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNISTD_H\"] = \"$_MK_HAVE_UNISTD_H\"" >>configure.lua
echo "#undef _MK_HAVE_UNISTD_H" >config/_mk_have_unistd_h.h
echo "hdefs[\"_MK_HAVE_UNISTD_H\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_UNISTD_H" > ${cache}/ctest-_MK_HAVE_UNISTD_H
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_UNISTD_H
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for compatible ..."
$ECHO_N "checking for compatible ..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_LIMITS_H" ]; then
_MK_HAVE_LIMITS_H=`cat ${cache}/ctest-_MK_HAVE_LIMITS_H`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_LIMITS_H`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
int i;
unsigned u;
long l;
unsigned long ul;
i = INT_MIN; i = INT_MAX; u = UINT_MAX;
l = LONG_MIN; l = LONG_MAX; ul = ULONG_MAX;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_LIMITS_H="yes"
echo "_MK_HAVE_LIMITS_H=$_MK_HAVE_LIMITS_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
echo "#ifndef _MK_HAVE_LIMITS_H" > config/_mk_have_limits_h.h
echo "#define _MK_HAVE_LIMITS_H \"$_MK_HAVE_LIMITS_H\"" >> config/_mk_have_limits_h.h
echo "#endif" >> config/_mk_have_limits_h.h
echo "hdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_LIMITS_H="no"
echo "_MK_HAVE_LIMITS_H=$_MK_HAVE_LIMITS_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
echo "#undef _MK_HAVE_LIMITS_H" >config/_mk_have_limits_h.h
echo "hdefs[\"_MK_HAVE_LIMITS_H\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_LIMITS_H" > ${cache}/ctest-_MK_HAVE_LIMITS_H
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_LIMITS_H
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for compatible ..."
$ECHO_N "checking for compatible ..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_FLOAT_H" ]; then
_MK_HAVE_FLOAT_H=`cat ${cache}/ctest-_MK_HAVE_FLOAT_H`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_FLOAT_H`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
float flt = 0.0f;
double dbl = 0.0;
flt += FLT_EPSILON;
dbl += DBL_EPSILON;
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_FLOAT_H="yes"
echo "_MK_HAVE_FLOAT_H=$_MK_HAVE_FLOAT_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_FLOAT_H\"] = \"$_MK_HAVE_FLOAT_H\"" >>configure.lua
echo "#ifndef _MK_HAVE_FLOAT_H" > config/_mk_have_float_h.h
echo "#define _MK_HAVE_FLOAT_H \"$_MK_HAVE_FLOAT_H\"" >> config/_mk_have_float_h.h
echo "#endif" >> config/_mk_have_float_h.h
echo "hdefs[\"_MK_HAVE_FLOAT_H\"] = \"$_MK_HAVE_FLOAT_H\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_FLOAT_H="no"
echo "_MK_HAVE_FLOAT_H=$_MK_HAVE_FLOAT_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_FLOAT_H\"] = \"$_MK_HAVE_FLOAT_H\"" >>configure.lua
echo "#undef _MK_HAVE_FLOAT_H" >config/_mk_have_float_h.h
echo "hdefs[\"_MK_HAVE_FLOAT_H\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_FLOAT_H" > ${cache}/ctest-_MK_HAVE_FLOAT_H
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_FLOAT_H
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for the __progname variable..."
$ECHO_N "checking for the __progname variable..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PROGNAME" ]; then
HAVE_PROGNAME=`cat ${cache}/ctest-HAVE_PROGNAME`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PROGNAME`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
extern char *__progname;
printf("%s\n", __progname);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PROGNAME="yes"
echo "#ifndef HAVE_PROGNAME" > config/have_progname.h
echo "#define HAVE_PROGNAME \"$HAVE_PROGNAME\"" >> config/have_progname.h
echo "#endif" >> config/have_progname.h
echo "hdefs[\"HAVE_PROGNAME\"] = \"$HAVE_PROGNAME\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PROGNAME="no"
echo "#undef HAVE_PROGNAME" >config/have_progname.h
echo "hdefs[\"HAVE_PROGNAME\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PROGNAME" > ${cache}/ctest-HAVE_PROGNAME
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PROGNAME
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for free(NULL) is a no-op..."
$ECHO_N "checking for free(NULL) is a no-op..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-FREE_NULL_IS_A_NOOP" ]; then
FREE_NULL_IS_A_NOOP=`cat ${cache}/ctest-FREE_NULL_IS_A_NOOP`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-FREE_NULL_IS_A_NOOP`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-FREE_NULL_IS_A_NOOP`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[]) {
free(NULL);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
FREE_NULL_IS_A_NOOP="yes"
echo "FREE_NULL_IS_A_NOOP=$FREE_NULL_IS_A_NOOP" >>Makefile.config
echo "mdefs[\"FREE_NULL_IS_A_NOOP\"] = \"$FREE_NULL_IS_A_NOOP\"" >>configure.lua
echo "#ifndef FREE_NULL_IS_A_NOOP" > config/free_null_is_a_noop.h
echo "#define FREE_NULL_IS_A_NOOP \"$FREE_NULL_IS_A_NOOP\"" >> config/free_null_is_a_noop.h
echo "#endif" >> config/free_null_is_a_noop.h
echo "hdefs[\"FREE_NULL_IS_A_NOOP\"] = \"$FREE_NULL_IS_A_NOOP\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
FREE_NULL_IS_A_NOOP="no"
echo "FREE_NULL_IS_A_NOOP=$FREE_NULL_IS_A_NOOP" >>Makefile.config
echo "mdefs[\"FREE_NULL_IS_A_NOOP\"] = \"$FREE_NULL_IS_A_NOOP\"" >>configure.lua
echo "#undef FREE_NULL_IS_A_NOOP" >config/free_null_is_a_noop.h
echo "hdefs[\"FREE_NULL_IS_A_NOOP\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
FREE_NULL_IS_A_NOOP="no"
echo "FREE_NULL_IS_A_NOOP=$FREE_NULL_IS_A_NOOP" >>Makefile.config
echo "mdefs[\"FREE_NULL_IS_A_NOOP\"] = \"$FREE_NULL_IS_A_NOOP\"" >>configure.lua
echo "#undef FREE_NULL_IS_A_NOOP" >config/free_null_is_a_noop.h
echo "hdefs[\"FREE_NULL_IS_A_NOOP\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$FREE_NULL_IS_A_NOOP" > ${cache}/ctest-FREE_NULL_IS_A_NOOP
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-FREE_NULL_IS_A_NOOP
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-FREE_NULL_IS_A_NOOP
fi
rm -f conftest.c $testdir/conftest
$ECHO_N "checking for the C math library..."
$ECHO_N "checking for the C math library..." >> config.log
MATH_LIBS="-lm"
MATH_CFLAGS=""
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_MATH" ]; then
HAVE_MATH=`cat ${cache}/ctest-HAVE_MATH`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_MATH`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
double d = 1.0;
d = fabs(d);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_CFLAGS} -o $testdir/conftest conftest.c ${MATH_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_CFLAGS} -o $testdir/conftest conftest.c ${MATH_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_MATH="yes"
echo "HAVE_MATH=$HAVE_MATH" >>Makefile.config
echo "mdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
echo "#ifndef HAVE_MATH" > config/have_math.h
echo "#define HAVE_MATH \"$HAVE_MATH\"" >> config/have_math.h
echo "#endif" >> config/have_math.h
echo "hdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_MATH="no"
echo "HAVE_MATH=$HAVE_MATH" >>Makefile.config
echo "mdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
echo "#undef HAVE_MATH" >config/have_math.h
echo "hdefs[\"HAVE_MATH\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_MATH" > ${cache}/ctest-HAVE_MATH
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_MATH
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_MATH}" = "yes" ]; then
echo "MATH_CFLAGS=$MATH_CFLAGS" >>Makefile.config
echo "mdefs[\"MATH_CFLAGS\"] = \"$MATH_CFLAGS\"" >>configure.lua
echo "MATH_LIBS=$MATH_LIBS" >>Makefile.config
echo "mdefs[\"MATH_LIBS\"] = \"$MATH_LIBS\"" >>configure.lua
echo "#ifndef MATH_CFLAGS" > config/math_cflags.h
echo "#define MATH_CFLAGS \"$MATH_CFLAGS\"" >> config/math_cflags.h
echo "#endif" >> config/math_cflags.h
echo "hdefs[\"MATH_CFLAGS\"] = \"$MATH_CFLAGS\"" >>configure.lua
echo "#ifndef MATH_LIBS" > config/math_libs.h
echo "#define MATH_LIBS \"$MATH_LIBS\"" >> config/math_libs.h
echo "#endif" >> config/math_libs.h
echo "hdefs[\"MATH_LIBS\"] = \"$MATH_LIBS\"" >>configure.lua
else
echo "#undef MATH_LIBS" >config/math_libs.h
echo "hdefs[\"MATH_LIBS\"] = nil" >>configure.lua
fi;
$ECHO_N "checking for the C math library (C99)..."
$ECHO_N "checking for the C math library (C99)..." >> config.log
MATH_C99_LIBS="-lm"
MATH_C99_CFLAGS=""
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_MATH_C99" ]; then
HAVE_MATH_C99=`cat ${cache}/ctest-HAVE_MATH_C99`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_MATH_C99`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
float f = 1.0;
double d = 1.0;
d = fabs(d);
f = fabsf(f);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_C99_CFLAGS} -o $testdir/conftest conftest.c ${MATH_C99_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_C99_CFLAGS} -o $testdir/conftest conftest.c ${MATH_C99_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_MATH_C99="yes"
echo "HAVE_MATH_C99=$HAVE_MATH_C99" >>Makefile.config
echo "mdefs[\"HAVE_MATH_C99\"] = \"$HAVE_MATH_C99\"" >>configure.lua
echo "#ifndef HAVE_MATH_C99" > config/have_math_c99.h
echo "#define HAVE_MATH_C99 \"$HAVE_MATH_C99\"" >> config/have_math_c99.h
echo "#endif" >> config/have_math_c99.h
echo "hdefs[\"HAVE_MATH_C99\"] = \"$HAVE_MATH_C99\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_MATH_C99="no"
echo "HAVE_MATH_C99=$HAVE_MATH_C99" >>Makefile.config
echo "mdefs[\"HAVE_MATH_C99\"] = \"$HAVE_MATH_C99\"" >>configure.lua
echo "#undef HAVE_MATH_C99" >config/have_math_c99.h
echo "hdefs[\"HAVE_MATH_C99\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_MATH_C99" > ${cache}/ctest-HAVE_MATH_C99
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_MATH_C99
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_MATH_C99}" = "yes" ]; then
echo "MATH_C99_CFLAGS=$MATH_C99_CFLAGS" >>Makefile.config
echo "mdefs[\"MATH_C99_CFLAGS\"] = \"$MATH_C99_CFLAGS\"" >>configure.lua
echo "MATH_C99_LIBS=$MATH_C99_LIBS" >>Makefile.config
echo "mdefs[\"MATH_C99_LIBS\"] = \"$MATH_C99_LIBS\"" >>configure.lua
echo "#ifndef MATH_C99_CFLAGS" > config/math_c99_cflags.h
echo "#define MATH_C99_CFLAGS \"$MATH_C99_CFLAGS\"" >> config/math_c99_cflags.h
echo "#endif" >> config/math_c99_cflags.h
echo "hdefs[\"MATH_C99_CFLAGS\"] = \"$MATH_C99_CFLAGS\"" >>configure.lua
echo "#ifndef MATH_C99_LIBS" > config/math_c99_libs.h
echo "#define MATH_C99_LIBS \"$MATH_C99_LIBS\"" >> config/math_c99_libs.h
echo "#endif" >> config/math_c99_libs.h
echo "hdefs[\"MATH_C99_LIBS\"] = \"$MATH_C99_LIBS\"" >>configure.lua
else
echo "#undef MATH_C99_LIBS" >config/math_c99_libs.h
echo "hdefs[\"MATH_C99_LIBS\"] = nil" >>configure.lua
fi;
$ECHO_N "checking for a getpwuid() function..."
$ECHO_N "checking for a getpwuid() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETPWUID" ]; then
HAVE_GETPWUID=`cat ${cache}/ctest-HAVE_GETPWUID`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETPWUID`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
struct passwd *pwd;
uid_t uid = 0;
pwd = getpwuid(uid);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETPWUID="yes"
echo "#ifndef HAVE_GETPWUID" > config/have_getpwuid.h
echo "#define HAVE_GETPWUID \"$HAVE_GETPWUID\"" >> config/have_getpwuid.h
echo "#endif" >> config/have_getpwuid.h
echo "hdefs[\"HAVE_GETPWUID\"] = \"$HAVE_GETPWUID\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETPWUID="no"
echo "#undef HAVE_GETPWUID" >config/have_getpwuid.h
echo "hdefs[\"HAVE_GETPWUID\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETPWUID" > ${cache}/ctest-HAVE_GETPWUID
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETPWUID
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for a getuid() function..."
$ECHO_N "checking for a getuid() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETUID" ]; then
HAVE_GETUID=`cat ${cache}/ctest-HAVE_GETUID`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETUID`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
uid_t uid;
uid = getuid();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETUID="yes"
echo "#ifndef HAVE_GETUID" > config/have_getuid.h
echo "#define HAVE_GETUID \"$HAVE_GETUID\"" >> config/have_getuid.h
echo "#endif" >> config/have_getuid.h
echo "hdefs[\"HAVE_GETUID\"] = \"$HAVE_GETUID\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETUID="no"
echo "#undef HAVE_GETUID" >config/have_getuid.h
echo "hdefs[\"HAVE_GETUID\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETUID" > ${cache}/ctest-HAVE_GETUID
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETUID
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for a strsep() function..."
$ECHO_N "checking for a strsep() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_STRSEP" ]; then
HAVE_STRSEP=`cat ${cache}/ctest-HAVE_STRSEP`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_STRSEP`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
(void)strsep(NULL, NULL);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_STRSEP="yes"
echo "#ifndef HAVE_STRSEP" > config/have_strsep.h
echo "#define HAVE_STRSEP \"$HAVE_STRSEP\"" >> config/have_strsep.h
echo "#endif" >> config/have_strsep.h
echo "hdefs[\"HAVE_STRSEP\"] = \"$HAVE_STRSEP\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_STRSEP="no"
echo "#undef HAVE_STRSEP" >config/have_strsep.h
echo "hdefs[\"HAVE_STRSEP\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_STRSEP" > ${cache}/ctest-HAVE_STRSEP
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_STRSEP
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for the snprintf() function..."
$ECHO_N "checking for the snprintf() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SNPRINTF" ]; then
HAVE_SNPRINTF=`cat ${cache}/ctest-HAVE_SNPRINTF`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SNPRINTF`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
char buf[16];
(void)snprintf(buf, sizeof(buf), "foo");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SNPRINTF="yes"
echo "#ifndef HAVE_SNPRINTF" > config/have_snprintf.h
echo "#define HAVE_SNPRINTF \"$HAVE_SNPRINTF\"" >> config/have_snprintf.h
echo "#endif" >> config/have_snprintf.h
echo "hdefs[\"HAVE_SNPRINTF\"] = \"$HAVE_SNPRINTF\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_SNPRINTF="no"
echo "#undef HAVE_SNPRINTF" >config/have_snprintf.h
echo "hdefs[\"HAVE_SNPRINTF\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SNPRINTF" > ${cache}/ctest-HAVE_SNPRINTF
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SNPRINTF
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for the vsnprintf() function..."
$ECHO_N "checking for the vsnprintf() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_VSNPRINTF" ]; then
HAVE_VSNPRINTF=`cat ${cache}/ctest-HAVE_VSNPRINTF`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_VSNPRINTF`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
static void
testfmt(const char *fmt, ...)
{
char buf[16];
va_list ap;
va_start(ap, fmt);
(void)vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
}
int
main(int argc, char *argv[])
{
testfmt("foo", 1, 2, 3);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_VSNPRINTF="yes"
echo "#ifndef HAVE_VSNPRINTF" > config/have_vsnprintf.h
echo "#define HAVE_VSNPRINTF \"$HAVE_VSNPRINTF\"" >> config/have_vsnprintf.h
echo "#endif" >> config/have_vsnprintf.h
echo "hdefs[\"HAVE_VSNPRINTF\"] = \"$HAVE_VSNPRINTF\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_VSNPRINTF="no"
echo "#undef HAVE_VSNPRINTF" >config/have_vsnprintf.h
echo "hdefs[\"HAVE_VSNPRINTF\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_VSNPRINTF" > ${cache}/ctest-HAVE_VSNPRINTF
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_VSNPRINTF
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for a vasprintf() function..."
$ECHO_N "checking for a vasprintf() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_VASPRINTF" ]; then
HAVE_VASPRINTF=`cat ${cache}/ctest-HAVE_VASPRINTF`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_VASPRINTF`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef __linux__
#define _GNU_SOURCE
#endif
#include
#include
int
testprintf(const char *fmt, ...)
{
va_list args;
char *buf;
va_start(args, fmt);
if (vasprintf(&buf, "%s", args) == -1) {
return (-1);
}
va_end(args);
return (0);
}
int
main(int argc, char *argv[])
{
return (testprintf("foo %s", "bar"));
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_VASPRINTF="yes"
echo "#ifndef HAVE_VASPRINTF" > config/have_vasprintf.h
echo "#define HAVE_VASPRINTF \"$HAVE_VASPRINTF\"" >> config/have_vasprintf.h
echo "#endif" >> config/have_vasprintf.h
echo "hdefs[\"HAVE_VASPRINTF\"] = \"$HAVE_VASPRINTF\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_VASPRINTF="no"
echo "#undef HAVE_VASPRINTF" >config/have_vasprintf.h
echo "hdefs[\"HAVE_VASPRINTF\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_VASPRINTF" > ${cache}/ctest-HAVE_VASPRINTF
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_VASPRINTF
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for MD5 functions..."
$ECHO_N "checking for MD5 functions..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_MD5" ]; then
HAVE_MD5=`cat ${cache}/ctest-HAVE_MD5`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_MD5`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
MD5_CTX md5;
MD5Init(&md5);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_MD5="yes"
echo "#ifndef HAVE_MD5" > config/have_md5.h
echo "#define HAVE_MD5 \"$HAVE_MD5\"" >> config/have_md5.h
echo "#endif" >> config/have_md5.h
echo "hdefs[\"HAVE_MD5\"] = \"$HAVE_MD5\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_MD5="no"
echo "#undef HAVE_MD5" >config/have_md5.h
echo "hdefs[\"HAVE_MD5\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_MD5" > ${cache}/ctest-HAVE_MD5
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_MD5
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for SHA1 functions..."
$ECHO_N "checking for SHA1 functions..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SHA1" ]; then
HAVE_SHA1=`cat ${cache}/ctest-HAVE_SHA1`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SHA1`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
SHA1_CTX sha1;
SHA1Init(&sha1);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SHA1="yes"
echo "#ifndef HAVE_SHA1" > config/have_sha1.h
echo "#define HAVE_SHA1 \"$HAVE_SHA1\"" >> config/have_sha1.h
echo "#endif" >> config/have_sha1.h
echo "hdefs[\"HAVE_SHA1\"] = \"$HAVE_SHA1\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_SHA1="no"
echo "#undef HAVE_SHA1" >config/have_sha1.h
echo "hdefs[\"HAVE_SHA1\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SHA1" > ${cache}/ctest-HAVE_SHA1
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SHA1
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for RMD160 functions..."
$ECHO_N "checking for RMD160 functions..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_RMD160" ]; then
HAVE_RMD160=`cat ${cache}/ctest-HAVE_RMD160`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_RMD160`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
RMD160_CTX rmd160;
RMD160Init(&rmd160);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_RMD160="yes"
echo "#ifndef HAVE_RMD160" > config/have_rmd160.h
echo "#define HAVE_RMD160 \"$HAVE_RMD160\"" >> config/have_rmd160.h
echo "#endif" >> config/have_rmd160.h
echo "hdefs[\"HAVE_RMD160\"] = \"$HAVE_RMD160\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_RMD160="no"
echo "#undef HAVE_RMD160" >config/have_rmd160.h
echo "hdefs[\"HAVE_RMD160\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_RMD160" > ${cache}/ctest-HAVE_RMD160
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_RMD160
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for the X window system..."
$ECHO_N "checking for the X window system..." >> config.log
X11_CFLAGS=""
X11_LIBS=""
if [ -d /usr/include/X11/X11 ]; then
X11_CFLAGS="-I/usr/include/X11"
fi;
if [ -d /usr/include/X11R6/X11 ]; then
X11_CFLAGS="-I/usr/include/X11R6"
fi;
if [ -d /usr/local/X11/include/X11 ]; then
X11_CFLAGS="-I/usr/local/X11/include"
fi;
if [ -d /usr/local/X11R6/include/X11 ]; then
X11_CFLAGS="-I/usr/local/X11R6/include"
fi;
if [ -d /usr/local/include/X11/X11 ]; then
X11_CFLAGS="-I/usr/local/include/X11"
fi;
if [ -d /usr/local/include/X11R6/X11 ]; then
X11_CFLAGS="-I/usr/local/include/X11R6"
fi;
if [ -d /usr/X11/include/X11 ]; then
X11_CFLAGS="-I/usr/X11/include"
fi;
if [ -d /usr/X11R6/include/X11 ]; then
X11_CFLAGS="-I/usr/X11R6/include"
fi;
if [ -d /usr/local/X11/lib ]; then
X11_LIBS="-L/usr/local/X11/lib"
fi;
if [ -d /usr/local/X11R6/lib ]; then
X11_LIBS="-L/usr/local/X11R6/lib"
fi;
if [ -d /usr/X11/lib ]; then
X11_LIBS="-L/usr/X11/lib"
fi;
if [ -d /usr/X11R6/lib ]; then
X11_LIBS="-L/usr/X11R6/lib"
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_X11" ]; then
HAVE_X11=`cat ${cache}/ctest-HAVE_X11`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_X11`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[])
{
Display *disp;
disp = XOpenDisplay(NULL);
XCloseDisplay(disp);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest conftest.c ${X11_LIBS} -lX11" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest conftest.c ${X11_LIBS} -lX11 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_X11="yes"
echo "HAVE_X11=$HAVE_X11" >>Makefile.config
echo "mdefs[\"HAVE_X11\"] = \"$HAVE_X11\"" >>configure.lua
echo "#ifndef HAVE_X11" > config/have_x11.h
echo "#define HAVE_X11 \"$HAVE_X11\"" >> config/have_x11.h
echo "#endif" >> config/have_x11.h
echo "hdefs[\"HAVE_X11\"] = \"$HAVE_X11\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_X11="no"
echo "HAVE_X11=$HAVE_X11" >>Makefile.config
echo "mdefs[\"HAVE_X11\"] = \"$HAVE_X11\"" >>configure.lua
echo "#undef HAVE_X11" >config/have_x11.h
echo "hdefs[\"HAVE_X11\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_X11" > ${cache}/ctest-HAVE_X11
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_X11
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_X11}" != "" ]; then
echo "#ifndef X11_CFLAGS" > config/x11_cflags.h
echo "#define X11_CFLAGS \"$X11_CFLAGS\"" >> config/x11_cflags.h
echo "#endif" >> config/x11_cflags.h
echo "hdefs[\"X11_CFLAGS\"] = \"$X11_CFLAGS\"" >>configure.lua
echo "#ifndef X11_LIBS" > config/x11_libs.h
echo "#define X11_LIBS \"$X11_LIBS\"" >> config/x11_libs.h
echo "#endif" >> config/x11_libs.h
echo "hdefs[\"X11_LIBS\"] = \"$X11_LIBS\"" >>configure.lua
echo "X11_CFLAGS=$X11_CFLAGS" >>Makefile.config
echo "mdefs[\"X11_CFLAGS\"] = \"$X11_CFLAGS\"" >>configure.lua
echo "X11_LIBS=$X11_LIBS" >>Makefile.config
echo "mdefs[\"X11_LIBS\"] = \"$X11_LIBS\"" >>configure.lua
else
echo "#undef X11_CFLAGS" >config/x11_cflags.h
echo "hdefs[\"X11_CFLAGS\"] = nil" >>configure.lua
echo "#undef X11_LIBS" >config/x11_libs.h
echo "hdefs[\"X11_LIBS\"] = nil" >>configure.lua
fi;
$ECHO_N "checking for the signal() function..."
$ECHO_N "checking for the signal() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_SIGNAL" ]; then
_MK_HAVE_SIGNAL=`cat ${cache}/ctest-_MK_HAVE_SIGNAL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_SIGNAL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
void
sighandler(int sig)
{
}
int
main(int argc, char *argv[])
{
signal(SIGTERM, sighandler);
signal(SIGILL, sighandler);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_SIGNAL="yes"
echo "#ifndef _MK_HAVE_SIGNAL" > config/_mk_have_signal.h
echo "#define _MK_HAVE_SIGNAL \"$_MK_HAVE_SIGNAL\"" >> config/_mk_have_signal.h
echo "#endif" >> config/_mk_have_signal.h
echo "hdefs[\"_MK_HAVE_SIGNAL\"] = \"$_MK_HAVE_SIGNAL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_SIGNAL="no"
echo "#undef _MK_HAVE_SIGNAL" >config/_mk_have_signal.h
echo "hdefs[\"_MK_HAVE_SIGNAL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_SIGNAL" > ${cache}/ctest-_MK_HAVE_SIGNAL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_SIGNAL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for setjmp() and longjmp()..."
$ECHO_N "checking for setjmp() and longjmp()..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_SETJMP" ]; then
_MK_HAVE_SETJMP=`cat ${cache}/ctest-_MK_HAVE_SETJMP`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_SETJMP`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
jmp_buf jmpbuf;
int
main(int argc, char *argv[])
{
longjmp(jmpbuf, 1);
setjmp(jmpbuf);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_SETJMP="yes"
echo "#ifndef _MK_HAVE_SETJMP" > config/_mk_have_setjmp.h
echo "#define _MK_HAVE_SETJMP \"$_MK_HAVE_SETJMP\"" >> config/_mk_have_setjmp.h
echo "#endif" >> config/_mk_have_setjmp.h
echo "hdefs[\"_MK_HAVE_SETJMP\"] = \"$_MK_HAVE_SETJMP\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_SETJMP="no"
echo "#undef _MK_HAVE_SETJMP" >config/_mk_have_setjmp.h
echo "hdefs[\"_MK_HAVE_SETJMP\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_SETJMP" > ${cache}/ctest-_MK_HAVE_SETJMP
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_SETJMP
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for a strtoll() function..."
$ECHO_N "checking for a strtoll() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_STRTOLL" ]; then
_MK_HAVE_STRTOLL=`cat ${cache}/ctest-_MK_HAVE_STRTOLL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_STRTOLL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
long long int lli;
char *ep = NULL;
char *foo = "1234";
lli = strtoll(foo, &ep, 10);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_STRTOLL="yes"
echo "#ifndef _MK_HAVE_STRTOLL" > config/_mk_have_strtoll.h
echo "#define _MK_HAVE_STRTOLL \"$_MK_HAVE_STRTOLL\"" >> config/_mk_have_strtoll.h
echo "#endif" >> config/_mk_have_strtoll.h
echo "hdefs[\"_MK_HAVE_STRTOLL\"] = \"$_MK_HAVE_STRTOLL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_STRTOLL="no"
echo "#undef _MK_HAVE_STRTOLL" >config/_mk_have_strtoll.h
echo "hdefs[\"_MK_HAVE_STRTOLL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_STRTOLL" > ${cache}/ctest-_MK_HAVE_STRTOLL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_STRTOLL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "checking for a strtold() function..."
$ECHO_N "checking for a strtold() function..." >> config.log
if [ "${HAVE_LONG_DOUBLE}" = "yes" ]; then
if [ "${HAVE_CYGWIN}" = "no" ]; then
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_HAVE_STRTOLD" ]; then
_MK_HAVE_STRTOLD=`cat ${cache}/ctest-_MK_HAVE_STRTOLD`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_HAVE_STRTOLD`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#define _XOPEN_SOURCE 600
#include
int
main(int argc, char *argv[])
{
long double ld;
char *ep = NULL;
char *foo = "1234";
ld = strtold(foo, &ep);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
_MK_HAVE_STRTOLD="yes"
echo "#ifndef _MK_HAVE_STRTOLD" > config/_mk_have_strtold.h
echo "#define _MK_HAVE_STRTOLD \"$_MK_HAVE_STRTOLD\"" >> config/_mk_have_strtold.h
echo "#endif" >> config/_mk_have_strtold.h
echo "hdefs[\"_MK_HAVE_STRTOLD\"] = \"$_MK_HAVE_STRTOLD\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
_MK_HAVE_STRTOLD="no"
echo "#undef _MK_HAVE_STRTOLD" >config/_mk_have_strtold.h
echo "hdefs[\"_MK_HAVE_STRTOLD\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_HAVE_STRTOLD" > ${cache}/ctest-_MK_HAVE_STRTOLD
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_HAVE_STRTOLD
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
else
_MK_HAVE_STRTOLD="no"
echo "#undef _MK_HAVE_STRTOLD" >config/_mk_have_strtold.h
echo "hdefs[\"_MK_HAVE_STRTOLD\"] = nil" >>configure.lua
echo "not checking (cygwin issues)"
echo "not checking (cygwin issues)" >> config.log
fi;
else
_MK_HAVE_STRTOLD="no"
echo "#undef _MK_HAVE_STRTOLD" >config/_mk_have_strtold.h
echo "hdefs[\"_MK_HAVE_STRTOLD\"] = nil" >>configure.lua
echo "skipping (no long double)"
echo "skipping (no long double)" >> config.log
fi;
$ECHO_N "checking for AltiVec (with )..."
$ECHO_N "checking for AltiVec (with )..." >> config.log
if [ "$SYSTEM" = "Darwin" ]; then
ALTIVEC_CFLAGS="-faltivec -maltivec"
ALTIVEC_CHECK_CFLAGS="-D_DARWIN_C_SOURCE"
echo "ALTIVEC_CHECK_CFLAGS=$ALTIVEC_CHECK_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CHECK_CFLAGS\"] = \"$ALTIVEC_CHECK_CFLAGS\"" >>configure.lua
else
ALTIVEC_CFLAGS="-mabi=altivec -maltivec"
ALTIVEC_CHECK_CFLAGS=""
echo "ALTIVEC_CHECK_CFLAGS=$ALTIVEC_CHECK_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CHECK_CFLAGS\"] = \"$ALTIVEC_CHECK_CFLAGS\"" >>configure.lua
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_ALTIVEC" ]; then
HAVE_ALTIVEC=`cat ${cache}/ctest-HAVE_ALTIVEC`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_ALTIVEC`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_ALTIVEC="yes"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC" > config/have_altivec.h
echo "#define HAVE_ALTIVEC \"$HAVE_ALTIVEC\"" >> config/have_altivec.h
echo "#endif" >> config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_ALTIVEC="no"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_ALTIVEC" > ${cache}/ctest-HAVE_ALTIVEC
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_ALTIVEC
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_ALTIVEC}" = "yes" ]; then
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
HAVE_ALTIVEC_H=""
echo "#ifndef ALTIVEC_CFLAGS" > config/altivec_cflags.h
echo "#define ALTIVEC_CFLAGS \"$ALTIVEC_CFLAGS\"" >> config/altivec_cflags.h
echo "#endif" >> config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC_H" > config/have_altivec_h.h
echo "#define HAVE_ALTIVEC_H \"$HAVE_ALTIVEC_H\"" >> config/have_altivec_h.h
echo "#endif" >> config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = \"$HAVE_ALTIVEC_H\"" >>configure.lua
else
$ECHO_N "checking for AltiVec (without )..."
$ECHO_N "checking for AltiVec (without )..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_ALTIVEC" ]; then
HAVE_ALTIVEC=`cat ${cache}/ctest-HAVE_ALTIVEC`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_ALTIVEC`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_ALTIVEC="yes"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC" > config/have_altivec.h
echo "#define HAVE_ALTIVEC \"$HAVE_ALTIVEC\"" >> config/have_altivec.h
echo "#endif" >> config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_ALTIVEC="no"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_ALTIVEC" > ${cache}/ctest-HAVE_ALTIVEC
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_ALTIVEC
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_ALTIVEC}" = "yes" ]; then
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
echo "#ifndef ALTIVEC_CFLAGS" > config/altivec_cflags.h
echo "#define ALTIVEC_CFLAGS \"$ALTIVEC_CFLAGS\"" >> config/altivec_cflags.h
echo "#endif" >> config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
else
echo "#undef ALTIVEC_CFLAGS" >config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = nil" >>configure.lua
ALTIVEC_CFLAGS=""
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
fi;
echo "#undef HAVE_ALTIVEC_H" >config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = nil" >>configure.lua
fi;
$ECHO_N "checking for byte order..."
$ECHO_N "checking for byte order..." >> config.log
echo ""
echo "" >> config.log
$ECHO_N "checking for BIG_ENDIAN..."
$ECHO_N "checking for BIG_ENDIAN..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_BIG_ENDIAN" ]; then
_MK_BIG_ENDIAN=`cat ${cache}/ctest-_MK_BIG_ENDIAN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_BIG_ENDIAN`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-_MK_BIG_ENDIAN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
#if BYTE_ORDER == BIG_ENDIAN
return (0);
#else
return (1);
#endif
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
_MK_BIG_ENDIAN="yes"
echo "_MK_BIG_ENDIAN=$_MK_BIG_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_BIG_ENDIAN\"] = \"$_MK_BIG_ENDIAN\"" >>configure.lua
echo "#ifndef _MK_BIG_ENDIAN" > config/_mk_big_endian.h
echo "#define _MK_BIG_ENDIAN \"$_MK_BIG_ENDIAN\"" >> config/_mk_big_endian.h
echo "#endif" >> config/_mk_big_endian.h
echo "hdefs[\"_MK_BIG_ENDIAN\"] = \"$_MK_BIG_ENDIAN\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_BIG_ENDIAN="no"
echo "_MK_BIG_ENDIAN=$_MK_BIG_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_BIG_ENDIAN\"] = \"$_MK_BIG_ENDIAN\"" >>configure.lua
echo "#undef _MK_BIG_ENDIAN" >config/_mk_big_endian.h
echo "hdefs[\"_MK_BIG_ENDIAN\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_BIG_ENDIAN="no"
echo "_MK_BIG_ENDIAN=$_MK_BIG_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_BIG_ENDIAN\"] = \"$_MK_BIG_ENDIAN\"" >>configure.lua
echo "#undef _MK_BIG_ENDIAN" >config/_mk_big_endian.h
echo "hdefs[\"_MK_BIG_ENDIAN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_BIG_ENDIAN" > ${cache}/ctest-_MK_BIG_ENDIAN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_BIG_ENDIAN
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-_MK_BIG_ENDIAN
fi
rm -f conftest.c $testdir/conftest
if [ "${_MK_BIG_ENDIAN}" = "yes" ]; then
_MK_LITTLE_ENDIAN="no"
echo "#undef _MK_LITTLE_ENDIAN" >config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = nil" >>configure.lua
else
$ECHO_N "checking for LITTLE_ENDIAN..."
$ECHO_N "checking for LITTLE_ENDIAN..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_LITTLE_ENDIAN" ]; then
_MK_LITTLE_ENDIAN=`cat ${cache}/ctest-_MK_LITTLE_ENDIAN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_LITTLE_ENDIAN`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-_MK_LITTLE_ENDIAN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
#if BYTE_ORDER == LITTLE_ENDIAN
return (0);
#else
return (1);
#endif
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
_MK_LITTLE_ENDIAN="yes"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#ifndef _MK_LITTLE_ENDIAN" > config/_mk_little_endian.h
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >> config/_mk_little_endian.h
echo "#endif" >> config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_LITTLE_ENDIAN="no"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#undef _MK_LITTLE_ENDIAN" >config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_LITTLE_ENDIAN="no"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#undef _MK_LITTLE_ENDIAN" >config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_LITTLE_ENDIAN" > ${cache}/ctest-_MK_LITTLE_ENDIAN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_LITTLE_ENDIAN
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-_MK_LITTLE_ENDIAN
fi
rm -f conftest.c $testdir/conftest
if [ "${_MK_LITTLE_ENDIAN}" = "yes" ]; then
_MK_BIG_ENDIAN="no"
echo "#undef _MK_BIG_ENDIAN" >config/_mk_big_endian.h
echo "hdefs[\"_MK_BIG_ENDIAN\"] = nil" >>configure.lua
else
$ECHO_N "checking for little endian byte order..."
$ECHO_N "checking for little endian byte order..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-_MK_LITTLE_ENDIAN" ]; then
_MK_LITTLE_ENDIAN=`cat ${cache}/ctest-_MK_LITTLE_ENDIAN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-_MK_LITTLE_ENDIAN`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-_MK_LITTLE_ENDIAN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
int
main(int argc, char *argv[])
{
union {
long l;
char c[sizeof (long)];
} u;
u.l = 1;
return (u.c[sizeof (long) - 1] == 1);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
_MK_LITTLE_ENDIAN="yes"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#ifndef _MK_LITTLE_ENDIAN" > config/_mk_little_endian.h
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >> config/_mk_little_endian.h
echo "#endif" >> config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_LITTLE_ENDIAN="no"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#undef _MK_LITTLE_ENDIAN" >config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
_MK_LITTLE_ENDIAN="no"
echo "_MK_LITTLE_ENDIAN=$_MK_LITTLE_ENDIAN" >>Makefile.config
echo "mdefs[\"_MK_LITTLE_ENDIAN\"] = \"$_MK_LITTLE_ENDIAN\"" >>configure.lua
echo "#undef _MK_LITTLE_ENDIAN" >config/_mk_little_endian.h
echo "hdefs[\"_MK_LITTLE_ENDIAN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$_MK_LITTLE_ENDIAN" > ${cache}/ctest-_MK_LITTLE_ENDIAN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-_MK_LITTLE_ENDIAN
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-_MK_LITTLE_ENDIAN
fi
rm -f conftest.c $testdir/conftest
if [ "${MK_COMPILE_STATUS}" != "OK" ]; then
echo "Unable to determine byte order"
exit 1
fi;
if [ "${_MK_LITTLE_ENDIAN}" = "no" ]; then
_MK_BIG_ENDIAN="yes"
echo "#ifndef _MK_BIG_ENDIAN" > config/_mk_big_endian.h
echo "#define _MK_BIG_ENDIAN \"$_MK_BIG_ENDIAN\"" >> config/_mk_big_endian.h
echo "#endif" >> config/_mk_big_endian.h
echo "hdefs[\"_MK_BIG_ENDIAN\"] = \"$_MK_BIG_ENDIAN\"" >>configure.lua
fi;
fi;
fi;
$ECHO_N "checking for dlopen() interface..."
$ECHO_N "checking for dlopen() interface..." >> config.log
DSO_CFLAGS=""
DSO_LIBS=""
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS="Yes"
echo > conftest.c
echo "#include " >> conftest.c
echo "int main (int argc, char *argv[]) { return (0); }" >> conftest.c
MK_COMPILE_STATUS="OK"
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_DLFCN_H="yes"
echo "#ifndef HAVE_DLFCN_H" > config/have_dlfcn_h.h
echo "#define HAVE_DLFCN_H \"$HAVE_DLFCN_H\"" >> config/have_dlfcn_h.h
echo "#endif" >> config/have_dlfcn_h.h
echo "hdefs[\"HAVE_DLFCN_H\"] = \"$HAVE_DLFCN_H\"" >>configure.lua
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_DLFCN_H"
fi;
else
HAVE_DLFCN_H="no"
echo "#undef HAVE_DLFCN_H" >config/have_dlfcn_h.h
echo "hdefs[\"HAVE_DLFCN_H\"] = nil" >>configure.lua
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_DLOPEN" ]; then
HAVE_DLOPEN=`cat ${cache}/ctest-HAVE_DLOPEN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_DLOPEN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef HAVE_DLFCN_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_DLOPEN="yes"
echo "#ifndef HAVE_DLOPEN" > config/have_dlopen.h
echo "#define HAVE_DLOPEN \"$HAVE_DLOPEN\"" >> config/have_dlopen.h
echo "#endif" >> config/have_dlopen.h
echo "hdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_DLOPEN="no"
echo "#undef HAVE_DLOPEN" >config/have_dlopen.h
echo "hdefs[\"HAVE_DLOPEN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_DLOPEN" > ${cache}/ctest-HAVE_DLOPEN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_DLOPEN
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_DLOPEN}" != "yes" ]; then
$ECHO_N "checking for dlopen() in -ldl..."
$ECHO_N "checking for dlopen() in -ldl..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_DLOPEN" ]; then
HAVE_DLOPEN=`cat ${cache}/ctest-HAVE_DLOPEN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_DLOPEN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef HAVE_DLFCN_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -ldl -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -ldl -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_DLOPEN="yes"
echo "HAVE_DLOPEN=$HAVE_DLOPEN" >>Makefile.config
echo "mdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
echo "#ifndef HAVE_DLOPEN" > config/have_dlopen.h
echo "#define HAVE_DLOPEN \"$HAVE_DLOPEN\"" >> config/have_dlopen.h
echo "#endif" >> config/have_dlopen.h
echo "hdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_DLOPEN="no"
echo "HAVE_DLOPEN=$HAVE_DLOPEN" >>Makefile.config
echo "mdefs[\"HAVE_DLOPEN\"] = \"$HAVE_DLOPEN\"" >>configure.lua
echo "#undef HAVE_DLOPEN" >config/have_dlopen.h
echo "hdefs[\"HAVE_DLOPEN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_DLOPEN" > ${cache}/ctest-HAVE_DLOPEN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_DLOPEN
fi
rm -f conftest.c $testdir/conftest
if [ "${HAVE_DLOPEN}" = "yes" ]; then
DSO_CFLAGS=""
DSO_LIBS="-ldl"
fi;
fi;
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=""
echo "DSO_CFLAGS=$DSO_CFLAGS" >>Makefile.config
echo "mdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "DSO_LIBS=$DSO_LIBS" >>Makefile.config
echo "mdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
echo "#ifndef DSO_CFLAGS" > config/dso_cflags.h
echo "#define DSO_CFLAGS \"$DSO_CFLAGS\"" >> config/dso_cflags.h
echo "#endif" >> config/dso_cflags.h
echo "hdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "#ifndef DSO_LIBS" > config/dso_libs.h
echo "#define DSO_LIBS \"$DSO_LIBS\"" >> config/dso_libs.h
echo "#endif" >> config/dso_libs.h
echo "hdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
$ECHO_N "checking for dyld interface..."
$ECHO_N "checking for dyld interface..." >> config.log
DSO_CFLAGS=""
DSO_LIBS=""
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS="Yes"
echo > conftest.c
echo "#include " >> conftest.c
echo "int main (int argc, char *argv[]) { return (0); }" >> conftest.c
MK_COMPILE_STATUS="OK"
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_MACH_O_DYLD_H="yes"
echo "#ifndef HAVE_MACH_O_DYLD_H" > config/have_mach_o_dyld_h.h
echo "#define HAVE_MACH_O_DYLD_H \"$HAVE_MACH_O_DYLD_H\"" >> config/have_mach_o_dyld_h.h
echo "#endif" >> config/have_mach_o_dyld_h.h
echo "hdefs[\"HAVE_MACH_O_DYLD_H\"] = \"$HAVE_MACH_O_DYLD_H\"" >>configure.lua
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_MACH_O_DYLD_H"
fi;
else
HAVE_MACH_O_DYLD_H="no"
echo "#undef HAVE_MACH_O_DYLD_H" >config/have_mach_o_dyld_h.h
echo "hdefs[\"HAVE_MACH_O_DYLD_H\"] = nil" >>configure.lua
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_DYLD" ]; then
HAVE_DYLD=`cat ${cache}/ctest-HAVE_DYLD`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_DYLD`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef HAVE_MACH_O_DYLD_H
#include
#endif
int
main(int argc, char *argv[])
{
NSObjectFileImage img;
NSObjectFileImageReturnCode rv;
rv = NSCreateObjectFileImageFromFile("foo", &img);
return (rv == NSObjectFileImageSuccess);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_DYLD="yes"
echo "#ifndef HAVE_DYLD" > config/have_dyld.h
echo "#define HAVE_DYLD \"$HAVE_DYLD\"" >> config/have_dyld.h
echo "#endif" >> config/have_dyld.h
echo "hdefs[\"HAVE_DYLD\"] = \"$HAVE_DYLD\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_DYLD="no"
echo "#undef HAVE_DYLD" >config/have_dyld.h
echo "hdefs[\"HAVE_DYLD\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_DYLD" > ${cache}/ctest-HAVE_DYLD
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_DYLD
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_DYLD}" = "Yes" ]; then
echo "checking for NSLINKMODULE_OPTION_RETURN_ON_ERROR"
echo "checking for NSLINKMODULE_OPTION_RETURN_ON_ERROR" >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_DYLD_RETURN_ON_ERROR" ]; then
HAVE_DYLD_RETURN_ON_ERROR=`cat ${cache}/ctest-HAVE_DYLD_RETURN_ON_ERROR`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_DYLD_RETURN_ON_ERROR`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef HAVE_MACH_O_DYLD_H
#include
#endif
int
main(int argc, char *argv[])
{
NSObjectFileImage img;
NSObjectFileImageReturnCode rv;
void *handle;
rv = NSCreateObjectFileImageFromFile("foo", &img);
handle = (void *)NSLinkModule(img, "foo",
NSLINKMODULE_OPTION_RETURN_ON_ERROR|
NSLINKMODULE_OPTION_NONE);
if (handle == NULL) {
NSLinkEditErrors errs;
int n;
const char *f, *s = NULL;
NSLinkEditError(&errs, &n, &f, &s);
}
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_DYLD_RETURN_ON_ERROR="yes"
echo "#ifndef HAVE_DYLD_RETURN_ON_ERROR" > config/have_dyld_return_on_error.h
echo "#define HAVE_DYLD_RETURN_ON_ERROR \"$HAVE_DYLD_RETURN_ON_ERROR\"" >> config/have_dyld_return_on_error.h
echo "#endif" >> config/have_dyld_return_on_error.h
echo "hdefs[\"HAVE_DYLD_RETURN_ON_ERROR\"] = \"$HAVE_DYLD_RETURN_ON_ERROR\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_DYLD_RETURN_ON_ERROR="no"
echo "#undef HAVE_DYLD_RETURN_ON_ERROR" >config/have_dyld_return_on_error.h
echo "hdefs[\"HAVE_DYLD_RETURN_ON_ERROR\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_DYLD_RETURN_ON_ERROR" > ${cache}/ctest-HAVE_DYLD_RETURN_ON_ERROR
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_DYLD_RETURN_ON_ERROR
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
else
HAVE_DYLD_RETURN_ON_ERROR="no"
echo "#undef HAVE_DYLD_RETURN_ON_ERROR" >config/have_dyld_return_on_error.h
echo "hdefs[\"HAVE_DYLD_RETURN_ON_ERROR\"] = nil" >>configure.lua
fi;
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=""
echo "DSO_CFLAGS=$DSO_CFLAGS" >>Makefile.config
echo "mdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "DSO_LIBS=$DSO_LIBS" >>Makefile.config
echo "mdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
echo "#ifndef DSO_CFLAGS" > config/dso_cflags.h
echo "#define DSO_CFLAGS \"$DSO_CFLAGS\"" >> config/dso_cflags.h
echo "#endif" >> config/dso_cflags.h
echo "hdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "#ifndef DSO_LIBS" > config/dso_libs.h
echo "#define DSO_LIBS \"$DSO_LIBS\"" >> config/dso_libs.h
echo "#endif" >> config/dso_libs.h
echo "hdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
$ECHO_N "checking for shl_load() interface..."
$ECHO_N "checking for shl_load() interface..." >> config.log
DSO_CFLAGS=""
DSO_LIBS=""
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS="Yes"
echo > conftest.c
echo "#include " >> conftest.c
echo "int main (int argc, char *argv[]) { return (0); }" >> conftest.c
MK_COMPILE_STATUS="OK"
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_DL_H="yes"
echo "#ifndef HAVE_DL_H" > config/have_dl_h.h
echo "#define HAVE_DL_H \"$HAVE_DL_H\"" >> config/have_dl_h.h
echo "#endif" >> config/have_dl_h.h
echo "hdefs[\"HAVE_DL_H\"] = \"$HAVE_DL_H\"" >>configure.lua
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_DL_H"
fi;
else
HAVE_DL_H="no"
echo "#undef HAVE_DL_H" >config/have_dl_h.h
echo "hdefs[\"HAVE_DL_H\"] = nil" >>configure.lua
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SHL_LOAD" ]; then
HAVE_SHL_LOAD=`cat ${cache}/ctest-HAVE_SHL_LOAD`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SHL_LOAD`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef HAVE_DL_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
void **p;
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_DATA, p);
shl_unload((shl_t)handle);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -ldld -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -ldld -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SHL_LOAD="yes"
echo "HAVE_SHL_LOAD=$HAVE_SHL_LOAD" >>Makefile.config
echo "mdefs[\"HAVE_SHL_LOAD\"] = \"$HAVE_SHL_LOAD\"" >>configure.lua
echo "#ifndef HAVE_SHL_LOAD" > config/have_shl_load.h
echo "#define HAVE_SHL_LOAD \"$HAVE_SHL_LOAD\"" >> config/have_shl_load.h
echo "#endif" >> config/have_shl_load.h
echo "hdefs[\"HAVE_SHL_LOAD\"] = \"$HAVE_SHL_LOAD\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_SHL_LOAD="no"
echo "HAVE_SHL_LOAD=$HAVE_SHL_LOAD" >>Makefile.config
echo "mdefs[\"HAVE_SHL_LOAD\"] = \"$HAVE_SHL_LOAD\"" >>configure.lua
echo "#undef HAVE_SHL_LOAD" >config/have_shl_load.h
echo "hdefs[\"HAVE_SHL_LOAD\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SHL_LOAD" > ${cache}/ctest-HAVE_SHL_LOAD
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SHL_LOAD
fi
rm -f conftest.c $testdir/conftest
if [ "${HAVE_SHL_LOAD}" = "yes" ]; then
DSO_CFLAGS=""
DSO_LIBS="-ldld"
fi;
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=""
echo "DSO_CFLAGS=$DSO_CFLAGS" >>Makefile.config
echo "mdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "DSO_LIBS=$DSO_LIBS" >>Makefile.config
echo "mdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
echo "#ifndef DSO_CFLAGS" > config/dso_cflags.h
echo "#define DSO_CFLAGS \"$DSO_CFLAGS\"" >> config/dso_cflags.h
echo "#endif" >> config/dso_cflags.h
echo "hdefs[\"DSO_CFLAGS\"] = \"$DSO_CFLAGS\"" >>configure.lua
echo "#ifndef DSO_LIBS" > config/dso_libs.h
echo "#define DSO_LIBS \"$DSO_LIBS\"" >> config/dso_libs.h
echo "#endif" >> config/dso_libs.h
echo "hdefs[\"DSO_LIBS\"] = \"$DSO_LIBS\"" >>configure.lua
$ECHO_N "checking for the gettimeofday() function..."
$ECHO_N "checking for the gettimeofday() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETTIMEOFDAY" ]; then
HAVE_GETTIMEOFDAY=`cat ${cache}/ctest-HAVE_GETTIMEOFDAY`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETTIMEOFDAY`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
struct timeval tv;
int rv = gettimeofday(&tv, NULL);
return (rv);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETTIMEOFDAY="yes"
echo "#ifndef HAVE_GETTIMEOFDAY" > config/have_gettimeofday.h
echo "#define HAVE_GETTIMEOFDAY \"$HAVE_GETTIMEOFDAY\"" >> config/have_gettimeofday.h
echo "#endif" >> config/have_gettimeofday.h
echo "hdefs[\"HAVE_GETTIMEOFDAY\"] = \"$HAVE_GETTIMEOFDAY\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETTIMEOFDAY="no"
echo "#undef HAVE_GETTIMEOFDAY" >config/have_gettimeofday.h
echo "hdefs[\"HAVE_GETTIMEOFDAY\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETTIMEOFDAY" > ${cache}/ctest-HAVE_GETTIMEOFDAY
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETTIMEOFDAY
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
CFLAGS="$CFLAGS -D_AGAR_INTERNAL"
CXXFLAGS="$CXXFLAGS -D_AGAR_INTERNAL"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
CFLAGS="$CFLAGS -D_BSD_SOURCE"
CXXFLAGS="$CXXFLAGS -D_BSD_SOURCE"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
if [ "${enable_warnings}" = "yes" ]
then
CFLAGS="$CFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
CFLAGS="$CFLAGS -Werror"
CXXFLAGS="$CXXFLAGS -Werror"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
CFLAGS="$CFLAGS -Wmissing-prototypes"
CXXFLAGS="$CXXFLAGS -Wmissing-prototypes"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
WNO_UNINITIALIZED="-Wno-uninitialized"
echo "WNO_UNINITIALIZED=$WNO_UNINITIALIZED" >>Makefile.config
echo "mdefs[\"WNO_UNINITIALIZED\"] = \"$WNO_UNINITIALIZED\"" >>configure.lua
else
WNO_UNINITIALIZED=""""
echo "WNO_UNINITIALIZED=$WNO_UNINITIALIZED" >>Makefile.config
echo "mdefs[\"WNO_UNINITIALIZED\"] = \"$WNO_UNINITIALIZED\"" >>configure.lua
fi
if [ "${enable_debug}" = "yes" ]
then
AG_DEBUG="yes"
echo "#ifndef AG_DEBUG" > config/ag_debug.h
echo "#define AG_DEBUG \"$AG_DEBUG\"" >> config/ag_debug.h
echo "#endif" >> config/ag_debug.h
echo "hdefs[\"AG_DEBUG\"] = \"$AG_DEBUG\"" >>configure.lua
echo "LDFLAGS+=-g" >> Makefile.config
else
echo "#undef AG_DEBUG" >config/ag_debug.h
echo "hdefs[\"AG_DEBUG\"] = nil" >>configure.lua
fi
if [ "${enable_lockdebug}" = "yes" ]
then
AG_LOCKDEBUG="yes"
echo "#ifndef AG_LOCKDEBUG" > config/ag_lockdebug.h
echo "#define AG_LOCKDEBUG \"$AG_LOCKDEBUG\"" >> config/ag_lockdebug.h
echo "#endif" >> config/ag_lockdebug.h
echo "hdefs[\"AG_LOCKDEBUG\"] = \"$AG_LOCKDEBUG\"" >>configure.lua
else
echo "#undef AG_LOCKDEBUG" >config/ag_lockdebug.h
echo "hdefs[\"AG_LOCKDEBUG\"] = nil" >>configure.lua
fi
if [ "${enable_objdebug}" = "yes" ]
then
AG_OBJDEBUG="yes"
echo "#ifndef AG_OBJDEBUG" > config/ag_objdebug.h
echo "#define AG_OBJDEBUG \"$AG_OBJDEBUG\"" >> config/ag_objdebug.h
echo "#endif" >> config/ag_objdebug.h
echo "hdefs[\"AG_OBJDEBUG\"] = \"$AG_OBJDEBUG\"" >>configure.lua
else
echo "#undef AG_OBJDEBUG" >config/ag_objdebug.h
echo "hdefs[\"AG_OBJDEBUG\"] = nil" >>configure.lua
fi
if [ "${enable_classdebug}" = "yes" ]
then
AG_CLASSDEBUG="yes"
echo "#ifndef AG_CLASSDEBUG" > config/ag_classdebug.h
echo "#define AG_CLASSDEBUG \"$AG_CLASSDEBUG\"" >> config/ag_classdebug.h
echo "#endif" >> config/ag_classdebug.h
echo "hdefs[\"AG_CLASSDEBUG\"] = \"$AG_CLASSDEBUG\"" >>configure.lua
else
echo "#undef AG_CLASSDEBUG" >config/ag_classdebug.h
echo "hdefs[\"AG_CLASSDEBUG\"] = nil" >>configure.lua
fi
if [ "${enable_eventdebug}" = "yes" ]
then
AG_EVENTDEBUG="yes"
echo "#ifndef AG_EVENTDEBUG" > config/ag_eventdebug.h
echo "#define AG_EVENTDEBUG \"$AG_EVENTDEBUG\"" >> config/ag_eventdebug.h
echo "#endif" >> config/ag_eventdebug.h
echo "hdefs[\"AG_EVENTDEBUG\"] = \"$AG_EVENTDEBUG\"" >>configure.lua
else
echo "#undef AG_EVENTDEBUG" >config/ag_eventdebug.h
echo "hdefs[\"AG_EVENTDEBUG\"] = nil" >>configure.lua
fi
if [ "${enable_legacy}" != "no" ]
then
AG_LEGACY="yes"
echo "#ifndef AG_LEGACY" > config/ag_legacy.h
echo "#define AG_LEGACY \"$AG_LEGACY\"" >> config/ag_legacy.h
echo "#endif" >> config/ag_legacy.h
echo "hdefs[\"AG_LEGACY\"] = \"$AG_LEGACY\"" >>configure.lua
else
echo "#undef AG_LEGACY" >config/ag_legacy.h
echo "hdefs[\"AG_LEGACY\"] = nil" >>configure.lua
fi
if [ "${enable_gui}" != "no" ]
then
ENABLE_GUI="yes"
echo "#ifndef ENABLE_GUI" > config/enable_gui.h
echo "#define ENABLE_GUI \"$ENABLE_GUI\"" >> config/enable_gui.h
echo "#endif" >> config/enable_gui.h
echo "hdefs[\"ENABLE_GUI\"] = \"$ENABLE_GUI\"" >>configure.lua
SUBDIR_GUI="gui agar-config"
echo "SUBDIR_GUI=$SUBDIR_GUI" >>Makefile.config
echo "mdefs[\"SUBDIR_GUI\"] = \"$SUBDIR_GUI\"" >>configure.lua
$ECHO_N "checking for SDL (http://www.libsdl.org)..."
$ECHO_N "checking for SDL (http://www.libsdl.org)..." >> config.log
if [ "${SYSTEM}" = "Darwin" ]; then
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_VERSION" ]; then
SDL_VERSION=`cat ${cache}/exec-SDL_VERSION`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_VERSION`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_VERSION=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_VERSION" > ${cache}/exec-SDL_VERSION
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_VERSION
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_CFLAGS" ]; then
SDL_CFLAGS=`cat ${cache}/exec-SDL_CFLAGS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_CFLAGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_CFLAGS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_CFLAGS" > ${cache}/exec-SDL_CFLAGS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_CFLAGS
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_LIBS" ]; then
SDL_LIBS=`cat ${cache}/exec-SDL_LIBS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_LIBS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_LIBS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_LIBS" > ${cache}/exec-SDL_LIBS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_LIBS
fi
fi
elif [ "${SYSTEM}" = "FreeBSD" ]; then
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_VERSION" ]; then
SDL_VERSION=`cat ${cache}/exec-SDL_VERSION`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_VERSION`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_VERSION=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl11-config" ]; then
if [ -f "${path}/sdl11-config" ]; then
SDL_VERSION=`${path}/sdl11-config --version`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_VERSION" > ${cache}/exec-SDL_VERSION
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_VERSION
fi
fi
if [ "${SDL_VERSION}" != "" ]; then
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_CFLAGS" ]; then
SDL_CFLAGS=`cat ${cache}/exec-SDL_CFLAGS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_CFLAGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_CFLAGS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl11-config" ]; then
if [ -f "${path}/sdl11-config" ]; then
SDL_CFLAGS=`${path}/sdl11-config --cflags`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_CFLAGS" > ${cache}/exec-SDL_CFLAGS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_CFLAGS
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_LIBS" ]; then
SDL_LIBS=`cat ${cache}/exec-SDL_LIBS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_LIBS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_LIBS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl11-config" ]; then
if [ -f "${path}/sdl11-config" ]; then
SDL_LIBS=`${path}/sdl11-config --libs`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_LIBS" > ${cache}/exec-SDL_LIBS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_LIBS
fi
fi
else
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_VERSION" ]; then
SDL_VERSION=`cat ${cache}/exec-SDL_VERSION`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_VERSION`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_VERSION=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_VERSION" > ${cache}/exec-SDL_VERSION
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_VERSION
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_CFLAGS" ]; then
SDL_CFLAGS=`cat ${cache}/exec-SDL_CFLAGS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_CFLAGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_CFLAGS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_CFLAGS" > ${cache}/exec-SDL_CFLAGS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_CFLAGS
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_LIBS" ]; then
SDL_LIBS=`cat ${cache}/exec-SDL_LIBS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_LIBS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_LIBS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_LIBS" > ${cache}/exec-SDL_LIBS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_LIBS
fi
fi
fi;
else
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_VERSION" ]; then
SDL_VERSION=`cat ${cache}/exec-SDL_VERSION`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_VERSION`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_VERSION=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_VERSION" > ${cache}/exec-SDL_VERSION
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_VERSION
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_CFLAGS" ]; then
SDL_CFLAGS=`cat ${cache}/exec-SDL_CFLAGS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_CFLAGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_CFLAGS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_CFLAGS" > ${cache}/exec-SDL_CFLAGS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_CFLAGS
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-SDL_LIBS" ]; then
SDL_LIBS=`cat ${cache}/exec-SDL_LIBS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-SDL_LIBS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
SDL_LIBS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/sdl-config" ]; then
if [ -f "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$SDL_LIBS" > ${cache}/exec-SDL_LIBS
echo $MK_EXEC_FOUND > ${cache}/exec-found-SDL_LIBS
fi
fi
fi;
if [ "${SDL_VERSION}" != "" ]; then
echo "yes"
echo "yes" >> config.log
$ECHO_N "checking whether SDL works..."
$ECHO_N "checking whether SDL works..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SDL" ]; then
HAVE_SDL=`cat ${cache}/ctest-HAVE_SDL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SDL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest conftest.c ${SDL_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest conftest.c ${SDL_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SDL="yes"
echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
echo "#ifndef HAVE_SDL" > config/have_sdl.h
echo "#define HAVE_SDL \"$HAVE_SDL\"" >> config/have_sdl.h
echo "#endif" >> config/have_sdl.h
echo "hdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_SDL="no"
echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
echo "#undef HAVE_SDL" >config/have_sdl.h
echo "hdefs[\"HAVE_SDL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SDL" > ${cache}/ctest-HAVE_SDL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SDL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_SDL}" != "no" ]; then
echo "SDL_CFLAGS=$SDL_CFLAGS" >>Makefile.config
echo "mdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
echo "SDL_LIBS=$SDL_LIBS" >>Makefile.config
echo "mdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
echo "#ifndef SDL_CFLAGS" > config/sdl_cflags.h
echo "#define SDL_CFLAGS \"$SDL_CFLAGS\"" >> config/sdl_cflags.h
echo "#endif" >> config/sdl_cflags.h
echo "hdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
echo "#ifndef SDL_LIBS" > config/sdl_libs.h
echo "#define SDL_LIBS \"$SDL_LIBS\"" >> config/sdl_libs.h
echo "#endif" >> config/sdl_libs.h
echo "hdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
else
$ECHO_N "checking whether SDL works (with X11 libs)..."
$ECHO_N "checking whether SDL works (with X11 libs)..." >> config.log
SDL_LIBS="${SDL_LIBS} -L/usr/X11R6/lib -lX11 -lXext -lXrandr -lXrender"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SDL" ]; then
HAVE_SDL=`cat ${cache}/ctest-HAVE_SDL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SDL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest conftest.c ${SDL_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest conftest.c ${SDL_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SDL="yes"
echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
echo "#ifndef HAVE_SDL" > config/have_sdl.h
echo "#define HAVE_SDL \"$HAVE_SDL\"" >> config/have_sdl.h
echo "#endif" >> config/have_sdl.h
echo "hdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_SDL="no"
echo "HAVE_SDL=$HAVE_SDL" >>Makefile.config
echo "mdefs[\"HAVE_SDL\"] = \"$HAVE_SDL\"" >>configure.lua
echo "#undef HAVE_SDL" >config/have_sdl.h
echo "hdefs[\"HAVE_SDL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SDL" > ${cache}/ctest-HAVE_SDL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SDL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_SDL}" != "no" ]; then
echo "SDL_CFLAGS=$SDL_CFLAGS" >>Makefile.config
echo "mdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
echo "SDL_LIBS=$SDL_LIBS" >>Makefile.config
echo "mdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
echo "#ifndef SDL_CFLAGS" > config/sdl_cflags.h
echo "#define SDL_CFLAGS \"$SDL_CFLAGS\"" >> config/sdl_cflags.h
echo "#endif" >> config/sdl_cflags.h
echo "hdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
echo "#ifndef SDL_LIBS" > config/sdl_libs.h
echo "#define SDL_LIBS \"$SDL_LIBS\"" >> config/sdl_libs.h
echo "#endif" >> config/sdl_libs.h
echo "hdefs[\"SDL_LIBS\"] = \"$SDL_LIBS\"" >>configure.lua
else
echo "#undef SDL_CFLAGS" >config/sdl_cflags.h
echo "hdefs[\"SDL_CFLAGS\"] = nil" >>configure.lua
echo "#undef SDL_LIBS" >config/sdl_libs.h
echo "hdefs[\"SDL_LIBS\"] = nil" >>configure.lua
fi;
fi;
else
echo "no"
echo "no" >> config.log
echo "#undef HAVE_SDL" >config/have_sdl.h
echo "hdefs[\"HAVE_SDL\"] = nil" >>configure.lua
echo "#undef SDL_CFLAGS" >config/sdl_cflags.h
echo "hdefs[\"SDL_CFLAGS\"] = nil" >>configure.lua
echo "#undef SDL_LIBS" >config/sdl_libs.h
echo "hdefs[\"SDL_LIBS\"] = nil" >>configure.lua
fi;
if [ "${HAVE_SDL}" != "yes" ]
then
echo "*"
echo "* Agar-GUI requires the SDL library. You can download it "
echo "* from: http://www.libsdl.org/"
echo "*"
exit 1
fi
if [ "${with_freetype}" != "no" ]
then
$ECHO_N "checking for FreeType (http://www.freetype.org)..."
$ECHO_N "checking for FreeType (http://www.freetype.org)..." >> config.log
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-FREETYPE_VERSION" ]; then
FREETYPE_VERSION=`cat ${cache}/exec-FREETYPE_VERSION`
MK_EXEC_FOUND=`cat ${cache}/exec-found-FREETYPE_VERSION`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
FREETYPE_VERSION=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/freetype-config" ]; then
if [ -f "${path}/freetype-config" ]; then
FREETYPE_VERSION=`${path}/freetype-config --version`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$FREETYPE_VERSION" > ${cache}/exec-FREETYPE_VERSION
echo $MK_EXEC_FOUND > ${cache}/exec-found-FREETYPE_VERSION
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-FREETYPE_CFLAGS" ]; then
FREETYPE_CFLAGS=`cat ${cache}/exec-FREETYPE_CFLAGS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-FREETYPE_CFLAGS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
FREETYPE_CFLAGS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/freetype-config" ]; then
if [ -f "${path}/freetype-config" ]; then
FREETYPE_CFLAGS=`${path}/freetype-config --cflags`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$FREETYPE_CFLAGS" > ${cache}/exec-FREETYPE_CFLAGS
echo $MK_EXEC_FOUND > ${cache}/exec-found-FREETYPE_CFLAGS
fi
fi
MK_EXEC_FOUND="No"
MK_CACHED="No"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/exec-FREETYPE_LIBS" ]; then
FREETYPE_LIBS=`cat ${cache}/exec-FREETYPE_LIBS`
MK_EXEC_FOUND=`cat ${cache}/exec-found-FREETYPE_LIBS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
FREETYPE_LIBS=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/freetype-config" ]; then
if [ -f "${path}/freetype-config" ]; then
FREETYPE_LIBS=`${path}/freetype-config --libs`
MK_EXEC_FOUND="Yes"
break
fi
fi
done
if [ "${cache}" != "" ]; then
echo "$FREETYPE_LIBS" > ${cache}/exec-FREETYPE_LIBS
echo $MK_EXEC_FOUND > ${cache}/exec-found-FREETYPE_LIBS
fi
fi
if [ -d /usr/freeware/include ]; then
FREETYPE_CFLAGS="${FREETYPE_CFLAGS} -I/usr/freeware/include"
fi;
if [ "${FREETYPE_VERSION}" != "" ]; then
echo "yes"
echo "yes" >> config.log
$ECHO_N "checking whether FreeType works..."
$ECHO_N "checking whether FreeType works..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_FREETYPE" ]; then
HAVE_FREETYPE=`cat ${cache}/ctest-HAVE_FREETYPE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_FREETYPE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include FT_FREETYPE_H
#include FT_OUTLINE_H
int
main(int argc, char *argv[])
{
FT_Library library;
FT_Face face;
FT_Init_FreeType(&library);
FT_New_Face(library, "foo", 0, &face);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${FREETYPE_CFLAGS} -o $testdir/conftest conftest.c ${FREETYPE_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${FREETYPE_CFLAGS} -o $testdir/conftest conftest.c ${FREETYPE_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_FREETYPE="yes"
echo "HAVE_FREETYPE=$HAVE_FREETYPE" >>Makefile.config
echo "mdefs[\"HAVE_FREETYPE\"] = \"$HAVE_FREETYPE\"" >>configure.lua
echo "#ifndef HAVE_FREETYPE" > config/have_freetype.h
echo "#define HAVE_FREETYPE \"$HAVE_FREETYPE\"" >> config/have_freetype.h
echo "#endif" >> config/have_freetype.h
echo "hdefs[\"HAVE_FREETYPE\"] = \"$HAVE_FREETYPE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_FREETYPE="no"
echo "HAVE_FREETYPE=$HAVE_FREETYPE" >>Makefile.config
echo "mdefs[\"HAVE_FREETYPE\"] = \"$HAVE_FREETYPE\"" >>configure.lua
echo "#undef HAVE_FREETYPE" >config/have_freetype.h
echo "hdefs[\"HAVE_FREETYPE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_FREETYPE" > ${cache}/ctest-HAVE_FREETYPE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_FREETYPE
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_FREETYPE}" = "yes" ]; then
echo "#ifndef FREETYPE_CFLAGS" > config/freetype_cflags.h
echo "#define FREETYPE_CFLAGS \"$FREETYPE_CFLAGS\"" >> config/freetype_cflags.h
echo "#endif" >> config/freetype_cflags.h
echo "hdefs[\"FREETYPE_CFLAGS\"] = \"$FREETYPE_CFLAGS\"" >>configure.lua
echo "#ifndef FREETYPE_LIBS" > config/freetype_libs.h
echo "#define FREETYPE_LIBS \"$FREETYPE_LIBS\"" >> config/freetype_libs.h
echo "#endif" >> config/freetype_libs.h
echo "hdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
echo "FREETYPE_CFLAGS=$FREETYPE_CFLAGS" >>Makefile.config
echo "mdefs[\"FREETYPE_CFLAGS\"] = \"$FREETYPE_CFLAGS\"" >>configure.lua
echo "FREETYPE_LIBS=$FREETYPE_LIBS" >>Makefile.config
echo "mdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
else
echo "#undef FREETYPE_CFLAGS" >config/freetype_cflags.h
echo "hdefs[\"FREETYPE_CFLAGS\"] = nil" >>configure.lua
echo "#undef FREETYPE_LIBS" >config/freetype_libs.h
echo "hdefs[\"FREETYPE_LIBS\"] = nil" >>configure.lua
fi;
else
echo "#undef HAVE_FREETYPE" >config/have_freetype.h
echo "hdefs[\"HAVE_FREETYPE\"] = nil" >>configure.lua
echo "no"
echo "no" >> config.log
fi;
if [ "${HAVE_FREETYPE}" != "yes" ]
then
echo "*"
echo "* Agar needs FreeType to display vector fonts"
echo "* (http://www.freetype.org/)."
echo "*"
echo "* If you really want to use Agar's built-in"
echo "* monospace bitmap font engine (not recommended),"
echo "* please use: ./configure --without-freetype"
echo "*"
exit 1
fi
else
echo "#undef HAVE_FREETYPE" >config/have_freetype.h
echo "hdefs[\"HAVE_FREETYPE\"] = nil" >>configure.lua
FREETYPE_CFLAGS=""""
echo "FREETYPE_CFLAGS=$FREETYPE_CFLAGS" >>Makefile.config
echo "mdefs[\"FREETYPE_CFLAGS\"] = \"$FREETYPE_CFLAGS\"" >>configure.lua
FREETYPE_LIBS=""""
echo "FREETYPE_LIBS=$FREETYPE_LIBS" >>Makefile.config
echo "mdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
fi
if [ "${with_gl}" != "no" ]
then
$ECHO_N "checking for OpenGL (http://www.opengl.org)..."
$ECHO_N "checking for OpenGL (http://www.opengl.org)..." >> config.log
GL_CFLAGS=""
GL_LIBS=""
if [ -d "/usr/include/X11/GL" ]; then
GL_CFLAGS="-I/usr/include/X11"
fi;
if [ -d "/usr/include/X11R6/GL" ]; then
GL_CFLAGS="-I/usr/include/X11R6"
fi;
if [ -d "/usr/local/X11/include/GL" ]; then
GL_CFLAGS="-I/usr/local/X11/include"
fi;
if [ -d "/usr/local/X11R6/include/GL" ]; then
GL_CFLAGS="-I/usr/local/X11R6/include"
fi;
if [ -d "/usr/local/include/X11/GL" ]; then
GL_CFLAGS="-I/usr/local/include/X11"
fi;
if [ -d "/usr/local/include/X11R6/GL" ]; then
GL_CFLAGS="-I/usr/local/include/X11R6"
fi;
if [ -d "/usr/X11/include/GL" ]; then
GL_CFLAGS="-I/usr/X11/include"
fi;
if [ -d "/usr/X11R6/include/GL" ]; then
GL_CFLAGS="-I/usr/X11R6/include"
fi;
if [ -d "/usr/local/X11/lib" ]; then
GL_LIBS="-L/usr/local/X11/lib"
fi;
if [ -d "/usr/local/X11R6/lib" ]; then
GL_LIBS="-L/usr/local/X11R6/lib"
fi;
if [ -d "/usr/X11/lib" ]; then
GL_LIBS="-L/usr/X11/lib"
fi;
if [ -d "/usr/X11R6/lib" ]; then
GL_LIBS="-L/usr/X11R6/lib"
fi;
echo "yes"
echo "yes" >> config.log
if [ "$SYSTEM" = "Darwin" ]; then
OPENGL_CFLAGS=""
OPENGL_LIBS="-framework OpenGL"
else
OPENGL_CFLAGS="${GL_CFLAGS}"
$ECHO_N "checking whether -lopengl32 works..."
$ECHO_N "checking whether -lopengl32 works..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_LIBOPENGL32" ]; then
HAVE_LIBOPENGL32=`cat ${cache}/ctest-HAVE_LIBOPENGL32`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_LIBOPENGL32`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef __APPLE__
#include
#else
#include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c -lopengl32" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c -lopengl32 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_LIBOPENGL32="yes"
echo "HAVE_LIBOPENGL32=$HAVE_LIBOPENGL32" >>Makefile.config
echo "mdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure.lua
echo "#ifndef HAVE_LIBOPENGL32" > config/have_libopengl32.h
echo "#define HAVE_LIBOPENGL32 \"$HAVE_LIBOPENGL32\"" >> config/have_libopengl32.h
echo "#endif" >> config/have_libopengl32.h
echo "hdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_LIBOPENGL32="no"
echo "HAVE_LIBOPENGL32=$HAVE_LIBOPENGL32" >>Makefile.config
echo "mdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure.lua
echo "#undef HAVE_LIBOPENGL32" >config/have_libopengl32.h
echo "hdefs[\"HAVE_LIBOPENGL32\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_LIBOPENGL32" > ${cache}/ctest-HAVE_LIBOPENGL32
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_LIBOPENGL32
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_LIBOPENGL32}" = "yes" ]; then
OPENGL_LIBS="${GL_LIBS} -lopengl32"
else
OPENGL_LIBS="${GL_LIBS} -lGL"
fi;
fi;
$ECHO_N "checking whether OpenGL works..."
$ECHO_N "checking whether OpenGL works..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_OPENGL" ]; then
HAVE_OPENGL=`cat ${cache}/ctest-HAVE_OPENGL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_OPENGL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef __APPLE__
#include
#else
#include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c ${OPENGL_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c ${OPENGL_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_OPENGL="yes"
echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "#ifndef HAVE_OPENGL" > config/have_opengl.h
echo "#define HAVE_OPENGL \"$HAVE_OPENGL\"" >> config/have_opengl.h
echo "#endif" >> config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_OPENGL="no"
echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "#undef HAVE_OPENGL" >config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_OPENGL" > ${cache}/ctest-HAVE_OPENGL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_OPENGL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_OPENGL}" = "yes" ]; then
echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
echo "#ifndef OPENGL_CFLAGS" > config/opengl_cflags.h
echo "#define OPENGL_CFLAGS \"$OPENGL_CFLAGS\"" >> config/opengl_cflags.h
echo "#endif" >> config/opengl_cflags.h
echo "hdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
echo "#ifndef OPENGL_LIBS" > config/opengl_libs.h
echo "#define OPENGL_LIBS \"$OPENGL_LIBS\"" >> config/opengl_libs.h
echo "#endif" >> config/opengl_libs.h
echo "hdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
else
$ECHO_N "checking whether -lGL requires -lm..."
$ECHO_N "checking whether -lGL requires -lm..." >> config.log
OPENGL_LIBS="${OPENGL_LIBS} -lm"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_OPENGL" ]; then
HAVE_OPENGL=`cat ${cache}/ctest-HAVE_OPENGL`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_OPENGL`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef __APPLE__
#include
#else
#include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c ${OPENGL_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest conftest.c ${OPENGL_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_OPENGL="yes"
echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "#ifndef HAVE_OPENGL" > config/have_opengl.h
echo "#define HAVE_OPENGL \"$HAVE_OPENGL\"" >> config/have_opengl.h
echo "#endif" >> config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_OPENGL="no"
echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "#undef HAVE_OPENGL" >config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_OPENGL" > ${cache}/ctest-HAVE_OPENGL
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_OPENGL
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_OPENGL}" = "yes" ]; then
echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
echo "#ifndef OPENGL_CFLAGS" > config/opengl_cflags.h
echo "#define OPENGL_CFLAGS \"$OPENGL_CFLAGS\"" >> config/opengl_cflags.h
echo "#endif" >> config/opengl_cflags.h
echo "hdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
echo "#ifndef OPENGL_LIBS" > config/opengl_libs.h
echo "#define OPENGL_LIBS \"$OPENGL_LIBS\"" >> config/opengl_libs.h
echo "#endif" >> config/opengl_libs.h
echo "hdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
else
echo "#undef OPENGL_CFLAGS" >config/opengl_cflags.h
echo "hdefs[\"OPENGL_CFLAGS\"] = nil" >>configure.lua
echo "#undef OPENGL_LIBS" >config/opengl_libs.h
echo "hdefs[\"OPENGL_LIBS\"] = nil" >>configure.lua
fi;
fi;
if [ "${HAVE_OPENGL}" = "yes" ]
then
SDL_CFLAGS="$SDL_CFLAGS $OPENGL_CFLAGS"
echo "SDL_CFLAGS=$SDL_CFLAGS" >>Makefile.config
echo "mdefs[\"SDL_CFLAGS\"] = \"$SDL_CFLAGS\"" >>configure.lua
else
if [ "${with_gl}" = "yes" ]
then
echo "*"
echo "* --with-gl was requested, but no OpenGL"
echo "* library was found. Try running the"
echo "* configure script again without this"
echo "* option."
echo "*"
exit 1
else
echo "#undef HAVE_OPENGL" >config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = nil" >>configure.lua
fi
fi
else
echo "#undef HAVE_OPENGL" >config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = nil" >>configure.lua
OPENGL_CFLAGS=""""
echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
OPENGL_LIBS=""""
echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
fi
if [ "${with_jpeg}" != "no" ]
then
$ECHO_N "checking for libjpeg (ftp://ftp.uu.net/graphics/jpeg/)..."
$ECHO_N "checking for libjpeg (ftp://ftp.uu.net/graphics/jpeg/)..." >> config.log
JPEG_CFLAGS=""
if [ -f "/usr/local/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/local/include"
JPEG_LIBS="-L/usr/local/lib -ljpeg"
fi;
if [ -f "/usr/X11R6/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/X11R6/include"
JPEG_LIBS="-L/usr/X11R6/lib -ljpeg"
fi;
if [ -f "/usr/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/include"
JPEG_LIBS="-L/usr/lib -ljpeg"
fi;
if [ -f "/opt/local/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/opt/local/include"
JPEG_LIBS="-L/opt/local/lib -ljpeg"
fi;
if [ -f "/opt/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/opt/include"
JPEG_LIBS="-L/opt/lib -ljpeg"
fi;
if [ "${JPEG_CFLAGS}" != "" ]; then
echo "ok"
echo "ok" >> config.log
$ECHO_N "checking whether libjpeg works..."
$ECHO_N "checking whether libjpeg works..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_JPEG" ]; then
HAVE_JPEG=`cat ${cache}/ctest-HAVE_JPEG`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_JPEG`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#ifdef _WIN32
#error "libjpeg conflicts with windows.h"
#endif
#include
#include
struct jpeg_error_mgr jerr;
struct jpeg_compress_struct jcomp;
int
main(int argc, char *argv[])
{
jcomp.err = jpeg_std_error(&jerr);
jpeg_create_compress(&jcomp);
jcomp.image_width = 32;
jcomp.image_height = 32;
jcomp.input_components = 3;
jcomp.in_color_space = JCS_RGB;
jpeg_set_defaults(&jcomp);
jpeg_set_quality(&jcomp, 75, TRUE);
jpeg_destroy_compress(&jcomp);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${JPEG_CFLAGS} -o $testdir/conftest conftest.c ${JPEG_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${JPEG_CFLAGS} -o $testdir/conftest conftest.c ${JPEG_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_JPEG="yes"
echo "HAVE_JPEG=$HAVE_JPEG" >>Makefile.config
echo "mdefs[\"HAVE_JPEG\"] = \"$HAVE_JPEG\"" >>configure.lua
echo "#ifndef HAVE_JPEG" > config/have_jpeg.h
echo "#define HAVE_JPEG \"$HAVE_JPEG\"" >> config/have_jpeg.h
echo "#endif" >> config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = \"$HAVE_JPEG\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_JPEG="no"
echo "HAVE_JPEG=$HAVE_JPEG" >>Makefile.config
echo "mdefs[\"HAVE_JPEG\"] = \"$HAVE_JPEG\"" >>configure.lua
echo "#undef HAVE_JPEG" >config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_JPEG" > ${cache}/ctest-HAVE_JPEG
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_JPEG
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_JPEG}" != "" ]; then
echo "JPEG_CFLAGS=$JPEG_CFLAGS" >>Makefile.config
echo "mdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
echo "JPEG_LIBS=$JPEG_LIBS" >>Makefile.config
echo "mdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
echo "#ifndef JPEG_CFLAGS" > config/jpeg_cflags.h
echo "#define JPEG_CFLAGS \"$JPEG_CFLAGS\"" >> config/jpeg_cflags.h
echo "#endif" >> config/jpeg_cflags.h
echo "hdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
echo "#ifndef JPEG_LIBS" > config/jpeg_libs.h
echo "#define JPEG_LIBS \"$JPEG_LIBS\"" >> config/jpeg_libs.h
echo "#endif" >> config/jpeg_libs.h
echo "hdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
else
echo "#undef JPEG_CFLAGS" >config/jpeg_cflags.h
echo "hdefs[\"JPEG_CFLAGS\"] = nil" >>configure.lua
echo "#undef JPEG_LIBS" >config/jpeg_libs.h
echo "hdefs[\"JPEG_LIBS\"] = nil" >>configure.lua
fi;
else
echo "#undef HAVE_JPEG" >config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = nil" >>configure.lua
echo "no"
echo "no" >> config.log
fi;
if [ "${HAVE_JPEG}" != "yes" ]
then
if [ "${with_jpeg}" = "yes" ]
then
echo "*"
echo "* --with-jpeg was requested, but libjpeg"
echo "* was not found. Try running configure"
echo "* again without this option."
echo "*"
exit 1
else
echo "#undef HAVE_JPEG" >config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = nil" >>configure.lua
fi
fi
else
echo "#undef HAVE_JPEG" >config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = nil" >>configure.lua
JPEG_CFLAGS=""""
echo "JPEG_CFLAGS=$JPEG_CFLAGS" >>Makefile.config
echo "mdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
JPEG_LIBS=""""
echo "JPEG_LIBS=$JPEG_LIBS" >>Makefile.config
echo "mdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
fi
else
echo "#undef ENABLE_GUI" >config/enable_gui.h
echo "hdefs[\"ENABLE_GUI\"] = nil" >>configure.lua
SUBDIR_GUI=""""
echo "SUBDIR_GUI=$SUBDIR_GUI" >>Makefile.config
echo "mdefs[\"SUBDIR_GUI\"] = \"$SUBDIR_GUI\"" >>configure.lua
echo "#undef HAVE_FREETYPE" >config/have_freetype.h
echo "hdefs[\"HAVE_FREETYPE\"] = nil" >>configure.lua
FREETYPE_CFLAGS=""""
echo "FREETYPE_CFLAGS=$FREETYPE_CFLAGS" >>Makefile.config
echo "mdefs[\"FREETYPE_CFLAGS\"] = \"$FREETYPE_CFLAGS\"" >>configure.lua
FREETYPE_LIBS=""""
echo "FREETYPE_LIBS=$FREETYPE_LIBS" >>Makefile.config
echo "mdefs[\"FREETYPE_LIBS\"] = \"$FREETYPE_LIBS\"" >>configure.lua
echo "#undef HAVE_OPENGL" >config/have_opengl.h
echo "hdefs[\"HAVE_OPENGL\"] = nil" >>configure.lua
OPENGL_CFLAGS=""""
echo "OPENGL_CFLAGS=$OPENGL_CFLAGS" >>Makefile.config
echo "mdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
OPENGL_LIBS=""""
echo "OPENGL_LIBS=$OPENGL_LIBS" >>Makefile.config
echo "mdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
echo "#undef HAVE_JPEG" >config/have_jpeg.h
echo "hdefs[\"HAVE_JPEG\"] = nil" >>configure.lua
JPEG_CFLAGS=""""
echo "JPEG_CFLAGS=$JPEG_CFLAGS" >>Makefile.config
echo "mdefs[\"JPEG_CFLAGS\"] = \"$JPEG_CFLAGS\"" >>configure.lua
JPEG_LIBS=""""
echo "JPEG_LIBS=$JPEG_LIBS" >>Makefile.config
echo "mdefs[\"JPEG_LIBS\"] = \"$JPEG_LIBS\"" >>configure.lua
fi
if [ "${enable_network}" = "yes" ]
then
$ECHO_N "checking for the getaddrinfo() function..."
$ECHO_N "checking for the getaddrinfo() function..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETADDRINFO" ]; then
HAVE_GETADDRINFO=`cat ${cache}/ctest-HAVE_GETADDRINFO`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETADDRINFO`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
#include
int
main(int argc, char *argv[])
{
struct addrinfo hints, *res0;
const char *s;
int rv;
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
rv = getaddrinfo("hostname", "port", &hints, &res0);
s = gai_strerror(rv);
freeaddrinfo(res0);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETADDRINFO="yes"
echo "#ifndef HAVE_GETADDRINFO" > config/have_getaddrinfo.h
echo "#define HAVE_GETADDRINFO \"$HAVE_GETADDRINFO\"" >> config/have_getaddrinfo.h
echo "#endif" >> config/have_getaddrinfo.h
echo "hdefs[\"HAVE_GETADDRINFO\"] = \"$HAVE_GETADDRINFO\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETADDRINFO="no"
echo "#undef HAVE_GETADDRINFO" >config/have_getaddrinfo.h
echo "hdefs[\"HAVE_GETADDRINFO\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETADDRINFO" > ${cache}/ctest-HAVE_GETADDRINFO
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETADDRINFO
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_GETADDRINFO}" = "yes" ]
then
AG_NETWORK="yes"
echo "#ifndef AG_NETWORK" > config/ag_network.h
echo "#define AG_NETWORK \"$AG_NETWORK\"" >> config/ag_network.h
echo "#endif" >> config/ag_network.h
echo "hdefs[\"AG_NETWORK\"] = \"$AG_NETWORK\"" >>configure.lua
else
if [ "${enable_network}" = "yes" ]
then
echo "*"
echo "* --enable-network was requested, but this system"
echo "* does not support getaddrinfo(). Try running the"
echo "* configure script again without this option."
echo "*"
exit 1
else
echo "#undef AG_NETWORK" >config/ag_network.h
echo "hdefs[\"AG_NETWORK\"] = nil" >>configure.lua
fi
fi
else
echo "#undef AG_NETWORK" >config/ag_network.h
echo "hdefs[\"AG_NETWORK\"] = nil" >>configure.lua
echo "#undef HAVE_GETADDRINFO" >config/have_getaddrinfo.h
echo "hdefs[\"HAVE_GETADDRINFO\"] = nil" >>configure.lua
fi
if [ "${enable_threads}" != "no" ]
then
$ECHO_N "checking for POSIX threads..."
$ECHO_N "checking for POSIX threads..." >> config.log
PTHREADS_CFLAGS=""
PTHREADS_LIBS="-lpthread"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREADS" ]; then
HAVE_PTHREADS=`cat ${cache}/ctest-HAVE_PTHREADS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREADS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
static void *start_routine(void *arg)
{
return (NULL);
}
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_t thread;
pthread_mutex_init(&mutex, NULL);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex);
pthread_create(&thread, NULL, start_routine, NULL);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREADS="yes"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS" > config/have_pthreads.h
echo "#define HAVE_PTHREADS \"$HAVE_PTHREADS\"" >> config/have_pthreads.h
echo "#endif" >> config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREADS="no"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#undef HAVE_PTHREADS" >config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREADS" > ${cache}/ctest-HAVE_PTHREADS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREADS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREADS}" = "yes" ]; then
CFLAGS="${CFLAGS} ${PTHREADS_CFLAGS}"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
echo "#ifndef PTHREADS_CFLAGS" > config/pthreads_cflags.h
echo "#define PTHREADS_CFLAGS \"$PTHREADS_CFLAGS\"" >> config/pthreads_cflags.h
echo "#endif" >> config/pthreads_cflags.h
echo "hdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "#ifndef PTHREADS_LIBS" > config/pthreads_libs.h
echo "#define PTHREADS_LIBS \"$PTHREADS_LIBS\"" >> config/pthreads_libs.h
echo "#endif" >> config/pthreads_libs.h
echo "hdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
else
$ECHO_N "checking for -pthread..."
$ECHO_N "checking for -pthread..." >> config.log
PTHREADS_LIBS="-pthread"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREADS" ]; then
HAVE_PTHREADS=`cat ${cache}/ctest-HAVE_PTHREADS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREADS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
static void *start_routine(void *arg)
{
return (NULL);
}
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_t thread;
pthread_mutex_init(&mutex, NULL);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex);
pthread_create(&thread, NULL, start_routine, NULL);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREADS="yes"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS" > config/have_pthreads.h
echo "#define HAVE_PTHREADS \"$HAVE_PTHREADS\"" >> config/have_pthreads.h
echo "#endif" >> config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREADS="no"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#undef HAVE_PTHREADS" >config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREADS" > ${cache}/ctest-HAVE_PTHREADS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREADS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREADS}" = "yes" ]; then
CFLAGS="${CFLAGS} ${PTHREADS_CFLAGS}"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
echo "#ifndef PTHREADS_CFLAGS" > config/pthreads_cflags.h
echo "#define PTHREADS_CFLAGS \"$PTHREADS_CFLAGS\"" >> config/pthreads_cflags.h
echo "#endif" >> config/pthreads_cflags.h
echo "hdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "#ifndef PTHREADS_LIBS" > config/pthreads_libs.h
echo "#define PTHREADS_LIBS \"$PTHREADS_LIBS\"" >> config/pthreads_libs.h
echo "#endif" >> config/pthreads_libs.h
echo "hdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
else
PTHREADS_CFLAGS=""
PTHREADS_LIBS=""
$ECHO_N "checking for -pthread (common paths)..."
$ECHO_N "checking for -pthread (common paths)..." >> config.log
if [ -f "/usr/include/pthreads/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/include/pthreads"
fi;
if [ -f "/usr/local/include/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/local/include"
fi;
if [ -f "/usr/local/include/pthreads/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/local/include/pthreads"
fi;
if [ -f "/usr/local/lib/libpthread.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthread"
fi;
if [ -f "/usr/local/lib/libpthreadGC1.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGC1"
fi;
if [ -f "/usr/local/lib/libpthreadGC1d.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGC1d"
fi;
if [ -f "/usr/local/lib/libpthreadGCE1.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGCE1"
fi;
if [ -f "/usr/local/lib/libpthreadGCE1d.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGCE1d"
fi;
if [ -f "/usr/local/lib/libpthreadGC2.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGC2"
fi;
if [ -f "/usr/local/lib/libpthreadGC2d.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGC2d"
fi;
if [ -f "/usr/local/lib/libpthreadGCE2.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGCE2"
fi;
if [ -f "/usr/local/lib/libpthreadGCE2d.a" ]; then
PTHREADS_LIBS="-L/usr/local/lib -lpthreadGCE2d"
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREADS" ]; then
HAVE_PTHREADS=`cat ${cache}/ctest-HAVE_PTHREADS`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREADS`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
static void *start_routine(void *arg)
{
return (NULL);
}
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_t thread;
pthread_mutex_init(&mutex, NULL);
pthread_mutex_lock(&mutex);
pthread_mutex_unlock(&mutex);
pthread_mutex_destroy(&mutex);
pthread_create(&thread, NULL, start_routine, NULL);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREADS="yes"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS" > config/have_pthreads.h
echo "#define HAVE_PTHREADS \"$HAVE_PTHREADS\"" >> config/have_pthreads.h
echo "#endif" >> config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREADS="no"
echo "HAVE_PTHREADS=$HAVE_PTHREADS" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS\"] = \"$HAVE_PTHREADS\"" >>configure.lua
echo "#undef HAVE_PTHREADS" >config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREADS" > ${cache}/ctest-HAVE_PTHREADS
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREADS
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREADS}" = "yes" ]; then
CFLAGS="${CFLAGS} ${PTHREADS_CFLAGS}"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
echo "#ifndef PTHREADS_CFLAGS" > config/pthreads_cflags.h
echo "#define PTHREADS_CFLAGS \"$PTHREADS_CFLAGS\"" >> config/pthreads_cflags.h
echo "#endif" >> config/pthreads_cflags.h
echo "hdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
echo "#ifndef PTHREADS_LIBS" > config/pthreads_libs.h
echo "#define PTHREADS_LIBS \"$PTHREADS_LIBS\"" >> config/pthreads_libs.h
echo "#endif" >> config/pthreads_libs.h
echo "hdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
fi;
fi;
fi;
$ECHO_N "checking for the X/Open Threads Extension..."
$ECHO_N "checking for the X/Open Threads Extension..." >> config.log
if [ "${SYSTEM}" = "FreeBSD" ]; then
PTHREADS_XOPEN_CFLAGS=""
else
PTHREADS_XOPEN_CFLAGS="-U_XOPEN_SOURCE -D_XOPEN_SOURCE=600"
fi;
PTHREADS_XOPEN_LIBS="-lpthread"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREADS_XOPEN" ]; then
HAVE_PTHREADS_XOPEN=`cat ${cache}/ctest-HAVE_PTHREADS_XOPEN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREADS_XOPEN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_XOPEN_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_XOPEN_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_XOPEN_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_XOPEN_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREADS_XOPEN="yes"
echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS_XOPEN" > config/have_pthreads_xopen.h
echo "#define HAVE_PTHREADS_XOPEN \"$HAVE_PTHREADS_XOPEN\"" >> config/have_pthreads_xopen.h
echo "#endif" >> config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREADS_XOPEN="no"
echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#undef HAVE_PTHREADS_XOPEN" >config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREADS_XOPEN" > ${cache}/ctest-HAVE_PTHREADS_XOPEN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREADS_XOPEN
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREADS_XOPEN}" = "yes" ]; then
echo "PTHREADS_XOPEN_CFLAGS=$PTHREADS_XOPEN_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
echo "PTHREADS_XOPEN_LIBS=$PTHREADS_XOPEN_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS_XOPEN" > config/have_pthreads_xopen.h
echo "#define HAVE_PTHREADS_XOPEN \"$HAVE_PTHREADS_XOPEN\"" >> config/have_pthreads_xopen.h
echo "#endif" >> config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#ifndef PTHREADS_XOPEN_CFLAGS" > config/pthreads_xopen_cflags.h
echo "#define PTHREADS_XOPEN_CFLAGS \"$PTHREADS_XOPEN_CFLAGS\"" >> config/pthreads_xopen_cflags.h
echo "#endif" >> config/pthreads_xopen_cflags.h
echo "hdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
echo "#ifndef PTHREADS_XOPEN_LIBS" > config/pthreads_xopen_libs.h
echo "#define PTHREADS_XOPEN_LIBS \"$PTHREADS_XOPEN_LIBS\"" >> config/pthreads_xopen_libs.h
echo "#endif" >> config/pthreads_xopen_libs.h
echo "hdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
else
PTHREADS_XOPEN_LIBS=""
$ECHO_N "checking for the X/Open Threads Extension (common paths)..."
$ECHO_N "checking for the X/Open Threads Extension (common paths)..." >> config.log
if [ -f "/usr/local/lib/libpthread.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthread"
fi;
if [ -f "/usr/local/lib/libpthreadGC1.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGC1"
fi;
if [ -f "/usr/local/lib/libpthreadGC1d.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGC1d"
fi;
if [ -f "/usr/local/lib/libpthreadGCE1.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGCE1"
fi;
if [ -f "/usr/local/lib/libpthreadGCE1d.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGCE1d"
fi;
if [ -f "/usr/local/lib/libpthreadGC2.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGC2"
fi;
if [ -f "/usr/local/lib/libpthreadGC2d.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGC2d"
fi;
if [ -f "/usr/local/lib/libpthreadGCE2.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGCE2"
fi;
if [ -f "/usr/local/lib/libpthreadGCE2d.a" ]; then
PTHREADS_XOPEN_LIBS="-L/usr/local/lib -lpthreadGCE2d"
fi;
if [ -f "/usr/include/pthreads/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/include/pthreads"
fi;
if [ -f "/usr/local/include/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/local/include"
fi;
if [ -f "/usr/local/include/pthreads/pthread.h" ]; then
PTHREADS_CFLAGS="-I/usr/local/include/pthreads"
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREADS_XOPEN" ]; then
HAVE_PTHREADS_XOPEN=`cat ${cache}/ctest-HAVE_PTHREADS_XOPEN`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREADS_XOPEN`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_XOPEN_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_XOPEN_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_XOPEN_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_XOPEN_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREADS_XOPEN="yes"
echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS_XOPEN" > config/have_pthreads_xopen.h
echo "#define HAVE_PTHREADS_XOPEN \"$HAVE_PTHREADS_XOPEN\"" >> config/have_pthreads_xopen.h
echo "#endif" >> config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREADS_XOPEN="no"
echo "HAVE_PTHREADS_XOPEN=$HAVE_PTHREADS_XOPEN" >>Makefile.config
echo "mdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#undef HAVE_PTHREADS_XOPEN" >config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREADS_XOPEN" > ${cache}/ctest-HAVE_PTHREADS_XOPEN
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREADS_XOPEN
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREADS_XOPEN}" = "yes" ]; then
echo "PTHREADS_XOPEN_CFLAGS=$PTHREADS_XOPEN_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
echo "PTHREADS_XOPEN_LIBS=$PTHREADS_XOPEN_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
echo "#ifndef HAVE_PTHREADS_XOPEN" > config/have_pthreads_xopen.h
echo "#define HAVE_PTHREADS_XOPEN \"$HAVE_PTHREADS_XOPEN\"" >> config/have_pthreads_xopen.h
echo "#endif" >> config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = \"$HAVE_PTHREADS_XOPEN\"" >>configure.lua
echo "#ifndef PTHREADS_XOPEN_CFLAGS" > config/pthreads_xopen_cflags.h
echo "#define PTHREADS_XOPEN_CFLAGS \"$PTHREADS_XOPEN_CFLAGS\"" >> config/pthreads_xopen_cflags.h
echo "#endif" >> config/pthreads_xopen_cflags.h
echo "hdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
echo "#ifndef PTHREADS_XOPEN_LIBS" > config/pthreads_xopen_libs.h
echo "#define PTHREADS_XOPEN_LIBS \"$PTHREADS_XOPEN_LIBS\"" >> config/pthreads_xopen_libs.h
echo "#endif" >> config/pthreads_xopen_libs.h
echo "hdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
else
echo "#undef HAVE_PTHREADS_XOPEN" >config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = nil" >>configure.lua
fi;
fi;
$ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE..."
$ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE" ]; then
HAVE_PTHREAD_MUTEX_RECURSIVE=`cat ${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREAD_MUTEX_RECURSIVE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREAD_MUTEX_RECURSIVE="yes"
echo "HAVE_PTHREAD_MUTEX_RECURSIVE=$HAVE_PTHREAD_MUTEX_RECURSIVE" >>Makefile.config
echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
echo "#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE" > config/have_pthread_mutex_recursive.h
echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >> config/have_pthread_mutex_recursive.h
echo "#endif" >> config/have_pthread_mutex_recursive.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREAD_MUTEX_RECURSIVE="no"
echo "HAVE_PTHREAD_MUTEX_RECURSIVE=$HAVE_PTHREAD_MUTEX_RECURSIVE" >>Makefile.config
echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
echo "#undef HAVE_PTHREAD_MUTEX_RECURSIVE" >config/have_pthread_mutex_recursive.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREAD_MUTEX_RECURSIVE" > ${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREAD_MUTEX_RECURSIVE
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE}" = "yes" ]; then
echo "#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE" > config/have_pthread_mutex_recursive.h
echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >> config/have_pthread_mutex_recursive.h
echo "#endif" >> config/have_pthread_mutex_recursive.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE\"" >>configure.lua
else
echo "#undef HAVE_PTHREAD_MUTEX_RECURSIVE" >config/have_pthread_mutex_recursive.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE\"] = nil" >>configure.lua
fi;
$ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE_NP..."
$ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE_NP..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE_NP" ]; then
HAVE_PTHREAD_MUTEX_RECURSIVE_NP=`cat ${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE_NP`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_PTHREAD_MUTEX_RECURSIVE_NP`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
int main(int argc, char *argv[])
{
pthread_mutex_t mutex;
pthread_mutexattr_t mutexattr;
pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&mutex, &mutexattr);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${PTHREADS_CFLAGS} -o $testdir/conftest conftest.c ${PTHREADS_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_PTHREAD_MUTEX_RECURSIVE_NP="yes"
echo "HAVE_PTHREAD_MUTEX_RECURSIVE_NP=$HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >>Makefile.config
echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
echo "#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE_NP" > config/have_pthread_mutex_recursive_np.h
echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE_NP \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >> config/have_pthread_mutex_recursive_np.h
echo "#endif" >> config/have_pthread_mutex_recursive_np.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_PTHREAD_MUTEX_RECURSIVE_NP="no"
echo "HAVE_PTHREAD_MUTEX_RECURSIVE_NP=$HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >>Makefile.config
echo "mdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
echo "#undef HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >config/have_pthread_mutex_recursive_np.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_PTHREAD_MUTEX_RECURSIVE_NP" > ${cache}/ctest-HAVE_PTHREAD_MUTEX_RECURSIVE_NP
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_PTHREAD_MUTEX_RECURSIVE_NP
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE_NP}" = "yes" ]; then
echo "#ifndef HAVE_PTHREAD_MUTEX_RECURSIVE_NP" > config/have_pthread_mutex_recursive_np.h
echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE_NP \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >> config/have_pthread_mutex_recursive_np.h
echo "#endif" >> config/have_pthread_mutex_recursive_np.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = \"$HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"" >>configure.lua
else
echo "#undef HAVE_PTHREAD_MUTEX_RECURSIVE_NP" >config/have_pthread_mutex_recursive_np.h
echo "hdefs[\"HAVE_PTHREAD_MUTEX_RECURSIVE_NP\"] = nil" >>configure.lua
fi;
if [ "${HAVE_PTHREADS}" = "yes" ]
then
AG_THREADS="yes"
echo "#ifndef AG_THREADS" > config/ag_threads.h
echo "#define AG_THREADS \"$AG_THREADS\"" >> config/ag_threads.h
echo "#endif" >> config/ag_threads.h
echo "hdefs[\"AG_THREADS\"] = \"$AG_THREADS\"" >>configure.lua
if [ "${HAVE_PTHREADS_XOPEN}" = "no" ]
then
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE}" = "no" ]
then
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE_NP}" = "no" ]
then
echo "#undef AG_THREADS" >config/ag_threads.h
echo "hdefs[\"AG_THREADS\"] = nil" >>configure.lua
if [ "${enable_threads}" = "yes" ]
then
echo "*"
echo "* --enable-threads was given, but your"
echo "* pthreads library lacks support for"
echo "* recursive mutexes. Try running the"
echo "* configure script again without this"
echo "* option."
echo "*"
exit 1
fi
fi
fi
fi
else
echo "#undef AG_THREADS" >config/ag_threads.h
echo "hdefs[\"AG_THREADS\"] = nil" >>configure.lua
if [ "${enable_threads}" = "yes" ]
then
echo "*"
echo "* --enable-threads was given, but no pthreads"
echo "* library was found on your system. Try running"
echo "* the configure script again without this option."
echo "*"
exit 1
fi
fi
else
echo "#undef AG_THREADS" >config/ag_threads.h
echo "hdefs[\"AG_THREADS\"] = nil" >>configure.lua
echo "#undef HAVE_PTHREADS" >config/have_pthreads.h
echo "hdefs[\"HAVE_PTHREADS\"] = nil" >>configure.lua
echo "#undef HAVE_PTHREADS_XOPEN" >config/have_pthreads_xopen.h
echo "hdefs[\"HAVE_PTHREADS_XOPEN\"] = nil" >>configure.lua
PTHREADS_CFLAGS=""""
echo "PTHREADS_CFLAGS=$PTHREADS_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_CFLAGS\"] = \"$PTHREADS_CFLAGS\"" >>configure.lua
PTHREADS_LIBS=""""
echo "PTHREADS_LIBS=$PTHREADS_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_LIBS\"] = \"$PTHREADS_LIBS\"" >>configure.lua
PTHREADS_XOPEN_CFLAGS=""""
echo "PTHREADS_XOPEN_CFLAGS=$PTHREADS_XOPEN_CFLAGS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_CFLAGS\"] = \"$PTHREADS_XOPEN_CFLAGS\"" >>configure.lua
PTHREADS_XOPEN_LIBS=""""
echo "PTHREADS_XOPEN_LIBS=$PTHREADS_XOPEN_LIBS" >>Makefile.config
echo "mdefs[\"PTHREADS_XOPEN_LIBS\"] = \"$PTHREADS_XOPEN_LIBS\"" >>configure.lua
if [ "${enable_warnings}" = "yes" ]
then
CFLAGS="$CFLAGS -Wno-unused"
CXXFLAGS="$CXXFLAGS -Wno-unused"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
fi
fi
if [ "${enable_utf8}" != "no" ]
then
UTF8="yes"
echo "#ifndef UTF8" > config/utf8.h
echo "#define UTF8 \"$UTF8\"" >> config/utf8.h
echo "#endif" >> config/utf8.h
echo "hdefs[\"UTF8\"] = \"$UTF8\"" >>configure.lua
else
echo "#undef UTF8" >config/utf8.h
echo "hdefs[\"UTF8\"] = nil" >>configure.lua
fi
echo "#undef ASTRONOMICAL_UNITS" >config/astronomical_units.h
echo "hdefs[\"ASTRONOMICAL_UNITS\"] = nil" >>configure.lua
HISTORICAL_UNITS="yes"
echo "#ifndef HISTORICAL_UNITS" > config/historical_units.h
echo "#define HISTORICAL_UNITS \"$HISTORICAL_UNITS\"" >> config/historical_units.h
echo "#endif" >> config/historical_units.h
echo "hdefs[\"HISTORICAL_UNITS\"] = \"$HISTORICAL_UNITS\"" >>configure.lua
if [ "${enable_8bpp}" != "no" ]
then
VIEW_8BPP="yes"
echo "#ifndef VIEW_8BPP" > config/view_8bpp.h
echo "#define VIEW_8BPP \"$VIEW_8BPP\"" >> config/view_8bpp.h
echo "#endif" >> config/view_8bpp.h
echo "hdefs[\"VIEW_8BPP\"] = \"$VIEW_8BPP\"" >>configure.lua
else
echo "#undef VIEW_8BPP" >config/view_8bpp.h
echo "hdefs[\"VIEW_8BPP\"] = nil" >>configure.lua
fi
if [ "${enable_16bpp}" != "no" ]
then
VIEW_16BPP="yes"
echo "#ifndef VIEW_16BPP" > config/view_16bpp.h
echo "#define VIEW_16BPP \"$VIEW_16BPP\"" >> config/view_16bpp.h
echo "#endif" >> config/view_16bpp.h
echo "hdefs[\"VIEW_16BPP\"] = \"$VIEW_16BPP\"" >>configure.lua
else
echo "#undef VIEW_16BPP" >config/view_16bpp.h
echo "hdefs[\"VIEW_16BPP\"] = nil" >>configure.lua
fi
if [ "${enable_24bpp}" != "no" ]
then
VIEW_24BPP="yes"
echo "#ifndef VIEW_24BPP" > config/view_24bpp.h
echo "#define VIEW_24BPP \"$VIEW_24BPP\"" >> config/view_24bpp.h
echo "#endif" >> config/view_24bpp.h
echo "hdefs[\"VIEW_24BPP\"] = \"$VIEW_24BPP\"" >>configure.lua
else
echo "#undef VIEW_24BPP" >config/view_24bpp.h
echo "hdefs[\"VIEW_24BPP\"] = nil" >>configure.lua
fi
if [ "${enable_32bpp}" != "no" ]
then
VIEW_32BPP="yes"
echo "#ifndef VIEW_32BPP" > config/view_32bpp.h
echo "#define VIEW_32BPP \"$VIEW_32BPP\"" >> config/view_32bpp.h
echo "#endif" >> config/view_32bpp.h
echo "hdefs[\"VIEW_32BPP\"] = \"$VIEW_32BPP\"" >>configure.lua
else
echo "#undef VIEW_32BPP" >config/view_32bpp.h
echo "hdefs[\"VIEW_32BPP\"] = nil" >>configure.lua
fi
if [ "${enable_nls}" = "yes" ]
then
$ECHO_N "checking for a gettext library..."
$ECHO_N "checking for a gettext library..." >> config.log
GETTEXT_CFLAGS=""
GETTEXT_LIBS=""
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETTEXT" ]; then
HAVE_GETTEXT=`cat ${cache}/ctest-HAVE_GETTEXT`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETTEXT`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[])
{
char *s;
bindtextdomain("foo", "/foo");
textdomain("foo");
s = gettext("string");
s = dgettext("foo","string");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETTEXT="yes"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#ifndef HAVE_GETTEXT" > config/have_gettext.h
echo "#define HAVE_GETTEXT \"$HAVE_GETTEXT\"" >> config/have_gettext.h
echo "#endif" >> config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETTEXT="no"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#undef HAVE_GETTEXT" >config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETTEXT" > ${cache}/ctest-HAVE_GETTEXT
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETTEXT
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_GETTEXT}" = "no" ]; then
$ECHO_N "checking whether gettext requires -lintl..."
$ECHO_N "checking whether gettext requires -lintl..." >> config.log
if [ -e /usr/include/libintl.h ]; then
GETTEXT_CFLAGS="-I/usr/include"
GETTEXT_LIBS="-L/usr/lib -lintl"
fi;
if [ -e /usr/local/include/libintl.h ]; then
GETTEXT_CFLAGS="-I/usr/local/include"
GETTEXT_LIBS="-L/usr/local/lib -lintl"
fi;
if [ -e /opt/include/libintl.h ]; then
GETTEXT_CFLAGS="-I/opt/include"
GETTEXT_LIBS="-L/opt/lib -lintl"
fi;
if [ -e /opt/local/include/libintl.h ]; then
GETTEXT_CFLAGS="-I/opt/local/include"
GETTEXT_LIBS="-L/opt/local/lib -lintl"
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETTEXT" ]; then
HAVE_GETTEXT=`cat ${cache}/ctest-HAVE_GETTEXT`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETTEXT`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[])
{
char *s;
bindtextdomain("foo", "/foo");
textdomain("foo");
s = gettext("string");
s = dgettext("foo","string");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETTEXT="yes"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#ifndef HAVE_GETTEXT" > config/have_gettext.h
echo "#define HAVE_GETTEXT \"$HAVE_GETTEXT\"" >> config/have_gettext.h
echo "#endif" >> config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETTEXT="no"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#undef HAVE_GETTEXT" >config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETTEXT" > ${cache}/ctest-HAVE_GETTEXT
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETTEXT
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_GETTEXT}" = "yes" ]; then
echo "#ifndef GETTEXT_CFLAGS" > config/gettext_cflags.h
echo "#define GETTEXT_CFLAGS \"$GETTEXT_CFLAGS\"" >> config/gettext_cflags.h
echo "#endif" >> config/gettext_cflags.h
echo "hdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "#ifndef GETTEXT_LIBS" > config/gettext_libs.h
echo "#define GETTEXT_LIBS \"$GETTEXT_LIBS\"" >> config/gettext_libs.h
echo "#endif" >> config/gettext_libs.h
echo "hdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
echo "GETTEXT_CFLAGS=$GETTEXT_CFLAGS" >>Makefile.config
echo "mdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "GETTEXT_LIBS=$GETTEXT_LIBS" >>Makefile.config
echo "mdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
else
$ECHO_N "checking whether -lintl requires -liconv..."
$ECHO_N "checking whether -lintl requires -liconv..." >> config.log
if [ -e /usr/include/iconv.h ]; then
GETTEXT_CFLAGS="${GETTEXT_CFLAGS} -I/usr/include"
GETTEXT_LIBS="${GETTEXT_LIBS} -L/usr/lib -liconv"
fi;
if [ -e /usr/local/include/iconv.h ]; then
GETTEXT_CFLAGS="${GETTEXT_CFLAGS} -I/usr/local/include"
GETTEXT_LIBS="${GETTEXT_LIBS} -L/usr/local/lib -liconv"
fi;
if [ -e /opt/include/iconv.h ]; then
GETTEXT_CFLAGS="${GETTEXT_CFLAGS} -I/opt/include"
GETTEXT_LIBS="${GETTEXT_LIBS} -L/opt/lib -liconv"
fi;
if [ -e /opt/local/include/iconv.h ]; then
GETTEXT_CFLAGS="${GETTEXT_CFLAGS} -I/opt/local/include"
GETTEXT_LIBS="${GETTEXT_LIBS} -L/opt/local/lib -liconv"
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_GETTEXT" ]; then
HAVE_GETTEXT=`cat ${cache}/ctest-HAVE_GETTEXT`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_GETTEXT`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int main(int argc, char *argv[])
{
char *s;
bindtextdomain("foo", "/foo");
textdomain("foo");
s = gettext("string");
s = dgettext("foo","string");
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS}" >>config.log
$CC $CFLAGS $TEST_CFLAGS ${GETTEXT_CFLAGS} -o $testdir/conftest conftest.c ${GETTEXT_LIBS} 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_GETTEXT="yes"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#ifndef HAVE_GETTEXT" > config/have_gettext.h
echo "#define HAVE_GETTEXT \"$HAVE_GETTEXT\"" >> config/have_gettext.h
echo "#endif" >> config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_GETTEXT="no"
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "#undef HAVE_GETTEXT" >config/have_gettext.h
echo "hdefs[\"HAVE_GETTEXT\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_GETTEXT" > ${cache}/ctest-HAVE_GETTEXT
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_GETTEXT
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_GETTEXT}" != "" ]; then
echo "#ifndef GETTEXT_CFLAGS" > config/gettext_cflags.h
echo "#define GETTEXT_CFLAGS \"$GETTEXT_CFLAGS\"" >> config/gettext_cflags.h
echo "#endif" >> config/gettext_cflags.h
echo "hdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "#ifndef GETTEXT_LIBS" > config/gettext_libs.h
echo "#define GETTEXT_LIBS \"$GETTEXT_LIBS\"" >> config/gettext_libs.h
echo "#endif" >> config/gettext_libs.h
echo "hdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
echo "GETTEXT_CFLAGS=$GETTEXT_CFLAGS" >>Makefile.config
echo "mdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "GETTEXT_LIBS=$GETTEXT_LIBS" >>Makefile.config
echo "mdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
fi;
fi;
else
echo "#ifndef GETTEXT_CFLAGS" > config/gettext_cflags.h
echo "#define GETTEXT_CFLAGS \"$GETTEXT_CFLAGS\"" >> config/gettext_cflags.h
echo "#endif" >> config/gettext_cflags.h
echo "hdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "#ifndef GETTEXT_LIBS" > config/gettext_libs.h
echo "#define GETTEXT_LIBS \"$GETTEXT_LIBS\"" >> config/gettext_libs.h
echo "#endif" >> config/gettext_libs.h
echo "hdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
echo "GETTEXT_CFLAGS=$GETTEXT_CFLAGS" >>Makefile.config
echo "mdefs[\"GETTEXT_CFLAGS\"] = \"$GETTEXT_CFLAGS\"" >>configure.lua
echo "GETTEXT_LIBS=$GETTEXT_LIBS" >>Makefile.config
echo "mdefs[\"GETTEXT_LIBS\"] = \"$GETTEXT_LIBS\"" >>configure.lua
fi;
if [ "${HAVE_GETTEXT}" != "yes" ]
then
echo "*"
echo "* --enable-nls was given but gettext was not found. Try"
echo "* running configure again without this option."
echo "*"
exit 1
fi
fi
if [ "${enable_math}" != "no" ]
then
ENABLE_MATH="yes"
echo "#ifndef ENABLE_MATH" > config/enable_math.h
echo "#define ENABLE_MATH \"$ENABLE_MATH\"" >> config/enable_math.h
echo "#endif" >> config/enable_math.h
echo "hdefs[\"ENABLE_MATH\"] = \"$ENABLE_MATH\"" >>configure.lua
SUBDIR_MATH="math agar-math-config"
echo "SUBDIR_MATH=$SUBDIR_MATH" >>Makefile.config
echo "mdefs[\"SUBDIR_MATH\"] = \"$SUBDIR_MATH\"" >>configure.lua
else
echo "#undef ENABLE_MATH" >config/enable_math.h
echo "hdefs[\"ENABLE_MATH\"] = nil" >>configure.lua
SUBDIR_MATH=""""
echo "SUBDIR_MATH=$SUBDIR_MATH" >>Makefile.config
echo "mdefs[\"SUBDIR_MATH\"] = \"$SUBDIR_MATH\"" >>configure.lua
fi
if [ "${with_sse}" = "yes" ]
then
$ECHO_N "checking for SSE extensions..."
$ECHO_N "checking for SSE extensions..." >> config.log
SSE_CFLAGS="-msse"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SSE" ]; then
HAVE_SSE=`cat ${cache}/ctest-HAVE_SSE`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SSE`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-HAVE_SSE`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
#include
#define MAXERR 1e-4
typedef union vec {
float v[4];
__m128 m128;
struct { float x, y, z, pad; };
} Vector __attribute__ ((aligned(16)));
const float testVals[4][7] = {
{ 0.076003,0.559770,0.163680, 1.0, 0.076003,0.559770,0.163680 },
{ 0.076003,0.559770,0.163680, 0.20485, 0.015569,0.114667,0.033529 },
{ 0.668390,0.929890,0.382710, 1.0, 0.668390,0.929890,0.382710 },
{ 0.668390,0.929890,0.382710, 0.95831, 0.640530,0.891120,0.366760 },
};
static Vector
Scale(Vector a, float c)
{
Vector b;
__m128 v;
v = _mm_set1_ps(c);
b.m128 = _mm_mul_ps(a.m128, v);
return (b);
}
int
main(int argc, char *argv[])
{
Vector a, b;
float dx, dy, dz;
int i, j;
for (i = 0; i < 10000; i++) {
for (j = 0; j < 4; j++) {
a.x = testVals[j][0];
a.y = testVals[j][1];
a.z = testVals[j][2];
b = Scale(a, testVals[j][3]);
dx = b.x - testVals[j][4];
dy = b.y - testVals[j][5];
dz = b.z - testVals[j][6];
if ((dx > 0.0 && dx > MAXERR) ||
(dx < 0.0 && dx < -MAXERR) ||
(dy > 0.0 && dy > MAXERR) ||
(dy < 0.0 && dz < -MAXERR) ||
(dz > 0.0 && dz > MAXERR) ||
(dz < 0.0 && dz < -MAXERR)) {
printf("results inaccurate [%f,%f,%f]\n",
dx, dy, dz);
return (1);
}
}
}
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SSE="yes"
echo "HAVE_SSE=$HAVE_SSE" >>Makefile.config
echo "mdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
echo "#ifndef HAVE_SSE" > config/have_sse.h
echo "#define HAVE_SSE \"$HAVE_SSE\"" >> config/have_sse.h
echo "#endif" >> config/have_sse.h
echo "hdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE="no"
echo "HAVE_SSE=$HAVE_SSE" >>Makefile.config
echo "mdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
echo "#undef HAVE_SSE" >config/have_sse.h
echo "hdefs[\"HAVE_SSE\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE="no"
echo "HAVE_SSE=$HAVE_SSE" >>Makefile.config
echo "mdefs[\"HAVE_SSE\"] = \"$HAVE_SSE\"" >>configure.lua
echo "#undef HAVE_SSE" >config/have_sse.h
echo "hdefs[\"HAVE_SSE\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SSE" > ${cache}/ctest-HAVE_SSE
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SSE
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-HAVE_SSE
fi
rm -f conftest.c $testdir/conftest
if [ "${HAVE_SSE}" = "yes" ]; then
echo "#ifndef SSE_CFLAGS" > config/sse_cflags.h
echo "#define SSE_CFLAGS \"$SSE_CFLAGS\"" >> config/sse_cflags.h
echo "#endif" >> config/sse_cflags.h
echo "hdefs[\"SSE_CFLAGS\"] = \"$SSE_CFLAGS\"" >>configure.lua
else
echo "#undef SSE_CFLAGS" >config/sse_cflags.h
echo "hdefs[\"SSE_CFLAGS\"] = nil" >>configure.lua
SSE_CFLAGS=""
fi;
echo "SSE_CFLAGS=$SSE_CFLAGS" >>Makefile.config
echo "mdefs[\"SSE_CFLAGS\"] = \"$SSE_CFLAGS\"" >>configure.lua
$ECHO_N "checking for SSE2 extensions..."
$ECHO_N "checking for SSE2 extensions..." >> config.log
SSE2_CFLAGS="-msse2"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SSE2" ]; then
HAVE_SSE2=`cat ${cache}/ctest-HAVE_SSE2`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SSE2`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-HAVE_SSE2`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
double a[4] __attribute__ ((aligned(16)));
double b[4] __attribute__ ((aligned(16)));
double rv;
__m128d vec1, vec2;
vec1 = _mm_load_pd(a);
vec2 = _mm_load_pd(b);
vec1 = _mm_xor_pd(vec1, vec2);
_mm_store_sd(&rv, vec1);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE2_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE2_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SSE2="yes"
echo "HAVE_SSE2=$HAVE_SSE2" >>Makefile.config
echo "mdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
echo "#ifndef HAVE_SSE2" > config/have_sse2.h
echo "#define HAVE_SSE2 \"$HAVE_SSE2\"" >> config/have_sse2.h
echo "#endif" >> config/have_sse2.h
echo "hdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE2="no"
echo "HAVE_SSE2=$HAVE_SSE2" >>Makefile.config
echo "mdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
echo "#undef HAVE_SSE2" >config/have_sse2.h
echo "hdefs[\"HAVE_SSE2\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE2="no"
echo "HAVE_SSE2=$HAVE_SSE2" >>Makefile.config
echo "mdefs[\"HAVE_SSE2\"] = \"$HAVE_SSE2\"" >>configure.lua
echo "#undef HAVE_SSE2" >config/have_sse2.h
echo "hdefs[\"HAVE_SSE2\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SSE2" > ${cache}/ctest-HAVE_SSE2
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SSE2
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-HAVE_SSE2
fi
rm -f conftest.c $testdir/conftest
if [ "${HAVE_SSE2}" = "yes" ]; then
echo "#ifndef SSE2_CFLAGS" > config/sse2_cflags.h
echo "#define SSE2_CFLAGS \"$SSE2_CFLAGS\"" >> config/sse2_cflags.h
echo "#endif" >> config/sse2_cflags.h
echo "hdefs[\"SSE2_CFLAGS\"] = \"$SSE2_CFLAGS\"" >>configure.lua
else
echo "#undef SSE2_CFLAGS" >config/sse2_cflags.h
echo "hdefs[\"SSE2_CFLAGS\"] = nil" >>configure.lua
SSE2_CFLAGS=""
fi;
echo "SSE2_CFLAGS=$SSE2_CFLAGS" >>Makefile.config
echo "mdefs[\"SSE2_CFLAGS\"] = \"$SSE2_CFLAGS\"" >>configure.lua
$ECHO_N "checking for SSE3 extensions..."
$ECHO_N "checking for SSE3 extensions..." >> config.log
SSE3_CFLAGS="-msse3"
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
MK_RUN_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_SSE3" ]; then
HAVE_SSE3=`cat ${cache}/ctest-HAVE_SSE3`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_SSE3`
MK_RUN_STATUS=`cat ${cache}/ctest-runstatus-HAVE_SSE3`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
int
main(int argc, char *argv[])
{
float a[4] __attribute__ ((aligned(16)));
float b[4] __attribute__ ((aligned(16)));
__m128 vec1, vec2;
float rv;
vec1 = _mm_load_ps(a);
vec2 = _mm_load_ps(b);
vec1 = _mm_mul_ps(vec1, vec2);
vec1 = _mm_hadd_ps(vec1, vec1);
vec1 = _mm_hadd_ps(vec1, vec1);
_mm_store_ss(&rv, vec1);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE3_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${SSE3_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
(cd $testdir && ./conftest$EXECSUFFIX) >> config.log
if [ "$?" = "0" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_SSE3="yes"
echo "HAVE_SSE3=$HAVE_SSE3" >>Makefile.config
echo "mdefs[\"HAVE_SSE3\"] = \"$HAVE_SSE3\"" >>configure.lua
echo "#ifndef HAVE_SSE3" > config/have_sse3.h
echo "#define HAVE_SSE3 \"$HAVE_SSE3\"" >> config/have_sse3.h
echo "#endif" >> config/have_sse3.h
echo "hdefs[\"HAVE_SSE3\"] = \"$HAVE_SSE3\"" >>configure.lua
else
echo "no (test program failed)"
echo "no (test program failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE3="no"
echo "HAVE_SSE3=$HAVE_SSE3" >>Makefile.config
echo "mdefs[\"HAVE_SSE3\"] = \"$HAVE_SSE3\"" >>configure.lua
echo "#undef HAVE_SSE3" >config/have_sse3.h
echo "hdefs[\"HAVE_SSE3\"] = nil" >>configure.lua
fi;
else
echo "no (compilation failed)"
echo "no (compilation failed)" >> config.log
MK_RUN_STATUS="FAIL(\$?)"
HAVE_SSE3="no"
echo "HAVE_SSE3=$HAVE_SSE3" >>Makefile.config
echo "mdefs[\"HAVE_SSE3\"] = \"$HAVE_SSE3\"" >>configure.lua
echo "#undef HAVE_SSE3" >config/have_sse3.h
echo "hdefs[\"HAVE_SSE3\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_SSE3" > ${cache}/ctest-HAVE_SSE3
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_SSE3
echo $MK_RUN_STATUS > ${cache}/ctest-runstatus-HAVE_SSE3
fi
rm -f conftest.c $testdir/conftest
if [ "${HAVE_SSE3}" = "yes" ]; then
echo "#ifndef SSE3_CFLAGS" > config/sse3_cflags.h
echo "#define SSE3_CFLAGS \"$SSE3_CFLAGS\"" >> config/sse3_cflags.h
echo "#endif" >> config/sse3_cflags.h
echo "hdefs[\"SSE3_CFLAGS\"] = \"$SSE3_CFLAGS\"" >>configure.lua
else
echo "#undef SSE3_CFLAGS" >config/sse3_cflags.h
echo "hdefs[\"SSE3_CFLAGS\"] = nil" >>configure.lua
SSE3_CFLAGS=""
fi;
echo "SSE3_CFLAGS=$SSE3_CFLAGS" >>Makefile.config
echo "mdefs[\"SSE3_CFLAGS\"] = \"$SSE3_CFLAGS\"" >>configure.lua
if [ "${HAVE_SSE}" != "yes" ]
then
if [ "${with_sse}" = "yes" ]
then
echo "*"
echo "* --with-sse was requested, but SSE "
echo "* intrinsics not supported by compiler"
echo "*"
exit 1
else
echo "#undef HAVE_SSE" >config/have_sse.h
echo "hdefs[\"HAVE_SSE\"] = nil" >>configure.lua
echo "#undef INLINE_SSE" >config/inline_sse.h
echo "hdefs[\"INLINE_SSE\"] = nil" >>configure.lua
echo "#undef INLINE_SSE2" >config/inline_sse2.h
echo "hdefs[\"INLINE_SSE2\"] = nil" >>configure.lua
echo "#undef INLINE_SSE3" >config/inline_sse3.h
echo "hdefs[\"INLINE_SSE3\"] = nil" >>configure.lua
fi
else
if [ "${with_sse_inline}" = "yes" ]
then
INLINE_SSE="yes"
echo "#ifndef INLINE_SSE" > config/inline_sse.h
echo "#define INLINE_SSE \"$INLINE_SSE\"" >> config/inline_sse.h
echo "#endif" >> config/inline_sse.h
echo "hdefs[\"INLINE_SSE\"] = \"$INLINE_SSE\"" >>configure.lua
else
echo "#undef INLINE_SSE" >config/inline_sse.h
echo "hdefs[\"INLINE_SSE\"] = nil" >>configure.lua
fi
if [ "${HAVE_SSE2}" = "yes" ]
then
if [ "${with_sse2_inline}" = "yes" ]
then
INLINE_SSE2="yes"
echo "#ifndef INLINE_SSE2" > config/inline_sse2.h
echo "#define INLINE_SSE2 \"$INLINE_SSE2\"" >> config/inline_sse2.h
echo "#endif" >> config/inline_sse2.h
echo "hdefs[\"INLINE_SSE2\"] = \"$INLINE_SSE2\"" >>configure.lua
else
echo "#undef INLINE_SSE2" >config/inline_sse2.h
echo "hdefs[\"INLINE_SSE2\"] = nil" >>configure.lua
fi
else
echo "#undef INLINE_SSE2" >config/inline_sse2.h
echo "hdefs[\"INLINE_SSE2\"] = nil" >>configure.lua
fi
if [ "${HAVE_SSE3}" = "yes" ]
then
if [ "${with_sse3_inline}" = "yes" ]
then
INLINE_SSE3="yes"
echo "#ifndef INLINE_SSE3" > config/inline_sse3.h
echo "#define INLINE_SSE3 \"$INLINE_SSE3\"" >> config/inline_sse3.h
echo "#endif" >> config/inline_sse3.h
echo "hdefs[\"INLINE_SSE3\"] = \"$INLINE_SSE3\"" >>configure.lua
else
echo "#undef INLINE_SSE3" >config/inline_sse3.h
echo "hdefs[\"INLINE_SSE3\"] = nil" >>configure.lua
fi
else
echo "#undef INLINE_SSE3" >config/inline_sse3.h
echo "hdefs[\"INLINE_SSE3\"] = nil" >>configure.lua
fi
fi
else
echo "#undef HAVE_SSE" >config/have_sse.h
echo "hdefs[\"HAVE_SSE\"] = nil" >>configure.lua
echo "#undef HAVE_SSE2" >config/have_sse2.h
echo "hdefs[\"HAVE_SSE2\"] = nil" >>configure.lua
echo "#undef HAVE_SSE3" >config/have_sse3.h
echo "hdefs[\"HAVE_SSE3\"] = nil" >>configure.lua
echo "#undef INLINE_SSE" >config/inline_sse.h
echo "hdefs[\"INLINE_SSE\"] = nil" >>configure.lua
echo "#undef INLINE_SSE2" >config/inline_sse2.h
echo "hdefs[\"INLINE_SSE2\"] = nil" >>configure.lua
echo "#undef INLINE_SSE3" >config/inline_sse3.h
echo "hdefs[\"INLINE_SSE3\"] = nil" >>configure.lua
fi
if [ "${with_altivec}" = "yes" ]
then
$ECHO_N "checking for AltiVec (with )..."
$ECHO_N "checking for AltiVec (with )..." >> config.log
if [ "$SYSTEM" = "Darwin" ]; then
ALTIVEC_CFLAGS="-faltivec -maltivec"
ALTIVEC_CHECK_CFLAGS="-D_DARWIN_C_SOURCE"
echo "ALTIVEC_CHECK_CFLAGS=$ALTIVEC_CHECK_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CHECK_CFLAGS\"] = \"$ALTIVEC_CHECK_CFLAGS\"" >>configure.lua
else
ALTIVEC_CFLAGS="-mabi=altivec -maltivec"
ALTIVEC_CHECK_CFLAGS=""
echo "ALTIVEC_CHECK_CFLAGS=$ALTIVEC_CHECK_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CHECK_CFLAGS\"] = \"$ALTIVEC_CHECK_CFLAGS\"" >>configure.lua
fi;
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_ALTIVEC" ]; then
HAVE_ALTIVEC=`cat ${cache}/ctest-HAVE_ALTIVEC`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_ALTIVEC`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
#include
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_ALTIVEC="yes"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC" > config/have_altivec.h
echo "#define HAVE_ALTIVEC \"$HAVE_ALTIVEC\"" >> config/have_altivec.h
echo "#endif" >> config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_ALTIVEC="no"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_ALTIVEC" > ${cache}/ctest-HAVE_ALTIVEC
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_ALTIVEC
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_ALTIVEC}" = "yes" ]; then
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
HAVE_ALTIVEC_H=""
echo "#ifndef ALTIVEC_CFLAGS" > config/altivec_cflags.h
echo "#define ALTIVEC_CFLAGS \"$ALTIVEC_CFLAGS\"" >> config/altivec_cflags.h
echo "#endif" >> config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC_H" > config/have_altivec_h.h
echo "#define HAVE_ALTIVEC_H \"$HAVE_ALTIVEC_H\"" >> config/have_altivec_h.h
echo "#endif" >> config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = \"$HAVE_ALTIVEC_H\"" >>configure.lua
else
$ECHO_N "checking for AltiVec (without )..."
$ECHO_N "checking for AltiVec (without )..." >> config.log
MK_CACHED="No"
MK_COMPILE_STATUS="OK"
if [ "${cache}" != "" ]; then
if [ -e "${cache}/ctest-HAVE_ALTIVEC" ]; then
HAVE_ALTIVEC=`cat ${cache}/ctest-HAVE_ALTIVEC`
MK_COMPILE_STATUS=`cat ${cache}/ctest-status-HAVE_ALTIVEC`
MK_CACHED="Yes"
fi
fi
if [ "${MK_CACHED}" = "No" ]; then
cat << EOT > conftest.c
float a[4] = { 1,2,3,4 };
float b[4] = { 5,6,7,8 };
float c[4];
int
main(int argc, char *argv[])
{
vector float *va = (vector float *)a;
vector float *vb = (vector float *)b;
vector float *vc = (vector float *)c;
*vc = vec_add(*va, *vb);
return (0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${ALTIVEC_CFLAGS} -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_ALTIVEC="yes"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#ifndef HAVE_ALTIVEC" > config/have_altivec.h
echo "#define HAVE_ALTIVEC \"$HAVE_ALTIVEC\"" >> config/have_altivec.h
echo "#endif" >> config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_ALTIVEC="no"
echo "HAVE_ALTIVEC=$HAVE_ALTIVEC" >>Makefile.config
echo "mdefs[\"HAVE_ALTIVEC\"] = \"$HAVE_ALTIVEC\"" >>configure.lua
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
fi;
if [ "${cache}" != "" ]; then
echo "$HAVE_ALTIVEC" > ${cache}/ctest-HAVE_ALTIVEC
echo $MK_COMPILE_STATUS > ${cache}/ctest-status-HAVE_ALTIVEC
fi
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_ALTIVEC}" = "yes" ]; then
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
echo "#ifndef ALTIVEC_CFLAGS" > config/altivec_cflags.h
echo "#define ALTIVEC_CFLAGS \"$ALTIVEC_CFLAGS\"" >> config/altivec_cflags.h
echo "#endif" >> config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
else
echo "#undef ALTIVEC_CFLAGS" >config/altivec_cflags.h
echo "hdefs[\"ALTIVEC_CFLAGS\"] = nil" >>configure.lua
ALTIVEC_CFLAGS=""
echo "ALTIVEC_CFLAGS=$ALTIVEC_CFLAGS" >>Makefile.config
echo "mdefs[\"ALTIVEC_CFLAGS\"] = \"$ALTIVEC_CFLAGS\"" >>configure.lua
fi;
echo "#undef HAVE_ALTIVEC_H" >config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = nil" >>configure.lua
fi;
if [ "${HAVE_ALTIVEC}" != "yes" ]
then
if [ "${with_altivec}" = "yes" ]
then
echo "*"
echo "* --with-altivec was requested, but "
echo "* AltiVec is not supported by compiler"
echo "*"
exit 1
else
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
echo "#undef HAVE_ALTIVEC_H" >config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = nil" >>configure.lua
echo "#undef INLINE_ALTIVEC" >config/inline_altivec.h
echo "hdefs[\"INLINE_ALTIVEC\"] = nil" >>configure.lua
fi
else
if [ "${with_altivec_inline}" = "yes" ]
then
INLINE_ALTIVEC="yes"
echo "#ifndef INLINE_ALTIVEC" > config/inline_altivec.h
echo "#define INLINE_ALTIVEC \"$INLINE_ALTIVEC\"" >> config/inline_altivec.h
echo "#endif" >> config/inline_altivec.h
echo "hdefs[\"INLINE_ALTIVEC\"] = \"$INLINE_ALTIVEC\"" >>configure.lua
else
echo "#undef INLINE_ALTIVEC" >config/inline_altivec.h
echo "hdefs[\"INLINE_ALTIVEC\"] = nil" >>configure.lua
fi
fi
else
echo "#undef HAVE_ALTIVEC" >config/have_altivec.h
echo "hdefs[\"HAVE_ALTIVEC\"] = nil" >>configure.lua
echo "#undef HAVE_ALTIVEC_H" >config/have_altivec_h.h
echo "hdefs[\"HAVE_ALTIVEC_H\"] = nil" >>configure.lua
echo "#undef INLINE_ALTIVEC" >config/inline_altivec.h
echo "hdefs[\"INLINE_ALTIVEC\"] = nil" >>configure.lua
fi
if [ "${with_single_fp}" = "yes" ]
then
if [ "${HAVE_MATH_C99}" != "yes" ]
then
echo "*"
echo "* --with-single-fp was requested, but your compiler does"
echo "* not support the C99 math routines (sinf(), etc)."
echo "*"
exit 1
fi
SINGLE_PRECISION="yes"
echo "#ifndef SINGLE_PRECISION" > config/single_precision.h
echo "#define SINGLE_PRECISION \"$SINGLE_PRECISION\"" >> config/single_precision.h
echo "#endif" >> config/single_precision.h
echo "hdefs[\"SINGLE_PRECISION\"] = \"$SINGLE_PRECISION\"" >>configure.lua
else
echo "#undef SINGLE_PRECISION" >config/single_precision.h
echo "hdefs[\"SINGLE_PRECISION\"] = nil" >>configure.lua
fi
if [ "${with_double_fp}" != "no" ]
then
DOUBLE_PRECISION="yes"
echo "#ifndef DOUBLE_PRECISION" > config/double_precision.h
echo "#define DOUBLE_PRECISION \"$DOUBLE_PRECISION\"" >> config/double_precision.h
echo "#endif" >> config/double_precision.h
echo "hdefs[\"DOUBLE_PRECISION\"] = \"$DOUBLE_PRECISION\"" >>configure.lua
else
echo "#undef DOUBLE_PRECISION" >config/double_precision.h
echo "hdefs[\"DOUBLE_PRECISION\"] = nil" >>configure.lua
fi
if [ "${with_quad_fp}" = "yes" ]
then
if [ "${HAVE_LONG_DOUBLE}" != "yes" ]
then
echo "*"
echo "* --with-quad-fp was requested, but your compiler"
echo "* does not support the C99 long double type."
echo "*"
exit 1
fi
if [ "${HAVE_MATH_C99}" != "yes" ]
then
echo "*"
echo "* --with-quad-fp was requested, but the C99 math"
echo "* routines (sinl(), etc.) are not available."
echo "*"
exit 1
fi
QUAD_PRECISION="yes"
echo "#ifndef QUAD_PRECISION" > config/quad_precision.h
echo "#define QUAD_PRECISION \"$QUAD_PRECISION\"" >> config/quad_precision.h
echo "#endif" >> config/quad_precision.h
echo "hdefs[\"QUAD_PRECISION\"] = \"$QUAD_PRECISION\"" >>configure.lua
else
echo "#undef QUAD_PRECISION" >config/quad_precision.h
echo "hdefs[\"QUAD_PRECISION\"] = nil" >>configure.lua
fi
if [ "${enable_vg}" != "no" -a "${enable_gui}" != "no" ]
then
ENABLE_VG="yes"
echo "#ifndef ENABLE_VG" > config/enable_vg.h
echo "#define ENABLE_VG \"$ENABLE_VG\"" >> config/enable_vg.h
echo "#endif" >> config/enable_vg.h
echo "hdefs[\"ENABLE_VG\"] = \"$ENABLE_VG\"" >>configure.lua
SUBDIR_VG="vg agar-vg-config"
echo "SUBDIR_VG=$SUBDIR_VG" >>Makefile.config
echo "mdefs[\"SUBDIR_VG\"] = \"$SUBDIR_VG\"" >>configure.lua
else
echo "#undef ENABLE_VG" >config/enable_vg.h
echo "hdefs[\"ENABLE_VG\"] = nil" >>configure.lua
SUBDIR_VG=""""
echo "SUBDIR_VG=$SUBDIR_VG" >>Makefile.config
echo "mdefs[\"SUBDIR_VG\"] = \"$SUBDIR_VG\"" >>configure.lua
fi
if [ "${enable_rg}" != "no" -a "${enable_gui}" != "no" ]
then
ENABLE_RG="yes"
echo "#ifndef ENABLE_RG" > config/enable_rg.h
echo "#define ENABLE_RG \"$ENABLE_RG\"" >> config/enable_rg.h
echo "#endif" >> config/enable_rg.h
echo "hdefs[\"ENABLE_RG\"] = \"$ENABLE_RG\"" >>configure.lua
SUBDIR_RG="rg agar-rg-config"
echo "SUBDIR_RG=$SUBDIR_RG" >>Makefile.config
echo "mdefs[\"SUBDIR_RG\"] = \"$SUBDIR_RG\"" >>configure.lua
else
echo "#undef ENABLE_RG" >config/enable_rg.h
echo "hdefs[\"ENABLE_RG\"] = nil" >>configure.lua
SUBDIR_RG=""""
echo "SUBDIR_RG=$SUBDIR_RG" >>Makefile.config
echo "mdefs[\"SUBDIR_RG\"] = \"$SUBDIR_RG\"" >>configure.lua
fi
if [ "${enable_dev}" != "no" -a "${enable_gui}" != "no" ]
then
ENABLE_DEV="yes"
echo "#ifndef ENABLE_DEV" > config/enable_dev.h
echo "#define ENABLE_DEV \"$ENABLE_DEV\"" >> config/enable_dev.h
echo "#endif" >> config/enable_dev.h
echo "hdefs[\"ENABLE_DEV\"] = \"$ENABLE_DEV\"" >>configure.lua
SUBDIR_DEV="dev agar-dev-config"
echo "SUBDIR_DEV=$SUBDIR_DEV" >>Makefile.config
echo "mdefs[\"SUBDIR_DEV\"] = \"$SUBDIR_DEV\"" >>configure.lua
else
echo "#undef ENABLE_DEV" >config/enable_dev.h
echo "hdefs[\"ENABLE_DEV\"] = nil" >>configure.lua
SUBDIR_DEV=""""
echo "SUBDIR_DEV=$SUBDIR_DEV" >>Makefile.config
echo "mdefs[\"SUBDIR_DEV\"] = \"$SUBDIR_DEV\"" >>configure.lua
fi
if [ ! -e "include" ]; then mkdir "include"; fi
if [ "${includes}" = "link" ]; then
echo "* Not preprocessing includes"
if [ ! -e "include/agar" ]; then
if [ "${SRCDIR}" != "${BLDDIR}" ]; then
ln -s "$SRC" "include/agar"
else
ln -s "$BLD" "include/agar"
fi
fi
else
if [ ! -e "include/agar" ]; then
if [ "${SRCDIR}" != "${BLDDIR}" ]; then
$ECHO_N "* Preprocessing includes (from ${SRCDIR})..."
(cd ${SRCDIR} && perl mk/gen-includes.pl "${BLDDIR}/include/agar" 1>>${BLDDIR}/config.log 2>&1)
cp -fR config include/agar
else
$ECHO_N "* Preprocessing includes (in ${BLDDIR})...";
perl mk/gen-includes.pl "include/agar" 1>>config.log 2>&1
fi
if [ $? != 0 ]; then
echo "perl mk/gen-includes.pl failed"
exit 1
fi
echo "done"
else
echo "* Using existing includes"
fi
fi
CFLAGS="$CFLAGS -I$BLD/include"
CXXFLAGS="$CXXFLAGS -I$BLD/include"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
CFLAGS="$CFLAGS -I$BLD/include/agar"
CXXFLAGS="$CXXFLAGS -I$BLD/include/agar"
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
if [ -e "$BLD/include" ]
then
cp -fR config "$BLD/include/agar"
fi
echo "*"
echo "* Configuration successful."
echo "* Use \"make depend\" if you plan on editing the source code."
echo "* Use \"make\" and \"make install\" to build and install Agar."
echo "*"