#!/bin/sh
#
# Do not edit!
# This file was generated from configure.in by BSDBuild 3.2.
#
# To regenerate this file, get the latest BSDBuild release from
# http://bsdbuild.hypertriton.com/, and use the command:
#
# $ cat configure.in | mkconfigure > configure
#
echo 'BSDBuild 3.2 '
echo '#!/bin/sh' > config.status
echo '# Generated by BSDBuild 3.2.' >>config.status
echo 'Generated by BSDBuild 3.2.' >config.log
PACKAGE='Untitled'
VERSION=
RELEASE=
PROG_PREFIX=
PROG_SUFFIX=
PROG_TRANSFORM=s,x,x,
case "test" in
*)
bb_sed_test=`echo foo-.bar |sed 's/[-.]/_/g'`
if [ "$bb_sed_test" != "foo__bar" ]; then
echo "sed or $SHELL is not working correctly."
exit 1
fi
esac
bb_cr_letters='abcdefghijklmnopqrstuvwxyz'
bb_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
bb_cr_Letters=$bb_cr_letters$bb_cr_LETTERS
bb_cr_digits='0123456789'
bb_cr_alnum=$bb_cr_Letters$bb_cr_digits
optarg=
for arg
do
case "$arg" in
*=*)
optarg=`expr "X$arg" : '[^=]*=\(.*\)'`
;;
*)
optarg=
;;
esac
case "$arg" in
--build=*)
build_arg=$optarg
;;
--host=*)
host_arg=$optarg
;;
--target=*)
target=$optarg
;;
--emul-os=*)
PROJ_TARGET=$optarg
;;
--byte-order=*)
byte_order=$optarg
;;
--prefix=*)
prefix=$optarg
;;
--exec-prefix=*)
exec_prefix=$optarg
;;
--sysconfdir=*)
sysconfdir=$optarg
;;
--bindir=*)
bindir=$optarg
;;
--libdir=*)
libdir=$optarg
;;
--moduledir=*)
moduledir=$optarg
;;
--libexecdir=*)
libexecdir=$optarg
;;
--datadir=*)
datadir=$optarg
;;
--statedir=* | --localstatedir=*)
statedir=$optarg
;;
--localedir=*)
localedir=$optarg
;;
--mandir=*)
mandir=$optarg
;;
--infodir=* | --datarootdir=* | --docdir=* | --htmldir=* | --dvidir=* | --pdfdir=* | --psdir=* | --sharedstatedir=* | --sbindir=*)
;;
--enable-*)
option=`expr "x$arg" : 'x-*enable-\([^=]*\)'`
expr "x$option" : ".*[^-._$bb_cr_alnum]" >/dev/null &&
{ echo "Invalid option name: $option" >&2
{ (exit 1); exit 1; }; }
option=`echo $option | sed 's/[-.]/_/g'`
case "$arg" in
*=*)
eval "enable_${option}='$optarg'"
eval "prefix_${option}='$optarg'"
;;
*)
eval "enable_${option}=yes"
;;
esac
;;
--disable-*)
option=`expr "x$arg" : 'x-*disable-\([^=]*\)'`
expr "x$option" : ".*[^-._$bb_cr_alnum]" >/dev/null &&
{ echo "Invalid option name: $option" >&2
{ (exit 1); exit 1; }; }
option=`echo $option | sed 's/[-.]/_/g'`
eval "enable_${option}=no"
;;
--with-*)
option=`expr "x$arg" : 'x-*with-\([^=]*\)'`
expr "x$option" : ".*[^-._$bb_cr_alnum]" >/dev/null &&
{ echo "Invalid option name: $option" >&2
{ (exit 1); exit 1; }; }
option=`echo $option | sed 's/[-.]/_/g'`
case "$arg" in
*=*)
eval "with_${option}='$optarg'"
eval "prefix_${option}='$optarg'"
;;
*)
eval "with_${option}=yes"
;;
esac
;;
--without-*)
option=`expr "x$arg" : 'x-*without-\([^=]*\)'`
expr "x$option" : ".*[^-._$bb_cr_alnum]" >/dev/null &&
{ echo "Invalid option name: $option" >&2
{ (exit 1); exit 1; }; }
option=`echo $option | sed 's/-/_/g'`
eval "with_${option}=no"
;;
--x-includes=*)
with_x_includes=$optarg
;;
--x-libraries=*)
with_x_libraries=$optarg
;;
--program-prefix=*)
PROG_PREFIX=$optarg
;;
--program-suffix=*)
PROG_SUFFIX=$optarg
;;
--program-transform-name=*)
PROG_TRANSFORM=$optarg
;;
--help)
show_help=yes
;;
--version)
show_version=yes
;;
--srcdir=*)
srcdir=$optarg
;;
--testdir=*)
testdir=$optarg
;;
--cache=*)
cache=$optarg
;;
--includes=*)
includes=$optarg
;;
--keep-conftest)
keep_conftest=yes
;;
--cache-file=*)
;;
--config-cache | -C)
;;
*)
echo "Invalid argument: $arg, see ./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 [ "${PATH_SEPARATOR+set}" != set ]; then
echo '#!/bin/sh' > conftest$$.sh
echo 'exit 0' >> conftest$$.sh
chmod +x conftest$$.sh
if (PATH="/nonexistent;."; conftest$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conftest$$.sh
fi
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
PERL=''
for path in $PATH; do
if [ -x "${path}/perl" ]; then
PERL="${path}/perl"
break
elif [ -e "${path}/perl.exe" ]; then
PERL="${path}/perl.exe"
break
fi
done
PKGCONFIG=''
for path in $PATH; do
if [ -x "${path}/pkg-config" ]; then
PKGCONFIG="${path}/pkg-config"
break
elif [ -e "${path}/pkg-config.exe" ]; then
PKGCONFIG="${path}/pkg-config.exe"
break
fi
done
IFS=$bb_save_IFS
if [ "${prefix}" != '' ]; then
PREFIX="$prefix"
else
PREFIX='/usr/local'
fi
if [ "${exec_prefix}" != '' ]; then
EXEC_PREFIX="$exec_prefix"
else
EXEC_PREFIX="${PREFIX}"
fi
if [ "${srcdir}" != '' ]; then
if [ "${PERL}" = '' ]; then
echo '*'
echo '* Separate build --srcdir requires perl, but there is'
echo '* no perl interpreter to be found in your PATH.'
echo '*'
exit 1
fi
SRC=${srcdir}
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
case "${includes}" in
yes|no)
;;
link)
if [ "${with_proj_generation}" ]; then
echo 'Cannot use --includes=link with --with-proj-generation'
exit 1
fi
;;
*)
echo 'Usage: --includes (yes|no|link)'
exit 1
;;
esac
if [ "${srcdir}" = '' ]; then
cat << EOT > configure.dep.pl
#!/usr/bin/env perl
# Public domain.
# Scan Makefiles for "include .depend" and generate empty ".depend" files,
# such that make can be run prior to an initial "make depend".
#
my %V = ();
sub MakefileIncludesDepend (\$\$)
{
my \$path = shift;
my \$cwd = shift;
if (!open(MF, \$path)) {
return (0);
}
my @lines = ();
foreach \$_ () {
chop;
if (/^(.+)\\\\\$/) { # Expansion
\$line .= \$1;
} else { # New line
if (\$line) {
push @lines, \$line . \$_;
\$line = '';
} else {
push @lines, \$_;
}
}
}
foreach \$_ (@lines) {
if (/^\\s*#/) { next; }
if (/^\\t/) { next; }
s/\\\$\\{(\\w+)\\}/\$V{\$1}/g;
if (/^\\s*(\\w+)\\s*=\\s*"(.+)"\$/ ||
/^\\s*(\\w+)\\s*=\\s*(.+)\$/) {
\$V{\$1} = \$2;
} elsif (/^\\s*(\\w+)\\s*\\+=\\s*"(.+)"\$/ ||
/^\\s*(\\w+)\\s*\\+=\\s*(.+)\$/) {
if (exists(\$V{\$1}) && \$V{\$1} ne '') {
\$V{\$1} .= ' '.\$2;
} else {
\$V{\$1} = \$2;
}
}
if (/^\\s*include\\s+(.+)\$/) {
if (\$1 eq '.depend' ||
MakefileIncludesDepend(\$cwd.'/'.\$1, \$cwd)) {
return (1);
}
}
}
close(MF);
return (0);
}
sub Scan (\$)
{
my \$dir = shift;
unless (opendir(CWD, \$dir)) {
print STDERR "\$dir: opendir: \$!; ignoring\\n";
return;
}
%V = ();
if (-e \$dir.'/Makefile' &&
MakefileIncludesDepend("\$dir/Makefile", \$dir)) {
if (open(OUT, ">\$dir/.depend")) {
close(OUT);
} else {
print STDERR "\$dir/.depend: \$!; ignoring\\n";
}
}
foreach my \$ent (readdir(CWD)) {
my \$file = \$dir.'/'.\$ent;
if (\$ent =~ /^\\./) {
next;
}
if (-d \$file) {
Scan(\$file);
next;
}
}
closedir(CWD);
}
if (@ARGV < 1) {
print STDERR "Usage: gen-dotdepend.pl [directory]\\n";
exit(1);
}
Scan(\$ARGV[0]);
EOT
if [ "${PERL}" != '' ]; then
${PERL} configure.dep.pl .
rm -f configure.dep.pl
else
echo '*'
echo '* Warning: No perl was found. Perl is required for automatic'
echo '* generation of .depend files. You may need to create empty'
echo '* .depend files where it is required.'
echo '*'
fi
fi
bb_incdir="$BLD/include/freesg/config"
if [ "${show_help}" = "yes" ]; then
echo ''
echo 'Usage: ./configure [options]'
echo ''
echo 'Standard build options:'
echo ' --bindir=DIR Executables for common users [PREFIX/bin]'
echo ' --build=STRING Host environment for build [auto-detect]'
echo ' --byte-order=STRING Byte order for build [LE|BE] [auto-detect]'
echo ' --datadir=DIR|NONE Data files for program use [PREFIX/share]'
echo ' --enable-nls Multi-language support [no]'
echo ' --exec-prefix=DIR Machine-dependent installation base [PREFIX]'
echo ' --host=STRING Cross-compile for target environment [BUILD]'
echo ' --includes=STRING Preprocess C headers [yes|no|link] [yes]'
echo ' --keep-conftest Preserve output files from last test'
echo ' --libdir=DIR System libraries [PREFIX/lib]'
echo ' --libexecdir=DIR Executables for program use [PREFIX/libexec]'
echo ' --localedir=DIR Multi-language support locales [DATADIR/locale]'
echo ' --mandir=DIR Manual page documentation [PREFIX/man]'
echo ' --moduledir=DIR|NONE Dynamically loaded modules [PREFIX/lib]'
echo ' --prefix=DIR Installation base [/usr/local]'
echo ' --program-prefix=STRING Prepend string to program name []'
echo ' --program-suffix=STRING Append string to program name []'
echo ' --program-transform-name=S Transform program name by expression [s,x,x,]'
echo ' --srcdir=DIR Source directory for concurrent build [.]'
echo ' --statedir=DIR|NONE Modifiable single-machine data [PREFIX/var]'
echo ' --sysconfdir=DIR|NONE System configuration files [PREFIX/etc]'
echo ' --testdir=DIR Execute all tests in this directory [.]'
echo ' --with-bundles Generate application/library bundles [yes]'
echo ' --with-catman Install cat files for manual pages [auto-detect]'
echo ' --with-ctags Generate ctags tag files [no]'
echo ' --with-docs Generate printable documentation [no]'
echo ' --with-gettext Use gettext for multi-language [auto-detect]'
echo ' --with-libtool=STRING Use GNU libtool [path or "bundled"]'
echo ' --with-manlinks Add manual entries for every function [no]'
echo ' --with-manpages Generate Unix manual pages [yes]'
echo ''
echo 'Global FreeSG options:'
echo ' --enable-debug General debugging [no]'
echo ' --enable-debug-gl Expensive OpenGL debugging [no]'
echo ' --enable- Build libraries (sg|sk|rg|map|pe) [all]'
echo ' --enable-edition Enable edition features [default: yes]'
echo ' --enable-threads Build thread-safe library [default: yes]'
echo ' --enable-warnings Suggested compiler warnings [default: no]'
echo ' --with-agar[=PREFIX] Specify Agar location [check]'
echo ' --with-opengl[=PREFIX] Specify OpenGL location [check]'
echo ''
echo 'Options specific to SG library:'
echo ' --with-cg[=PREFIX] Cg shader support [default: check]'
echo ' --with-glu[=PREFIX] OpenGL Utility Library (GLU) [check]'
echo ' --with-ode[=PREFIX] ODE physics interface [default: check]'
echo ''
echo 'Some influential environment variables:'
echo ' CC C compiler command'
echo ' CFLAGS C compiler flags'
echo ' CPP C preprocessor'
echo ' CPPFLAGS C preprocessor flags'
echo ' LDFLAGS C linker flags'
echo ' LIBS Libraries to link against'
exit 1
fi
if [ "${show_version}" = "yes" ]; then
echo 'BSDBuild 3.2'
exit 0
fi
if [ "${build_arg}" != '' ]; then
build="${build_arg}"
else
if [ "${srcdir}" != '' ]; then
build_guessed=`sh ${srcdir}/mk/config.guess`
else
build_guessed=`sh mk/config.guess`
fi
if [ $? != 0 ]; then
echo 'mk/config.guess failed, please specify --build'
exit 1
fi
build="${build_guessed}"
fi
if [ "${host_arg}" != '' ]; then
host="${host_arg}"
else
host="${build}"
fi
if [ "${host}" != "${build}" ]; then
CROSS_COMPILING='yes'
else
CROSS_COMPILING='no'
fi
if [ "${with_bundles}" != "no" ]; then
case "${host}" in
arm-apple-darwin*)
PROG_BUNDLE='iOS'
;;
*-*-darwin*)
PROG_BUNDLE='OSX'
;;
esac
fi
host_machine=`echo ${host} | cut -d- -f 1`
if [ -e "Makefile.config" ]; then
echo '* Overwriting existing Makefile.config'
fi
echo '# Generated by BSDBuild 3.2 configure script.' >Makefile.config
echo '' >> Makefile.config
echo "BUILD=${build}" >> Makefile.config
echo "HOST=${host}" >> Makefile.config
echo "CROSS_COMPILING=${CROSS_COMPILING}" >> Makefile.config
echo "SRCDIR=${SRC}" >> Makefile.config
echo "BLDDIR=${BLD}" >> Makefile.config
$ECHO_N './configure' >>config.log
$ECHO_N './configure' >>config.status
for arg
do
$ECHO_N " $arg" >>config.log
$ECHO_N " $arg" >>config.status
done
echo '' >>config.log
echo '' >>config.status
if [ -e "$BLD/include/freesg/config" ]; then
echo '* Overwriting $BLD/include/freesg/config directory'
rm -fR "$BLD/include/freesg/config"
fi
mkdir -p "$BLD/include/freesg/config"
if [ $? != 0 ]; then
echo 'Could not create $BLD/include/freesg/config directory.'
exit 1
fi
cat << EOT > conftest.1
.\" COMMENT
.Dd
.Dd NOVEMBER 23, 2009
.Dt TEST 1
.Os
.ds vT Test
.ds oS Test 1.0
.Sh NAME
.Nm test
.Nd Test document
.Sh DESCRIPTION
EOT
HAVE_MANDOC='no'
MANDOC=''
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/mandoc" ]; then
cat conftest.1 | ${path}/mandoc -Tascii >/dev/null
if [ "$?" = '0' ]; then
HAVE_MANDOC='yes'
MANDOC="${path}/mandoc"
break;
fi
elif [ -e "${path}/mandoc.exe" ]; then
cat conftest.1 | ${path}/mandoc.exe -Tascii >/dev/null
if [ "$?" = '0' ]; then
HAVE_MANDOC='yes'
MANDOC="${path}/mandoc.exe"
break;
fi
elif [ -x "${path}/nroff" ]; then
cat conftest.1 | ${path}/nroff -Tmandoc >/dev/null
if [ "$?" = '0' ]; then
HAVE_MANDOC='yes'
MANDOC="${path}/nroff -Tmandoc"
break;
fi
elif [ -e "${path}/nroff.exe" ]; then
cat conftest.1 | ${path}/nroff.exe -Tmandoc >/dev/null
if [ "$?" = '0' ]; then
HAVE_MANDOC='yes'
MANDOC="${path}/nroff.exe -Tmandoc"
break;
fi
fi
done
IFS=$bb_save_IFS
rm -f conftest.1
if [ "${HAVE_MANDOC}" = 'no' ]; then
if [ "${with_manpages}" = 'yes' ]; then
echo '*'
echo '* --with-manpages was requested, but either the'
echo '* nroff/mandoc utility or the mdoc macro'
echo '* package were 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
echo "MANDOC=${MANDOC}" >> Makefile.config
if [ "${with_catman}" = "no" ]; then
echo 'NOCATMAN=yes' >> Makefile.config
else
if [ "${with_catman}" = "yes" ]; then
echo 'NOCATMAN=no' >> Makefile.config
else
case "${host}" in
*-*-freebsd*)
echo 'NOCATMAN=yes' >> Makefile.config
;;
*)
echo 'NOCATMAN=no' >> Makefile.config
;;
esac
fi
fi
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
if [ "${enable_nls}" = "yes" ]; then
ENABLE_NLS="yes"
bb_o=$bb_incdir/enable_nls.h
echo '#ifndef ENABLE_NLS' >$bb_o
echo "#define ENABLE_NLS \"$ENABLE_NLS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
msgfmt=''
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/msgfmt" ]; then
msgfmt=${path}/msgfmt
break
elif [ -e "${path}/msgfmt.exe" ]; then
msgfmt=${path}/msgfmt.exe
break
fi
done
IFS=$bb_save_IFS
if [ "${msgfmt}" != '' ]; then
HAVE_GETTEXT='yes'
else
HAVE_GETTEXT='no'
fi
bb_o=$bb_incdir/enable_nls.h
echo '#ifndef ENABLE_NLS' >$bb_o
echo "#define ENABLE_NLS \"$ENABLE_NLS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
else
ENABLE_NLS="no"
HAVE_GETTEXT="no"
echo '#undef ENABLE_NLS' >$bb_incdir/enable_nls.h
echo 'hdefs["ENABLE_NLS"] = nil' >>configure.lua
fi
CTAGS=''
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
if [ "${with_ctags}" = 'yes' ]; then
for path in $PATH; do
if [ -x "${path}/ectags" ]; then
CTAGS="${path}/ectags"
break
elif [ -e "${path}/ectags.exe" ]; then
CTAGS="${path}/ectags.exe"
break
fi
done
if [ "${CTAGS}" = '' ]; then
for path in $PATH; do
if [ -x "${path}/ctags" ]; then
CTAGS="${path}/ctags"
break
elif [ -e "${path}/ctags.exe" ]; then
CTAGS="${path}/ctags.exe"
break
fi
done
fi
fi
IFS=$bb_save_IFS
echo "CTAGS=${CTAGS}" >> Makefile.config
if [ "${with_libtool}" = "yes" ]; then
if [ "${prefix_libtool}" != '' -a "${prefix_libtool}" != 'bundled' ]; then
LIBTOOL_BUNDLED='no'
LIBTOOL="${prefix_libtool}"
else
LIBTOOL_BUNDLED='yes'
LIBTOOL=\${TOP}/mk/libtool/libtool
fi
echo "USE_LIBTOOL=Yes" >> Makefile.config
echo "LIBTOOL_BUNDLED=${LIBTOOL_BUNDLED}" >> Makefile.config
echo "LIBTOOL=${LIBTOOL}" >> Makefile.config
else
echo "USE_LIBTOOL=No" >> Makefile.config
fi
echo "PREFIX?=${PREFIX}" >> Makefile.config
echo "LDFLAGS?=${LDFLAGS}" >> Makefile.config
if [ "${PKGCONFIG}" != "" ]; then
case "${host}" in
*-*-freebsd* | *-*-dragonfly*)
PKGCONFIG_LIBDIR="\${PREFIX}/libdata/pkgconfig"
;;
*)
PKGCONFIG_LIBDIR="\${PREFIX}/lib/pkgconfig"
;;
esac
fi
bb_o=$bb_incdir/prefix.h
echo '#ifndef PREFIX' >$bb_o
echo "#define PREFIX \"$PREFIX\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"PREFIX\"] = \"$PREFIX\"" >>configure.lua
if [ "${bindir}" != '' ]; then
BINDIR="${bindir}"
BINDIR_SPECIFIED='yes'
else
BINDIR="${PREFIX}/bin"
fi
bb_o=$bb_incdir/bindir.h
echo '#ifndef BINDIR' >$bb_o
echo "#define BINDIR \"$BINDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"BINDIR\"] = \"$BINDIR\"" >>configure.lua
if [ "${libdir}" != '' ]; then
LIBDIR="${libdir}"
LIBDIR_SPECIFIED='yes'
else
LIBDIR="${PREFIX}/lib"
fi
bb_o=$bb_incdir/libdir.h
echo '#ifndef LIBDIR' >$bb_o
echo "#define LIBDIR \"$LIBDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"LIBDIR\"] = \"$LIBDIR\"" >>configure.lua
if [ "${moduledir}" != '' ]; then
MODULEDIR="${moduledir}"
MODULEDIR_SPECIFIED='yes'
else
MODULEDIR="${PREFIX}/lib"
fi
bb_o=$bb_incdir/moduledir.h
echo '#ifndef MODULEDIR' >$bb_o
echo "#define MODULEDIR \"$MODULEDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"MODULEDIR\"] = \"$MODULEDIR\"" >>configure.lua
if [ "${libexecdir}" != '' ]; then
LIBEXECDIR="${libexecdir}"
LIBEXECDIR_SPECIFIED='yes'
else
LIBEXECDIR="${PREFIX}/libexec"
fi
bb_o=$bb_incdir/libexecdir.h
echo '#ifndef LIBEXECDIR' >$bb_o
echo "#define LIBEXECDIR \"$LIBEXECDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"LIBEXECDIR\"] = \"$LIBEXECDIR\"" >>configure.lua
if [ "${datadir}" != '' ]; then
DATADIR="${datadir}"
DATADIR_SPECIFIED='yes'
else
DATADIR="${PREFIX}/share"
fi
bb_o=$bb_incdir/datadir.h
echo '#ifndef DATADIR' >$bb_o
echo "#define DATADIR \"$DATADIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
if [ "${statedir}" != '' ]; then
STATEDIR="${statedir}"
STATEDIR_SPECIFIED='yes'
else
STATEDIR="${PREFIX}/var"
fi
bb_o=$bb_incdir/statedir.h
echo '#ifndef STATEDIR' >$bb_o
echo "#define STATEDIR \"$STATEDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"STATEDIR\"] = \"$STATEDIR\"" >>configure.lua
if [ "${sysconfdir}" != '' ]; then
SYSCONFDIR="${sysconfdir}"
SYSCONFDIR_SPECIFIED='yes'
else
SYSCONFDIR="${PREFIX}/etc"
fi
bb_o=$bb_incdir/sysconfdir.h
echo '#ifndef SYSCONFDIR' >$bb_o
echo "#define SYSCONFDIR \"$SYSCONFDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"SYSCONFDIR\"] = \"$SYSCONFDIR\"" >>configure.lua
if [ "${localedir}" != '' ]; then
LOCALEDIR="${localedir}"
LOCALEDIR_SPECIFIED='yes'
else
LOCALEDIR="${DATADIR}/locale"
fi
bb_o=$bb_incdir/localedir.h
echo '#ifndef LOCALEDIR' >$bb_o
echo "#define LOCALEDIR \"$LOCALEDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
if [ "${mandir}" != '' ]; then
MANDIR="${mandir}"
MANDIR_SPECIFIED='yes'
else
MANDIR="${PREFIX}/man"
fi
bb_o=$bb_incdir/mandir.h
echo '#ifndef MANDIR' >$bb_o
echo "#define MANDIR \"$MANDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"MANDIR\"] = \"$MANDIR\"" >>configure.lua
PACKAGE="FreeSG"
bb_o=$bb_incdir/package.h
echo '#ifndef PACKAGE' >$bb_o
echo "#define PACKAGE \"$PACKAGE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"PACKAGE\"] = \"$PACKAGE\"" >>configure.lua
VERSION="1.0.0"
bb_o=$bb_incdir/version.h
echo '#ifndef VERSION' >$bb_o
echo "#define VERSION \"$VERSION\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
RELEASE="Odyssey of Freedom"
bb_o=$bb_incdir/release.h
echo '#ifndef RELEASE' >$bb_o
echo "#define RELEASE \"$RELEASE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
if [ "${DATADIR_SPECIFIED}" != 'yes' ]; then
DATADIR="${PREFIX}/share/freesg"
bb_o=$bb_incdir/datadir.h
echo '#ifndef DATADIR' >$bb_o
echo "#define DATADIR \"$DATADIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
fi
if [ "${INCLDIR_SPECIFIED}" != 'yes' ]; then
INCLDIR="${PREFIX}/include/freesg"
bb_o=$bb_incdir/incldir.h
echo '#ifndef INCLDIR' >$bb_o
echo "#define INCLDIR \"$INCLDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
fi
if [ "${LOCALEDIR_SPECIFIED}" != 'yes' ]; then
LOCALEDIR="${DATADIR}/locale"
bb_o=$bb_incdir/localedir.h
echo '#ifndef LOCALEDIR' >$bb_o
echo "#define LOCALEDIR \"$LOCALEDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
fi
if [ "${DATADIR}" = "NONE" ]
then
LOCALEDIR="NONE"
bb_o=$bb_incdir/localedir.h
echo '#ifndef LOCALEDIR' >$bb_o
echo "#define LOCALEDIR \"$LOCALEDIR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
LOCALEDIR="NONE"
fi
$ECHO_N 'checking for a C compiler...'
$ECHO_N 'checking for a C compiler...' >>config.log
# BEGIN cc
if [ "$CROSS_COMPILING" = "yes" ]; then
CROSSPFX="${host}-"
else
CROSSPFX=""
fi
HAVE_CC65="no"
if [ "$CC" = "" ]; then
case "${host}" in
apple2 | apple2enh | atari | atmos | c16 | c64 | c128 | cbm510 | cbm610 | geos | lunix | lynx | nes | pet | plus4 | supervision | vic20)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/cc65" ]; then
if ${i}/cc65 -V |grep ^cc65; then
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
fi
elif [ -x "${i}/cc65.exe" ]; then
if ${i}/cc65.exe -V |grep ^cc65; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
fi
fi
done
IFS=$bb_save_IFS
;;
*)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/${CROSSPFX}clang" ]; then
CC="${i}/${CROSSPFX}clang"
break
elif [ -x "${i}/${CROSSPFX}clang70" ]; then
CC="${i}/${CROSSPFX}clang70"
break
elif [ -x "${i}/${CROSSPFX}clang60" ]; then
CC="${i}/${CROSSPFX}clang60"
break
elif [ -x "${i}/${CROSSPFX}cc" ]; then
CC="${i}/${CROSSPFX}cc"
break
elif [ -x "${i}/${CROSSPFX}gcc" ]; then
CC="${i}/${CROSSPFX}gcc"
break
elif [ -x "${i}/${CROSSPFX}gcc-6" ]; then
CC="${i}/${CROSSPFX}gcc-6"
break
elif [ -x "${i}/${CROSSPFX}gcc7" ]; then
CC="${i}/${CROSSPFX}gcc7"
break
elif [ -x "${i}/${CROSSPFX}gcc8" ]; then
CC="${i}/${CROSSPFX}gcc8"
break
elif [ -x "${i}/${CROSSPFX}gcc5" ]; then
CC="${i}/${CROSSPFX}gcc5"
break
elif [ -x "${i}/${CROSSPFX}gcc49" ]; then
CC="${i}/${CROSSPFX}gcc49"
break
elif [ -x "${i}/${CROSSPFX}gcc48" ]; then
CC="${i}/${CROSSPFX}gcc48"
break
elif [ -x "${i}/${CROSSPFX}clang.exe" ]; then
CC="${i}/${CROSSPFX}clang.exe"
break
elif [ -x "${i}/${CROSSPFX}cc.exe" ]; then
CC="${i}/${CROSSPFX}cc.exe"
break
elif [ -x "${i}/${CROSSPFX}gcc.exe" ]; then
CC="${i}/${CROSSPFX}gcc.exe"
break
fi
done
IFS=$bb_save_IFS
;;
esac
if [ "$CC" = '' ]; then
if [ "$HAVE_CC65" = "yes" ]; then
echo "*"
echo "* Cannot find cc65 in PATH. You may need to set CC."
echo "* You can download cc65 from: https://www.cc65.org/."
echo "*"
echo "Cannot find cc65 in PATH." >> config.log
else
echo "*"
echo "* Cannot find one of clang, clang70, clang60, cc, gcc, gcc-6, gcc7, gcc8, gcc5, gcc49, gcc48, clang.exe, cc.exe, gcc.exe"
echo "* under the current PATH, which is:"
echo "* $PATH"
echo "*"
echo "* You may need to set the CC environment variable."
echo "*"
echo "Cannot find C compiler in PATH." >> config.log
fi
HAVE_CC="no"
echo "no"
else
HAVE_CC="yes"
echo "yes, ${CC}"
echo "yes, ${CC}" >> config.log
fi
else
HAVE_CC="yes"
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
else
echo "using ${CC}"
fi
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'checking whether the C compiler works...'
$ECHO_N 'checking whether the C compiler works...' >> config.log
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 "no, compile failed" >> config.log
HAVE_CC="no"
else
HAVE_CC="yes"
fi
if [ "${HAVE_CC}" = "yes" ]; then
if [ "${EXECSUFFIX}" = '' ]; then
EXECSUFFIX=''
for OUTFILE in conftest.exe conftest conftest.*; do
if [ -f $OUTFILE ]; then
case $OUTFILE in
*.c | *.cc | *.m | *.o | *.obj | *.bb | *.bbg | *.d | *.pdb | *.tds | *.xcoff | *.dSYM | *.xSYM )
;;
*.* )
EXECSUFFIX=`expr "$OUTFILE" : '[^.]*\(\..*\)'`
break ;;
* )
break ;;
esac;
fi
done
if [ "$EXECSUFFIX" != '' ]; then
echo "yes, it outputs $EXECSUFFIX files"
echo "yes, it outputs $EXECSUFFIX files" >> config.log
else
echo "yes"
echo "yes" >> config.log
fi
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"EXECSUFFIX\"] = \"$EXECSUFFIX\"" >>configure.lua
else
echo "yes"
echo "yes" >> config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking for compiler warning options...'
$ECHO_N 'cc: checking for compiler warning options...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[]) { return (0); }
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_CC_WARNINGS=yes
bb_o=$bb_incdir/have_cc_warnings.h
echo '#ifndef HAVE_CC_WARNINGS' >$bb_o
echo "#define HAVE_CC_WARNINGS \"$HAVE_CC_WARNINGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo 'hdefs["HAVE_CC_WARNINGS"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall -Werror"
fi
$ECHO_N 'cc: checking for float and double...'
$ECHO_N 'cc: checking for float and double...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
float f = 0.1f;
double d = 0.2;
printf("%f", f);
return ((double)f + d) > 0.2 ? 1 : 0;
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_FLOAT=yes
bb_o=$bb_incdir/have_float.h
echo '#ifndef HAVE_FLOAT' >$bb_o
echo "#define HAVE_FLOAT \"$HAVE_FLOAT\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_FLOAT\"] = \"$HAVE_FLOAT\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo 'hdefs["HAVE_FLOAT"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'cc: checking for long double...'
$ECHO_N 'cc: checking for long double...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
long double ld = 0.1;
printf("%Lf", ld);
return (ld + 0.1) > 0.2 ? 1 : 0;
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_LONG_DOUBLE=yes
bb_o=$bb_incdir/have_long_double.h
echo '#ifndef HAVE_LONG_DOUBLE' >$bb_o
echo "#define HAVE_LONG_DOUBLE \"$HAVE_LONG_DOUBLE\"" >>$bb_o
echo '#endif' >>$bb_o
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' >$bb_incdir/have_long_double.h
echo 'hdefs["HAVE_LONG_DOUBLE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'cc: checking for long long...'
$ECHO_N 'cc: checking for long long...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int
main(int argc, char *argv[])
{
long long ll = -1;
unsigned long long ull = 1;
return (ll != -1 || ull != 1);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_LONG_LONG=yes
bb_o=$bb_incdir/have_long_long.h
echo '#ifndef HAVE_LONG_LONG' >$bb_o
echo "#define HAVE_LONG_LONG \"$HAVE_LONG_LONG\"" >>$bb_o
echo '#endif' >>$bb_o
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' >$bb_incdir/have_long_long.h
echo 'hdefs["HAVE_LONG_LONG"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'cc: checking for cygwin environment...'
$ECHO_N 'cc: checking for cygwin environment...' >>config.log
MK_COMPILE_STATUS=OK
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
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_CYGWIN=yes
bb_o=$bb_incdir/have_cygwin.h
echo '#ifndef HAVE_CYGWIN' >$bb_o
echo "#define HAVE_CYGWIN \"$HAVE_CYGWIN\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo 'hdefs["HAVE_CYGWIN"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'cc: checking for -mwindows option...'
$ECHO_N 'cc: checking for -mwindows option...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[]) {
return GetFileAttributes("foo") ? 0 : 1;
}
EOT
$CC $CFLAGS $TEST_CFLAGS -mwindows -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_CC_MWINDOWS=yes
bb_o=$bb_incdir/have_cc_mwindows.h
echo '#ifndef HAVE_CC_MWINDOWS' >$bb_o
echo "#define HAVE_CC_MWINDOWS \"$HAVE_CC_MWINDOWS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CC_MWINDOWS\"] = \"$HAVE_CC_MWINDOWS\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_CC_MWINDOWS=no
echo '#undef HAVE_CC_MWINDOWS' >$bb_incdir/have_cc_mwindows.h
echo 'hdefs["HAVE_CC_MWINDOWS"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_MWINDOWS}" = "yes" ]; then
PROG_GUI_FLAGS="-mwindows"
else
PROG_GUI_FLAGS=""
fi
$ECHO_N 'cc: checking for -mconsole option...'
$ECHO_N 'cc: checking for -mconsole option...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[]) {
return GetFileAttributes("foo") ? 0 : 1;
}
EOT
$CC $CFLAGS $TEST_CFLAGS -mconsole -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_CC_MCONSOLE=yes
bb_o=$bb_incdir/have_cc_mconsole.h
echo '#ifndef HAVE_CC_MCONSOLE' >$bb_o
echo "#define HAVE_CC_MCONSOLE \"$HAVE_CC_MCONSOLE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CC_MCONSOLE\"] = \"$HAVE_CC_MCONSOLE\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_CC_MCONSOLE=no
echo '#undef HAVE_CC_MCONSOLE' >$bb_incdir/have_cc_mconsole.h
echo 'hdefs["HAVE_CC_MCONSOLE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_MCONSOLE}" = "yes" ]; then
PROG_CLI_FLAGS="-mconsole"
else
PROG_CLI_FLAGS=""
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
$ECHO_N 'cc: checking for linker -no-undefined option...'
$ECHO_N 'cc: checking for linker -no-undefined option...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[]) { return (0); }
EOT
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_LD_NO_UNDEFINED=yes
bb_o=$bb_incdir/have_ld_no_undefined.h
echo '#ifndef HAVE_LD_NO_UNDEFINED' >$bb_o
echo "#define HAVE_LD_NO_UNDEFINED \"$HAVE_LD_NO_UNDEFINED\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_LD_NO_UNDEFINED\"] = \"$HAVE_LD_NO_UNDEFINED\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_LD_NO_UNDEFINED=no
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo 'hdefs["HAVE_LD_NO_UNDEFINED"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_LD_NO_UNDEFINED}" = "yes" ]; then
LIBTOOLOPTS_SHARED="${LIBTOOLOPTS_SHARED} -no-undefined -Wl,--no-undefined"
fi
$ECHO_N 'cc: checking for linker -static-libgcc option...'
$ECHO_N 'cc: checking for linker -static-libgcc option...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[]) { return (0); }
EOT
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_LD_STATIC_LIBGCC=yes
bb_o=$bb_incdir/have_ld_static_libgcc.h
echo '#ifndef HAVE_LD_STATIC_LIBGCC' >$bb_o
echo "#define HAVE_LD_STATIC_LIBGCC \"$HAVE_LD_STATIC_LIBGCC\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_LD_STATIC_LIBGCC\"] = \"$HAVE_LD_STATIC_LIBGCC\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_LD_STATIC_LIBGCC=no
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
echo 'hdefs["HAVE_LD_STATIC_LIBGCC"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_LD_STATIC_LIBGCC}" = "yes" ]; then
LIBTOOLOPTS_SHARED="${LIBTOOLOPTS_SHARED} -XCClinker -static-libgcc"
fi
;;
esac
bb_o=$bb_incdir/have_cc.h
echo '#ifndef HAVE_CC' >$bb_o
echo "#define HAVE_CC \"$HAVE_CC\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CC\"] = \"$HAVE_CC\"" >>configure.lua
if [ "${HAVE_CC65}" = "yes" ]; then
CC_COMPILE=""
bb_o=$bb_incdir/have_cc65.h
echo '#ifndef HAVE_CC65' >$bb_o
echo "#define HAVE_CC65 \"$HAVE_CC65\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CC65\"] = \"$HAVE_CC65\"" >>configure.lua
else
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo 'hdefs["HAVE_CC65"] = nil' >>configure.lua
fi
else
HAVE_CC="no"
HAVE_CC65="no"
HAVE_CC_WARNINGS="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
LIBTOOLOPTS_SHARED=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo 'hdefs["HAVE_CC"] = nil' >>configure.lua
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo 'hdefs["HAVE_CC65"] = nil' >>configure.lua
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo 'hdefs["HAVE_CC_WARNINGS"] = nil' >>configure.lua
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo 'hdefs["HAVE_FLOAT"] = nil' >>configure.lua
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo 'hdefs["HAVE_LONG_DOUBLE"] = nil' >>configure.lua
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo 'hdefs["HAVE_LONG_LONG"] = nil' >>configure.lua
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo 'hdefs["HAVE_CYGWIN"] = nil' >>configure.lua
echo '#undef HAVE_CC_MWINDOWS' >$bb_incdir/have_cc_mwindows.h
echo 'hdefs["HAVE_CC_MWINDOWS"] = nil' >>configure.lua
echo '#undef HAVE_CC_MCONSOLE' >$bb_incdir/have_cc_mconsole.h
echo 'hdefs["HAVE_CC_MCONSOLE"] = nil' >>configure.lua
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo 'hdefs["HAVE_LD_NO_UNDEFINED"] = nil' >>configure.lua
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
echo 'hdefs["HAVE_LD_STATIC_LIBGCC"] = nil' >>configure.lua
fi
# END cc
if [ "${HAVE_CC}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires a C compiler'
echo '* This software requires a C compiler' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency cc not found"
exit 1
fi
$ECHO_N 'checking for C compiler attributes...'
$ECHO_N 'checking for C compiler attributes...' >>config.log
# BEGIN cc_attributes
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[])
{
struct s1 { int x,y,z; } __attribute__ ((aligned(16)));
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_ALIGNED_ATTRIBUTE=yes
bb_o=$bb_incdir/have_aligned_attribute.h
echo '#ifndef HAVE_ALIGNED_ATTRIBUTE' >$bb_o
echo "#define HAVE_ALIGNED_ATTRIBUTE \"$HAVE_ALIGNED_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
else
HAVE_ALIGNED_ATTRIBUTE=no
echo '#undef HAVE_ALIGNED_ATTRIBUTE' >$bb_incdir/have_aligned_attribute.h
echo 'hdefs["HAVE_ALIGNED_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_ALIGNED_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'aligned '
$ECHO_N 'aligned ' >>config.log
else
$ECHO_N '!aligned '
$ECHO_N '!aligned ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
void foostring(char *, int) __attribute__ ((__bounded__(__string__,1,2)));
void foostring(char *a, int c) { }
void foobuffer(void *, int) __attribute__ ((__bounded__(__buffer__,1,2)));
void foobuffer(void *a, int c) { }
int main(void)
{
char buf[32];
foostring(buf, sizeof(buf));
foobuffer(buf, sizeof(buf));
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_BOUNDED_ATTRIBUTE=yes
bb_o=$bb_incdir/have_bounded_attribute.h
echo '#ifndef HAVE_BOUNDED_ATTRIBUTE' >$bb_o
echo "#define HAVE_BOUNDED_ATTRIBUTE \"$HAVE_BOUNDED_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
else
HAVE_BOUNDED_ATTRIBUTE=no
echo '#undef HAVE_BOUNDED_ATTRIBUTE' >$bb_incdir/have_bounded_attribute.h
echo 'hdefs["HAVE_BOUNDED_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_BOUNDED_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'bounded '
$ECHO_N 'bounded ' >>config.log
else
$ECHO_N '!bounded '
$ECHO_N '!bounded ' >>config.log
fi
MK_COMPILE_STATUS=OK
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
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_CONST_ATTRIBUTE=yes
bb_o=$bb_incdir/have_const_attribute.h
echo '#ifndef HAVE_CONST_ATTRIBUTE' >$bb_o
echo "#define HAVE_CONST_ATTRIBUTE \"$HAVE_CONST_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
else
HAVE_CONST_ATTRIBUTE=no
echo '#undef HAVE_CONST_ATTRIBUTE' >$bb_incdir/have_const_attribute.h
echo 'hdefs["HAVE_CONST_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CONST_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'const '
$ECHO_N 'const ' >>config.log
else
$ECHO_N '!const '
$ECHO_N '!const ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
void foo(void) __attribute__ ((deprecated));
void foo(void) { }
int main(int argc, char *argv[])
{
/* foo(); */
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_DEPRECATED_ATTRIBUTE=yes
bb_o=$bb_incdir/have_deprecated_attribute.h
echo '#ifndef HAVE_DEPRECATED_ATTRIBUTE' >$bb_o
echo "#define HAVE_DEPRECATED_ATTRIBUTE \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
else
HAVE_DEPRECATED_ATTRIBUTE=no
echo '#undef HAVE_DEPRECATED_ATTRIBUTE' >$bb_incdir/have_deprecated_attribute.h
echo 'hdefs["HAVE_DEPRECATED_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_DEPRECATED_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'deprecated '
$ECHO_N 'deprecated ' >>config.log
else
$ECHO_N '!deprecated '
$ECHO_N '!deprecated ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
void foo1(char *, ...)
__attribute__((__format__ (printf, 1, 2)));
void foo2(char *, ...)
__attribute__((__format__ (__printf__, 1, 2)));
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
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_FORMAT_ATTRIBUTE=yes
bb_o=$bb_incdir/have_format_attribute.h
echo '#ifndef HAVE_FORMAT_ATTRIBUTE' >$bb_o
echo "#define HAVE_FORMAT_ATTRIBUTE \"$HAVE_FORMAT_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
else
HAVE_FORMAT_ATTRIBUTE=no
echo '#undef HAVE_FORMAT_ATTRIBUTE' >$bb_incdir/have_format_attribute.h
echo 'hdefs["HAVE_FORMAT_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_FORMAT_ATTRIBUTE}" = "yes" ]; then
echo 'format'
echo 'format' >>config.log
else
echo '!format'
echo '!format' >>config.log
fi
$ECHO_N 'checking for C compiler attributes...'
$ECHO_N 'checking for C compiler attributes...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
void *myalloc(size_t len) __attribute__ ((__malloc__));
void *myalloc(size_t len) { return (NULL); }
int main(int argc, char *argv[])
{
void *p = myalloc(10);
return (p != NULL);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_MALLOC_ATTRIBUTE=yes
bb_o=$bb_incdir/have_malloc_attribute.h
echo '#ifndef HAVE_MALLOC_ATTRIBUTE' >$bb_o
echo "#define HAVE_MALLOC_ATTRIBUTE \"$HAVE_MALLOC_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_MALLOC_ATTRIBUTE\"] = \"$HAVE_MALLOC_ATTRIBUTE\"" >>configure.lua
else
HAVE_MALLOC_ATTRIBUTE=no
echo '#undef HAVE_MALLOC_ATTRIBUTE' >$bb_incdir/have_malloc_attribute.h
echo 'hdefs["HAVE_MALLOC_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_MALLOC_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'malloc '
$ECHO_N 'malloc ' >>config.log
else
$ECHO_N '!malloc '
$ECHO_N '!malloc ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
void foo(void) __attribute__ ((noreturn));
void foo(void) { _exit(0); }
int main(int argc, char *argv[])
{
foo();
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_NORETURN_ATTRIBUTE=yes
bb_o=$bb_incdir/have_noreturn_attribute.h
echo '#ifndef HAVE_NORETURN_ATTRIBUTE' >$bb_o
echo "#define HAVE_NORETURN_ATTRIBUTE \"$HAVE_NORETURN_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
else
HAVE_NORETURN_ATTRIBUTE=no
echo '#undef HAVE_NORETURN_ATTRIBUTE' >$bb_incdir/have_noreturn_attribute.h
echo 'hdefs["HAVE_NORETURN_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_NORETURN_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'noreturn '
$ECHO_N 'noreturn ' >>config.log
else
$ECHO_N '!noreturn '
$ECHO_N '!noreturn ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[])
{
struct s1 { char c; int x,y,z; } __attribute__ ((packed));
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_PACKED_ATTRIBUTE=yes
bb_o=$bb_incdir/have_packed_attribute.h
echo '#ifndef HAVE_PACKED_ATTRIBUTE' >$bb_o
echo "#define HAVE_PACKED_ATTRIBUTE \"$HAVE_PACKED_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
else
HAVE_PACKED_ATTRIBUTE=no
echo '#undef HAVE_PACKED_ATTRIBUTE' >$bb_incdir/have_packed_attribute.h
echo 'hdefs["HAVE_PACKED_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_PACKED_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'packed '
$ECHO_N 'packed ' >>config.log
else
$ECHO_N '!packed '
$ECHO_N '!packed ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
volatile int glo = 1234;
int foo(int) __attribute__ ((pure));
int foo(int x) { return (x*x + glo); }
int main(int argc, char *argv[])
{
int x = foo(1);
glo = 2345;
x = foo(2);
return (x);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_PURE_ATTRIBUTE=yes
bb_o=$bb_incdir/have_pure_attribute.h
echo '#ifndef HAVE_PURE_ATTRIBUTE' >$bb_o
echo "#define HAVE_PURE_ATTRIBUTE \"$HAVE_PURE_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
else
HAVE_PURE_ATTRIBUTE=no
echo '#undef HAVE_PURE_ATTRIBUTE' >$bb_incdir/have_pure_attribute.h
echo 'hdefs["HAVE_PURE_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_PURE_ATTRIBUTE}" = "yes" ]; then
$ECHO_N 'pure '
$ECHO_N 'pure ' >>config.log
else
$ECHO_N '!pure '
$ECHO_N '!pure ' >>config.log
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
int main(int argc, char *argv[])
{
int __attribute__ ((unused)) variable;
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_UNUSED_VARIABLE_ATTRIBUTE=yes
bb_o=$bb_incdir/have_unused_variable_attribute.h
echo '#ifndef HAVE_UNUSED_VARIABLE_ATTRIBUTE' >$bb_o
echo "#define HAVE_UNUSED_VARIABLE_ATTRIBUTE \"$HAVE_UNUSED_VARIABLE_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_UNUSED_VARIABLE_ATTRIBUTE\"] = \"$HAVE_UNUSED_VARIABLE_ATTRIBUTE\"" >>configure.lua
else
HAVE_UNUSED_VARIABLE_ATTRIBUTE=no
echo '#undef HAVE_UNUSED_VARIABLE_ATTRIBUTE' >$bb_incdir/have_unused_variable_attribute.h
echo 'hdefs["HAVE_UNUSED_VARIABLE_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_UNUSED_VARIABLE_ATTRIBUTE}" = "yes" ]; then
echo 'unused'
echo 'unused' >>config.log
else
echo '!unused'
echo '!unused' >>config.log
fi
$ECHO_N 'checking for C compiler attributes...'
$ECHO_N 'checking for C compiler attributes...' >>config.log
MK_COMPILE_STATUS=OK
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
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=yes
bb_o=$bb_incdir/have_warn_unused_result_attribute.h
echo '#ifndef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE' >$bb_o
echo "#define HAVE_WARN_UNUSED_RESULT_ATTRIBUTE \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"] = \"$HAVE_WARN_UNUSED_RESULT_ATTRIBUTE\"" >>configure.lua
else
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=no
echo '#undef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE' >$bb_incdir/have_warn_unused_result_attribute.h
echo 'hdefs["HAVE_WARN_UNUSED_RESULT_ATTRIBUTE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_WARN_UNUSED_RESULT_ATTRIBUTE}" = "yes" ]; then
echo 'warn_unused_result '
echo 'warn_unused_result ' >>config.log
else
echo '!warn_unused_result '
echo '!warn_unused_result ' >>config.log
fi
# END cc_attributes
$ECHO_N 'checking for ...'
$ECHO_N 'checking for ...' >>config.log
# BEGIN sys_types
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
int8_t s8 = 2;
u_int8_t u8 = 2;
int32_t s32 = 1234;
u_int32_t u32 = 5678;
return (s8+u8 == 4 && s32+u32 > 6000 ? 0 : 1);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_SYS_TYPES_H=yes
bb_o=$bb_incdir/_mk_have_sys_types_h.h
echo '#ifndef _MK_HAVE_SYS_TYPES_H' >$bb_o
echo "#define _MK_HAVE_SYS_TYPES_H \"$_MK_HAVE_SYS_TYPES_H\"" >>$bb_o
echo '#endif' >>$bb_o
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 '#undef _MK_HAVE_SYS_TYPES_H' >$bb_incdir/_mk_have_sys_types_h.h
echo 'hdefs["_MK_HAVE_SYS_TYPES_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for ...'
$ECHO_N 'checking for ...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
int8_t s8 = 2;
uint8_t u8 = 2;
int32_t s32 = 1234;
uint32_t u32 = 5678;
return (s8+u8 == 4 && s32+u32 > 6000 ? 0 : 1);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_STDINT_H=yes
bb_o=$bb_incdir/_mk_have_stdint_h.h
echo '#ifndef _MK_HAVE_STDINT_H' >$bb_o
echo "#define _MK_HAVE_STDINT_H \"$_MK_HAVE_STDINT_H\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"_MK_HAVE_STDINT_H\"] = \"$_MK_HAVE_STDINT_H\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
_MK_HAVE_STDINT_H=no
echo '#undef _MK_HAVE_STDINT_H' >$bb_incdir/_mk_have_stdint_h.h
echo 'hdefs["_MK_HAVE_STDINT_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${_MK_HAVE_SYS_TYPES_H}" = "yes" ]; then
$ECHO_N 'checking for int64_t type...'
$ECHO_N 'checking for int64_t type...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
int64_t i64 = 0;
u_int64_t u64 = 0;
printf("%lld %llu", (long long)i64, (unsigned long long)u64);
return (i64 != 0 || u64 != 0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_INT64_T=yes
bb_o=$bb_incdir/have_int64_t.h
echo '#ifndef HAVE_INT64_T' >$bb_o
echo "#define HAVE_INT64_T \"$HAVE_INT64_T\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_INT64_T\"] = \"$HAVE_INT64_T\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_INT64_T=no
echo '#undef HAVE_INT64_T' >$bb_incdir/have_int64_t.h
echo 'hdefs["HAVE_INT64_T"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for __int64 type...'
$ECHO_N 'checking for __int64 type...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
__int64 i64 = 0;
printf("%lld", (long long)i64);
return (i64 != 0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE___INT64=yes
bb_o=$bb_incdir/have___int64.h
echo '#ifndef HAVE___INT64' >$bb_o
echo "#define HAVE___INT64 \"$HAVE___INT64\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE___INT64\"] = \"$HAVE___INT64\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE___INT64=no
echo '#undef HAVE___INT64' >$bb_incdir/have___int64.h
echo 'hdefs["HAVE___INT64"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_INT64_T}" = "yes" ]; then
HAVE_64BIT="yes"
bb_o=$bb_incdir/have_64bit.h
echo '#ifndef HAVE_64BIT' >$bb_o
echo "#define HAVE_64BIT \"$HAVE_64BIT\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
else
if [ "${HAVE___INT64}" = "yes" ]; then
HAVE_64BIT="yes"
bb_o=$bb_incdir/have_64bit.h
echo '#ifndef HAVE_64BIT' >$bb_o
echo "#define HAVE_64BIT \"$HAVE_64BIT\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
echo 'hdefs["HAVE_64BIT"] = nil' >>configure.lua
fi
fi
else
if [ "${_MK_HAVE_STDINT_H}" = "yes" ]; then
$ECHO_N 'checking for int64_t type...'
$ECHO_N 'checking for int64_t type...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
int64_t i64 = 0;
u_int64_t u64 = 0;
printf("%lld %llu", (long long)i64, (unsigned long long)u64);
return (i64 != 0 || u64 != 0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_INT64_T=yes
bb_o=$bb_incdir/have_int64_t.h
echo '#ifndef HAVE_INT64_T' >$bb_o
echo "#define HAVE_INT64_T \"$HAVE_INT64_T\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_INT64_T\"] = \"$HAVE_INT64_T\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_INT64_T=no
echo '#undef HAVE_INT64_T' >$bb_incdir/have_int64_t.h
echo 'hdefs["HAVE_INT64_T"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for __int64 type...'
$ECHO_N 'checking for __int64 type...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
__int64 i64 = 0;
printf("%lld", (long long)i64);
return (i64 != 0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE___INT64=yes
bb_o=$bb_incdir/have___int64.h
echo '#ifndef HAVE___INT64' >$bb_o
echo "#define HAVE___INT64 \"$HAVE___INT64\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE___INT64\"] = \"$HAVE___INT64\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE___INT64=no
echo '#undef HAVE___INT64' >$bb_incdir/have___int64.h
echo 'hdefs["HAVE___INT64"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_INT64_T}" = "yes" ]; then
HAVE_64BIT="yes"
bb_o=$bb_incdir/have_64bit.h
echo '#ifndef HAVE_64BIT' >$bb_o
echo "#define HAVE_64BIT \"$HAVE_64BIT\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
else
if [ "${HAVE___INT64}" = "yes" ]; then
HAVE_64BIT="yes"
bb_o=$bb_incdir/have_64bit.h
echo '#ifndef HAVE_64BIT' >$bb_o
echo "#define HAVE_64BIT \"$HAVE_64BIT\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_64BIT\"] = \"$HAVE_64BIT\"" >>configure.lua
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
echo 'hdefs["HAVE_64BIT"] = nil' >>configure.lua
fi
fi
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
echo 'hdefs["HAVE_64BIT"] = nil' >>configure.lua
fi
fi
# END sys_types
$ECHO_N 'checking for a compatible ...'
$ECHO_N 'checking for a compatible ...' >>config.log
# BEGIN sys_queue
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
struct foo { TAILQ_ENTRY(foo) foos; };
struct bar { CIRCLEQ_ENTRY(bar) bars; };
TAILQ_HEAD(fooqname,foo) fooq = TAILQ_HEAD_INITIALIZER(fooq);
CIRCLEQ_HEAD(,bar) barq = CIRCLEQ_HEAD_INITIALIZER(barq);
int main(int argc, char *argv[])
{
struct foo foo1;
struct bar bar1;
struct foo *pfoo, *pfoo_next;
struct bar *pbar;
TAILQ_INIT(&fooq);
TAILQ_INSERT_HEAD(&fooq, &foo1, foos);
TAILQ_FOREACH(pfoo, &fooq, foos) { }
TAILQ_FOREACH_REVERSE(pfoo, &fooq, fooqname, foos) { }
for (pfoo = TAILQ_FIRST(&fooq);
pfoo != TAILQ_END(&fooq);
pfoo = pfoo_next) {
pfoo_next = TAILQ_NEXT(pfoo,foos);
}
TAILQ_REMOVE(&fooq, &foo1, foos);
CIRCLEQ_INIT(&barq);
CIRCLEQ_INSERT_HEAD(&barq, &bar1, bars);
CIRCLEQ_FOREACH(pbar, &barq, bars) { }
CIRCLEQ_REMOVE(&barq, &bar1, bars);
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_SYS_QUEUE_H=yes
bb_o=$bb_incdir/_mk_have_sys_queue_h.h
echo '#ifndef _MK_HAVE_SYS_QUEUE_H' >$bb_o
echo "#define _MK_HAVE_SYS_QUEUE_H \"$_MK_HAVE_SYS_QUEUE_H\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"_MK_HAVE_SYS_QUEUE_H\"] = \"$_MK_HAVE_SYS_QUEUE_H\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
_MK_HAVE_SYS_QUEUE_H=no
echo '#undef _MK_HAVE_SYS_QUEUE_H' >$bb_incdir/_mk_have_sys_queue_h.h
echo 'hdefs["_MK_HAVE_SYS_QUEUE_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END sys_queue
$ECHO_N 'checking for ...'
$ECHO_N 'checking for ...' >>config.log
# BEGIN stdlib_h
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
void *foo = malloc(1);
free(foo);
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_STDLIB_H=yes
bb_o=$bb_incdir/_mk_have_stdlib_h.h
echo '#ifndef _MK_HAVE_STDLIB_H' >$bb_o
echo "#define _MK_HAVE_STDLIB_H \"$_MK_HAVE_STDLIB_H\"" >>$bb_o
echo '#endif' >>$bb_o
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 '#undef _MK_HAVE_STDLIB_H' >$bb_incdir/_mk_have_stdlib_h.h
echo 'hdefs["_MK_HAVE_STDLIB_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END stdlib_h
$ECHO_N 'checking for ...'
$ECHO_N 'checking for ...' >>config.log
# BEGIN unistd_h
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
char buf;
int rv, fdout=1;
if ((rv = write(fdout, (void *)&buf, 1)) < 1) { return (1); }
if ((rv = read(0, (void *)&buf, 1)) < 1) { return (1); }
if (unlink("/tmp/foo") != 0) { return (1); }
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_UNISTD_H=yes
bb_o=$bb_incdir/_mk_have_unistd_h.h
echo '#ifndef _MK_HAVE_UNISTD_H' >$bb_o
echo "#define _MK_HAVE_UNISTD_H \"$_MK_HAVE_UNISTD_H\"" >>$bb_o
echo '#endif' >>$bb_o
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 '#undef _MK_HAVE_UNISTD_H' >$bb_incdir/_mk_have_unistd_h.h
echo 'hdefs["_MK_HAVE_UNISTD_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END unistd_h
$ECHO_N 'checking for compatible ...'
$ECHO_N 'checking for compatible ...' >>config.log
# BEGIN limits_h
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
int i = INT_MIN;
unsigned u = 0;
long l = LONG_MIN;
unsigned long ul = 0;
i = INT_MAX;
u = UINT_MAX;
l = LONG_MAX;
ul = ULONG_MAX;
return (i != INT_MAX || u != UINT_MAX || l != LONG_MAX || ul != LONG_MAX);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_LIMITS_H=yes
bb_o=$bb_incdir/_mk_have_limits_h.h
echo '#ifndef _MK_HAVE_LIMITS_H' >$bb_o
echo "#define _MK_HAVE_LIMITS_H \"$_MK_HAVE_LIMITS_H\"" >>$bb_o
echo '#endif' >>$bb_o
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 '#undef _MK_HAVE_LIMITS_H' >$bb_incdir/_mk_have_limits_h.h
echo 'hdefs["_MK_HAVE_LIMITS_H"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END limits_h
$ECHO_N 'checking for the C math library...'
$ECHO_N 'checking for the C math library...' >>config.log
# BEGIN math
if [ "" != "" ]; then
MATH_CFLAGS="-I"
MATH_LIBS="-L -lm"
else
MATH_CFLAGS=""
MATH_LIBS="-lm"
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
double d = 1.0;
d = fabs(d);
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_MATH=yes
bb_o=$bb_incdir/have_math.h
echo '#ifndef HAVE_MATH' >$bb_o
echo "#define HAVE_MATH \"$HAVE_MATH\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_MATH=no
echo '#undef HAVE_MATH' >$bb_incdir/have_math.h
echo 'hdefs["HAVE_MATH"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_MATH}" = "yes" ]; then
bb_o=$bb_incdir/math_cflags.h
echo '#ifndef MATH_CFLAGS' >$bb_o
echo "#define MATH_CFLAGS \"$MATH_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"MATH_CFLAGS\"] = \"$MATH_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/math_libs.h
echo '#ifndef MATH_LIBS' >$bb_o
echo "#define MATH_LIBS \"$MATH_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"MATH_LIBS\"] = \"$MATH_LIBS\"" >>configure.lua
else
echo '#undef MATH_CFLAGS' >$bb_incdir/math_cflags.h
echo 'hdefs["MATH_CFLAGS"] = nil' >>configure.lua
MATH_CFLAGS=""
echo '#undef MATH_LIBS' >$bb_incdir/math_libs.h
echo 'hdefs["MATH_LIBS"] = nil' >>configure.lua
MATH_LIBS=""
fi
# END math
$ECHO_N 'checking for strsep()...'
$ECHO_N 'checking for strsep()...' >>config.log
# BEGIN strsep
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
char foo[32], *pFoo = &foo[0];
char *s;
foo[0] = '\0';
s = strsep(&pFoo, " ");
return (s != NULL);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_STRSEP=yes
bb_o=$bb_incdir/have_strsep.h
echo '#ifndef HAVE_STRSEP' >$bb_o
echo "#define HAVE_STRSEP \"$HAVE_STRSEP\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_STRSEP\"] = \"$HAVE_STRSEP\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_STRSEP=no
echo '#undef HAVE_STRSEP' >$bb_incdir/have_strsep.h
echo 'hdefs["HAVE_STRSEP"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END strsep
$ECHO_N 'checking for asprintf()...'
$ECHO_N 'checking for asprintf()...' >>config.log
# BEGIN asprintf
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
char *buf;
if (asprintf(&buf, "foo %s", "bar") == 0) {
return (0);
}
return (1);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_ASPRINTF=yes
bb_o=$bb_incdir/have_asprintf.h
echo '#ifndef HAVE_ASPRINTF' >$bb_o
echo "#define HAVE_ASPRINTF \"$HAVE_ASPRINTF\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_ASPRINTF\"] = \"$HAVE_ASPRINTF\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_ASPRINTF=no
echo '#undef HAVE_ASPRINTF' >$bb_incdir/have_asprintf.h
echo 'hdefs["HAVE_ASPRINTF"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END asprintf
$ECHO_N 'checking for vasprintf()...'
$ECHO_N 'checking for vasprintf()...' >>config.log
# BEGIN vasprintf
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#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
$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_VASPRINTF=yes
bb_o=$bb_incdir/have_vasprintf.h
echo '#ifndef HAVE_VASPRINTF' >$bb_o
echo "#define HAVE_VASPRINTF \"$HAVE_VASPRINTF\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_VASPRINTF\"] = \"$HAVE_VASPRINTF\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_VASPRINTF=no
echo '#undef HAVE_VASPRINTF' >$bb_incdir/have_vasprintf.h
echo 'hdefs["HAVE_VASPRINTF"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END vasprintf
$ECHO_N 'checking for snprintf()...'
$ECHO_N 'checking for snprintf()...' >>config.log
# BEGIN snprintf
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
char buf[16];
(void)snprintf(buf, sizeof(buf), "foo");
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_SNPRINTF=yes
bb_o=$bb_incdir/have_snprintf.h
echo '#ifndef HAVE_SNPRINTF' >$bb_o
echo "#define HAVE_SNPRINTF \"$HAVE_SNPRINTF\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_SNPRINTF\"] = \"$HAVE_SNPRINTF\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_SNPRINTF=no
echo '#undef HAVE_SNPRINTF' >$bb_incdir/have_snprintf.h
echo 'hdefs["HAVE_SNPRINTF"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END snprintf
$ECHO_N 'checking for vsnprintf()...'
$ECHO_N 'checking for vsnprintf()...' >>config.log
# BEGIN vsnprintf
MK_COMPILE_STATUS=OK
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
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_VSNPRINTF=yes
bb_o=$bb_incdir/have_vsnprintf.h
echo '#ifndef HAVE_VSNPRINTF' >$bb_o
echo "#define HAVE_VSNPRINTF \"$HAVE_VSNPRINTF\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_VSNPRINTF\"] = \"$HAVE_VSNPRINTF\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_VSNPRINTF=no
echo '#undef HAVE_VSNPRINTF' >$bb_incdir/have_vsnprintf.h
echo 'hdefs["HAVE_VSNPRINTF"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END vsnprintf
$ECHO_N 'checking for strtoll()...'
$ECHO_N 'checking for strtoll()...' >>config.log
# BEGIN strtoll
MK_COMPILE_STATUS=OK
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 (lli != 0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
_MK_HAVE_STRTOLL=yes
bb_o=$bb_incdir/_mk_have_strtoll.h
echo '#ifndef _MK_HAVE_STRTOLL' >$bb_o
echo "#define _MK_HAVE_STRTOLL \"$_MK_HAVE_STRTOLL\"" >>$bb_o
echo '#endif' >>$bb_o
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' >$bb_incdir/_mk_have_strtoll.h
echo 'hdefs["_MK_HAVE_STRTOLL"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END strtoll
CFLAGS="$CFLAGS -D_FREESG_INTERNAL"
CXXFLAGS="$CXXFLAGS -D_FREESG_INTERNAL"
CFLAGS="$CFLAGS -D_USE_AGAR_TYPES"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_TYPES"
CFLAGS="$CFLAGS -D_USE_AGAR_CPUINFO"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_CPUINFO"
CFLAGS="$CFLAGS -D_USE_AGAR_STD"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_STD"
CFLAGS="$CFLAGS -D_USE_AGAR_QUEUE"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_QUEUE"
CFLAGS="$CFLAGS -D_USE_AGAR_CORE"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_CORE"
CFLAGS="$CFLAGS -D_USE_AGAR_GUI"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_GUI"
CFLAGS="$CFLAGS -D_USE_AGAR_MATH"
CXXFLAGS="$CXXFLAGS -D_USE_AGAR_MATH"
if [ "${enable_warnings}" = "yes" ]
then
CFLAGS="$CFLAGS -Wall"
CXXFLAGS="$CXXFLAGS -Wall"
CFLAGS="$CFLAGS -Werror"
CXXFLAGS="$CXXFLAGS -Werror"
CFLAGS="$CFLAGS -Wmissing-prototypes"
CXXFLAGS="$CXXFLAGS -Wmissing-prototypes"
WNO_UNINITIALIZED="-Wno-uninitialized"
else
WNO_UNINITIALIZED=""
fi
$ECHO_N 'checking for OpenGL...'
$ECHO_N 'checking for OpenGL...' >>config.log
# BEGIN opengl(0 ${prefix_opengl})
GL_CFLAGS=""
GL_LIBS=""
GL_FOUND=""
if [ "${prefix_opengl}" != "" ]; then
if [ -e "${prefix_opengl}/include" ]; then
GL_CFLAGS="-I${prefix_opengl}/include"
GL_LIBS="${GL_LIBS} -L${prefix_opengl}/lib"
GL_FOUND=yes
fi
else
case "${host}" in
*-*-darwin*)
$ECHO_N 'framework...'
$ECHO_N 'framework...' >>config.log
OPENGL_CFLAGS="-D_USE_OPENGL_FRAMEWORK"
OPENGL_LIBS="-framework OpenGL"
GL_FOUND=yes
;;
*)
if [ -e "/usr/include/X11/GL" ]; then
GL_CFLAGS="-I/usr/include/X11"
GL_FOUND=yes
fi
if [ -e "/usr/include/X11R6/GL" ]; then
GL_CFLAGS="-I/usr/include/X11R6"
GL_FOUND=yes
fi
if [ -e "/usr/include/X11R7/GL" ]; then
GL_CFLAGS="-I/usr/include/X11R7"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11/include/GL" ]; then
GL_CFLAGS="-I/usr/local/X11/include"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11R6/include/GL" ]; then
GL_CFLAGS="-I/usr/local/X11R6/include"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11R7/include/GL" ]; then
GL_CFLAGS="-I/usr/local/X11R7/include"
GL_FOUND=yes
fi
if [ -e "/usr/local/include/X11/GL" ]; then
GL_CFLAGS="-I/usr/local/include/X11"
GL_FOUND=yes
fi
if [ -e "/usr/local/include/X11R6/GL" ]; then
GL_CFLAGS="-I/usr/local/include/X11R6"
GL_FOUND=yes
fi
if [ -e "/usr/local/include/X11R7/GL" ]; then
GL_CFLAGS="-I/usr/local/include/X11R7"
GL_FOUND=yes
fi
if [ -e "/usr/X11/include/GL" ]; then
GL_CFLAGS="-I/usr/X11/include"
GL_FOUND=yes
fi
if [ -e "/usr/X11R6/include/GL" ]; then
GL_CFLAGS="-I/usr/X11R6/include"
GL_FOUND=yes
fi
if [ -e "/usr/X11R7/include/GL" ]; then
GL_CFLAGS="-I/usr/X11R7/include"
GL_FOUND=yes
fi
if [ -e "/usr/local/include/GL" ]; then
GL_CFLAGS="-I/usr/local/include"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/local/X11/lib"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11R6/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/local/X11R6/lib"
GL_FOUND=yes
fi
if [ -e "/usr/local/X11R7/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/local/X11R7/lib"
GL_FOUND=yes
fi
if [ -e "/usr/X11/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/X11/lib"
GL_FOUND=yes
fi
if [ -e "/usr/X11R6/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/X11R6/lib"
GL_FOUND=yes
fi
if [ -e "/usr/X11R7/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/X11R7/lib"
GL_FOUND=yes
fi
if [ -e "/usr/local/lib" ]; then
GL_LIBS="${GL_LIBS} -L/usr/local/lib"
GL_FOUND=yes
fi
;;
esac
fi
if [ "${GL_FOUND}" = "yes" ]; then
echo 'yes'
echo 'yes' >>config.log
case "${host}" in
*-*-darwin*)
;;
*-*-cygwin* | *-*-mingw32*)
$ECHO_N 'checking whether -lopengl32 works...'
$ECHO_N 'checking whether -lopengl32 works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_OPENGL_FRAMEWORK
# include
#else
# include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_LIBOPENGL32=yes
bb_o=$bb_incdir/have_libopengl32.h
echo '#ifndef HAVE_LIBOPENGL32' >$bb_o
echo "#define HAVE_LIBOPENGL32 \"$HAVE_LIBOPENGL32\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_LIBOPENGL32=no
echo '#undef HAVE_LIBOPENGL32' >$bb_incdir/have_libopengl32.h
echo 'hdefs["HAVE_LIBOPENGL32"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_LIBOPENGL32}" = "yes" ]; then
OPENGL_LIBS="${GL_LIBS} -lopengl32"
else
OPENGL_LIBS="${GL_LIBS} -lGL"
fi
;;
*)
OPENGL_CFLAGS="${GL_CFLAGS}"
OPENGL_LIBS="${GL_LIBS} -lGL"
;;
esac
$ECHO_N 'checking whether OpenGL works...'
$ECHO_N 'checking whether OpenGL works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_OPENGL_FRAMEWORK
# include
#else
# include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_OPENGL=yes
bb_o=$bb_incdir/have_opengl.h
echo '#ifndef HAVE_OPENGL' >$bb_o
echo "#define HAVE_OPENGL \"$HAVE_OPENGL\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_OPENGL=no
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo 'hdefs["HAVE_OPENGL"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_OPENGL}" = "yes" ]; then
bb_o=$bb_incdir/opengl_cflags.h
echo '#ifndef OPENGL_CFLAGS' >$bb_o
echo "#define OPENGL_CFLAGS \"$OPENGL_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/opengl_libs.h
echo '#ifndef OPENGL_LIBS' >$bb_o
echo "#define OPENGL_LIBS \"$OPENGL_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
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_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_OPENGL_FRAMEWORK
# include
#else
# include
#endif
int main(int argc, char *argv[]) {
glFlush();
glLoadIdentity();
return (0);
}
EOT
$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
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_OPENGL=yes
bb_o=$bb_incdir/have_opengl.h
echo '#ifndef HAVE_OPENGL' >$bb_o
echo "#define HAVE_OPENGL \"$HAVE_OPENGL\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_OPENGL=no
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo 'hdefs["HAVE_OPENGL"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_OPENGL}" = "yes" ]; then
bb_o=$bb_incdir/opengl_cflags.h
echo '#ifndef OPENGL_CFLAGS' >$bb_o
echo "#define OPENGL_CFLAGS \"$OPENGL_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"OPENGL_CFLAGS\"] = \"$OPENGL_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/opengl_libs.h
echo '#ifndef OPENGL_LIBS' >$bb_o
echo "#define OPENGL_LIBS \"$OPENGL_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"OPENGL_LIBS\"] = \"$OPENGL_LIBS\"" >>configure.lua
else
echo '#undef OPENGL_CFLAGS' >$bb_incdir/opengl_cflags.h
echo 'hdefs["OPENGL_CFLAGS"] = nil' >>configure.lua
OPENGL_CFLAGS=""
echo '#undef OPENGL_LIBS' >$bb_incdir/opengl_libs.h
echo 'hdefs["OPENGL_LIBS"] = nil' >>configure.lua
OPENGL_LIBS=""
fi
fi
else
echo 'no'
echo 'no' >>config.log
fi
if [ "${HAVE_OPENGL}" = "yes" ]; then
OPENGL_PC="gl"
else
OPENGL_PC=""
fi
# END opengl
if [ "${HAVE_OPENGL}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires OpenGL'
echo '* This software requires OpenGL' >>config.log
echo '* WWW: http://www.OpenGL.org'
echo '* WWW: http://www.OpenGL.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency opengl not found"
exit 1
fi
$ECHO_N 'checking for GLU...'
$ECHO_N 'checking for GLU...' >>config.log
# BEGIN glu(0 ${prefix_glu})
GLU_CFLAGS=""
GLU_LIBS=""
case "${host}" in
*-*-darwin*)
GLU_CFLAGS=""
GLU_LIBS="-framework GLUT"
;;
*-*-cygwin* | *-*-mingw32*)
if [ "${prefix_glu}" != "" ]; then
GLU_CFLAGS="-I${prefix_glu}/include"
GLU_LIBS="-L${prefix_glu}/lib -lglu32"
else
GLU_CFLAGS=""
GLU_LIBS="-lglu32"
fi
;;
*)
if [ "${prefix_glu}" != "" ]; then
if [ -e "${prefix_glu}/include/GL/glu.h" ]; then
GLU_CFLAGS="-I${prefix_glu}/include"
GLU_LIBS="-L${prefix_glu}/lib -lGLU"
fi
else
if [ -e "/usr/local/include/X11/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/local/include/X11"
GLU_LIBS="-L/usr/local/lib/X11 -lGLU"
break
fi
if [ -e "/usr/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/include"
GLU_LIBS="-L/usr/lib -lGLU"
break
fi
if [ -e "/usr/include/X11/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/include/X11"
GLU_LIBS="-L/usr/lib/X11 -lGLU"
break
fi
if [ -e "/usr/local/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/local/include"
GLU_LIBS="-L/usr/local/lib -lGLU"
break
fi
if [ -e "/usr/local/X11R6/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/local/X11R6/include"
GLU_LIBS="-L/usr/local/X11R6/lib -lGLU"
break
fi
if [ -e "/usr/X11R6/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/X11R6/include"
GLU_LIBS="-L/usr/X11R6/lib -lGLU"
break
fi
if [ -e "/usr/X11/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/X11/include"
GLU_LIBS="-L/usr/X11/lib -lGLU"
break
fi
if [ -e "/usr/include/X11R6/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/include/X11R6"
GLU_LIBS="-L/usr/lib/X11R6 -lGLU"
break
fi
if [ -e "/usr/local/include/X11R6/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/local/include/X11R6"
GLU_LIBS="-L/usr/local/lib/X11R6 -lGLU"
break
fi
if [ -e "/usr/local/X11/include/GL/glu.h" ]; then
GLU_CFLAGS="-I/usr/local/X11/include"
GLU_LIBS="-L/usr/local/X11/lib -lGLU"
break
fi
fi
;;
esac
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef __APPLE__
#include
#include
#else
#include
#include
#endif
int main(int argc, char *argv[]) {
GLUquadric *qd;
qd = gluNewQuadric();
gluDeleteQuadric(qd);
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} ${GLU_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} ${GLU_LIBS} ${MATH_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_GLU=yes
bb_o=$bb_incdir/have_glu.h
echo '#ifndef HAVE_GLU' >$bb_o
echo "#define HAVE_GLU \"$HAVE_GLU\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_GLU\"] = \"$HAVE_GLU\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_GLU=no
echo '#undef HAVE_GLU' >$bb_incdir/have_glu.h
echo 'hdefs["HAVE_GLU"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_GLU}" = "yes" ]; then
bb_o=$bb_incdir/glu_cflags.h
echo '#ifndef GLU_CFLAGS' >$bb_o
echo "#define GLU_CFLAGS \"$GLU_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"GLU_CFLAGS\"] = \"$GLU_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/glu_libs.h
echo '#ifndef GLU_LIBS' >$bb_o
echo "#define GLU_LIBS \"$GLU_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"GLU_LIBS\"] = \"$GLU_LIBS\"" >>configure.lua
else
echo '#undef GLU_CFLAGS' >$bb_incdir/glu_cflags.h
echo 'hdefs["GLU_CFLAGS"] = nil' >>configure.lua
GLU_CFLAGS=""
echo '#undef GLU_LIBS' >$bb_incdir/glu_libs.h
echo 'hdefs["GLU_LIBS"] = nil' >>configure.lua
GLU_LIBS=""
fi
# END glu
if [ "${HAVE_GLU}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires GLU'
echo '* This software requires GLU' >>config.log
echo '* WWW: http://www.opengl.org'
echo '* WWW: http://www.opengl.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency glu not found"
exit 1
fi
$ECHO_N 'checking for Agar...'
$ECHO_N 'checking for Agar...' >>config.log
# BEGIN agar(1.5.0 ${prefix_agar})
AGAR_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_VERSION=`${path}/agar-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_VERSION=`${path}/agar-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
if [ "${AGAR_VERSION}" != "" ]; then
if [ "${prefix_agar}" != "" ]; then
echo "yes ($AGAR_VERSION in ${prefix_agar})"
echo "yes ($AGAR_VERSION in ${prefix_agar})" >>config.log
else
echo "yes ($AGAR_VERSION)"
echo "yes ($AGAR_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$AGAR_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$AGAR_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$AGAR_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 1 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 1 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 5 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 5 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 0 ]; then
MK_VERSION_OK=yes
fi
fi
fi
fi
fi
if [ "${MK_VERSION_OK}" = "no" ]; then
echo '*'
echo '*' >>config.log
echo "* Minimum required version is 1.5.0 (found $AGAR_VERSION)"
echo "* Minimum required version is 1.5.0 (found $AGAR_VERSION)" >>config.log
echo '*'
echo '*' >>config.log
fi
else
if [ "${prefix_agar}" != "" ]; then
echo "no (not in ${prefix_agar})"
echo "no (not in ${prefix_agar})" >>config.log
else
echo 'no'
echo 'no' >>config.log
fi
MK_VERSION_OK="no"
fi
if [ "${MK_VERSION_OK}" = "yes" ]; then
$ECHO_N 'checking whether Agar works...'
$ECHO_N 'checking whether Agar works...' >>config.log
AGAR_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_CFLAGS=`${path}/agar-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_CFLAGS=`${path}/agar-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_LIBS=`${path}/agar-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_LIBS=`${path}/agar-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int
main(int argc, char *argv[])
{
AG_InitCore("conf-test", 0);
AG_InitGraphics(NULL);
AG_EventLoop();
AG_Quit();
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${AGAR_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${AGAR_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_AGAR=yes
bb_o=$bb_incdir/have_agar.h
echo '#ifndef HAVE_AGAR' >$bb_o
echo "#define HAVE_AGAR \"$HAVE_AGAR\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_AGAR\"] = \"$HAVE_AGAR\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_AGAR=no
echo '#undef HAVE_AGAR' >$bb_incdir/have_agar.h
echo 'hdefs["HAVE_AGAR"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_AGAR}" = "yes" ]; then
bb_o=$bb_incdir/agar_cflags.h
echo '#ifndef AGAR_CFLAGS' >$bb_o
echo "#define AGAR_CFLAGS \"$AGAR_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_CFLAGS\"] = \"$AGAR_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/agar_libs.h
echo '#ifndef AGAR_LIBS' >$bb_o
echo "#define AGAR_LIBS \"$AGAR_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_LIBS\"] = \"$AGAR_LIBS\"" >>configure.lua
else
echo '#undef AGAR_CFLAGS' >$bb_incdir/agar_cflags.h
echo 'hdefs["AGAR_CFLAGS"] = nil' >>configure.lua
AGAR_CFLAGS=""
echo '#undef AGAR_LIBS' >$bb_incdir/agar_libs.h
echo 'hdefs["AGAR_LIBS"] = nil' >>configure.lua
AGAR_LIBS=""
fi
else
HAVE_AGAR="no"
AGAR_CFLAGS=""
AGAR_LIBS=""
echo '#undef HAVE_AGAR' >$bb_incdir/have_agar.h
echo 'hdefs["HAVE_AGAR"] = nil' >>configure.lua
echo '#undef AGAR_CFLAGS' >$bb_incdir/agar_cflags.h
echo 'hdefs["AGAR_CFLAGS"] = nil' >>configure.lua
echo '#undef AGAR_LIBS' >$bb_incdir/agar_libs.h
echo 'hdefs["AGAR_LIBS"] = nil' >>configure.lua
fi
# END agar
if [ "${HAVE_AGAR}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo "* $PACKAGE requires Agar (version 1.5.0 or newer)."
echo "* $PACKAGE requires Agar (version 1.5.0 or newer)." >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar not found"
exit 1
fi
if [ "${MK_VERSION_OK}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires agar version >= 1.5.0,'
echo '* This software requires agar version >= 1.5.0,' >>config.log
echo '* please update that package and try again.'
echo '* please update that package and try again.' >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar version mismatch"
exit 1
fi
$ECHO_N 'checking for Agar-Math...'
$ECHO_N 'checking for Agar-Math...' >>config.log
# BEGIN agar-math(1.5.0 ${prefix_agar})
AGAR_MATH_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-math-config" ]; then
AGAR_MATH_VERSION=`${path}/agar-math-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config"
break
elif [ -e "${path}/agar-math-config.exe" ]; then
AGAR_MATH_VERSION=`${path}/agar-math-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config.exe"
break
fi
done
IFS=$bb_save_IFS
if [ "${AGAR_MATH_VERSION}" != "" ]; then
if [ "${prefix_agar}" != "" ]; then
echo "yes ($AGAR_MATH_VERSION in ${prefix_agar})"
echo "yes ($AGAR_MATH_VERSION in ${prefix_agar})" >>config.log
else
echo "yes ($AGAR_MATH_VERSION)"
echo "yes ($AGAR_MATH_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$AGAR_MATH_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$AGAR_MATH_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$AGAR_MATH_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 1 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 1 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 5 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 5 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 0 ]; then
MK_VERSION_OK=yes
fi
fi
fi
fi
fi
if [ "${MK_VERSION_OK}" = "no" ]; then
echo '*'
echo '*' >>config.log
echo "* Minimum required version is 1.5.0 (found $AGAR_MATH_VERSION)"
echo "* Minimum required version is 1.5.0 (found $AGAR_MATH_VERSION)" >>config.log
echo '*'
echo '*' >>config.log
fi
else
if [ "${prefix_agar}" != "" ]; then
echo "no (not in ${prefix_agar})"
echo "no (not in ${prefix_agar})" >>config.log
else
echo 'no'
echo 'no' >>config.log
fi
MK_VERSION_OK="no"
fi
if [ "${MK_VERSION_OK}" = "yes" ]; then
$ECHO_N 'checking whether Agar-Math works...'
$ECHO_N 'checking whether Agar-Math works...' >>config.log
AGAR_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_CFLAGS=`${path}/agar-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_CFLAGS=`${path}/agar-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_LIBS=`${path}/agar-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_LIBS=`${path}/agar-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_MATH_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-math-config" ]; then
AGAR_MATH_CFLAGS=`${path}/agar-math-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config"
break
elif [ -e "${path}/agar-math-config.exe" ]; then
AGAR_MATH_CFLAGS=`${path}/agar-math-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_MATH_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-math-config" ]; then
AGAR_MATH_LIBS=`${path}/agar-math-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config"
break
elif [ -e "${path}/agar-math-config.exe" ]; then
AGAR_MATH_LIBS=`${path}/agar-math-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-math-config.exe"
break
fi
done
IFS=$bb_save_IFS
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
M_Matrix *A = M_New(2,2);
AG_InitCore("test", 0);
M_InitSubsystem();
M_SetIdentity(A);
AG_Destroy();
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${AGAR_MATH_CFLAGS} ${AGAR_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${AGAR_MATH_LIBS} ${AGAR_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_AGAR_MATH=yes
bb_o=$bb_incdir/have_agar_math.h
echo '#ifndef HAVE_AGAR_MATH' >$bb_o
echo "#define HAVE_AGAR_MATH \"$HAVE_AGAR_MATH\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_AGAR_MATH\"] = \"$HAVE_AGAR_MATH\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_AGAR_MATH=no
echo '#undef HAVE_AGAR_MATH' >$bb_incdir/have_agar_math.h
echo 'hdefs["HAVE_AGAR_MATH"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_AGAR_MATH}" = "yes" ]; then
bb_o=$bb_incdir/agar_math_cflags.h
echo '#ifndef AGAR_MATH_CFLAGS' >$bb_o
echo "#define AGAR_MATH_CFLAGS \"$AGAR_MATH_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_MATH_CFLAGS\"] = \"$AGAR_MATH_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/agar_math_libs.h
echo '#ifndef AGAR_MATH_LIBS' >$bb_o
echo "#define AGAR_MATH_LIBS \"$AGAR_MATH_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_MATH_LIBS\"] = \"$AGAR_MATH_LIBS\"" >>configure.lua
else
echo '#undef AGAR_MATH_CFLAGS' >$bb_incdir/agar_math_cflags.h
echo 'hdefs["AGAR_MATH_CFLAGS"] = nil' >>configure.lua
AGAR_MATH_CFLAGS=""
echo '#undef AGAR_MATH_LIBS' >$bb_incdir/agar_math_libs.h
echo 'hdefs["AGAR_MATH_LIBS"] = nil' >>configure.lua
AGAR_MATH_LIBS=""
fi
else
HAVE_AGAR_MATH="no"
AGAR_MATH_CFLAGS=""
AGAR_MATH_LIBS=""
echo '#undef HAVE_AGAR_MATH' >$bb_incdir/have_agar_math.h
echo 'hdefs["HAVE_AGAR_MATH"] = nil' >>configure.lua
echo '#undef AGAR_MATH_CFLAGS' >$bb_incdir/agar_math_cflags.h
echo 'hdefs["AGAR_MATH_CFLAGS"] = nil' >>configure.lua
echo '#undef AGAR_MATH_LIBS' >$bb_incdir/agar_math_libs.h
echo 'hdefs["AGAR_MATH_LIBS"] = nil' >>configure.lua
fi
# END agar-math
if [ "${HAVE_AGAR_MATH}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo "* $PACKAGE requires Agar-Math (version 1.5.0 or newer)."
echo "* $PACKAGE requires Agar-Math (version 1.5.0 or newer)." >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar-math not found"
exit 1
fi
if [ "${MK_VERSION_OK}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires agar-math version >= 1.5.0,'
echo '* This software requires agar-math version >= 1.5.0,' >>config.log
echo '* please update that package and try again.'
echo '* please update that package and try again.' >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar-math version mismatch"
exit 1
fi
$ECHO_N 'checking for Agar-VG...'
$ECHO_N 'checking for Agar-VG...' >>config.log
# BEGIN agar-vg(1.5.0 ${prefix_agar})
AGAR_VG_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-vg-config" ]; then
AGAR_VG_VERSION=`${path}/agar-vg-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config"
break
elif [ -e "${path}/agar-vg-config.exe" ]; then
AGAR_VG_VERSION=`${path}/agar-vg-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config.exe"
break
fi
done
IFS=$bb_save_IFS
if [ "${AGAR_VG_VERSION}" != "" ]; then
if [ "${prefix_agar}" != "" ]; then
echo "yes ($AGAR_VG_VERSION in ${prefix_agar})"
echo "yes ($AGAR_VG_VERSION in ${prefix_agar})" >>config.log
else
echo "yes ($AGAR_VG_VERSION)"
echo "yes ($AGAR_VG_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$AGAR_VG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$AGAR_VG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$AGAR_VG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 1 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 1 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 5 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 5 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 0 ]; then
MK_VERSION_OK=yes
fi
fi
fi
fi
fi
if [ "${MK_VERSION_OK}" = "no" ]; then
echo '*'
echo '*' >>config.log
echo "* Minimum required version is 1.5.0 (found $AGAR_VG_VERSION)"
echo "* Minimum required version is 1.5.0 (found $AGAR_VG_VERSION)" >>config.log
echo '*'
echo '*' >>config.log
fi
else
if [ "${prefix_agar}" != "" ]; then
echo "no (not in ${prefix_agar})"
echo "no (not in ${prefix_agar})" >>config.log
else
echo 'no'
echo 'no' >>config.log
fi
MK_VERSION_OK="no"
fi
if [ "${MK_VERSION_OK}" = "yes" ]; then
$ECHO_N 'checking whether agar-vg works...'
$ECHO_N 'checking whether agar-vg works...' >>config.log
AGAR_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_CFLAGS=`${path}/agar-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_CFLAGS=`${path}/agar-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-config" ]; then
AGAR_LIBS=`${path}/agar-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config"
break
elif [ -e "${path}/agar-config.exe" ]; then
AGAR_LIBS=`${path}/agar-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_VG_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-vg-config" ]; then
AGAR_VG_CFLAGS=`${path}/agar-vg-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config"
break
elif [ -e "${path}/agar-vg-config.exe" ]; then
AGAR_VG_CFLAGS=`${path}/agar-vg-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config.exe"
break
fi
done
IFS=$bb_save_IFS
AGAR_VG_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/agar-vg-config" ]; then
AGAR_VG_LIBS=`${path}/agar-vg-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config"
break
elif [ -e "${path}/agar-vg-config.exe" ]; then
AGAR_VG_LIBS=`${path}/agar-vg-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/agar-vg-config.exe"
break
fi
done
IFS=$bb_save_IFS
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
VG vg;
VG_Init(&vg, 0);
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${AGAR_VG_CFLAGS} ${AGAR_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${AGAR_VG_LIBS} ${AGAR_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_AGAR_VG=yes
bb_o=$bb_incdir/have_agar_vg.h
echo '#ifndef HAVE_AGAR_VG' >$bb_o
echo "#define HAVE_AGAR_VG \"$HAVE_AGAR_VG\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_AGAR_VG\"] = \"$HAVE_AGAR_VG\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_AGAR_VG=no
echo '#undef HAVE_AGAR_VG' >$bb_incdir/have_agar_vg.h
echo 'hdefs["HAVE_AGAR_VG"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_AGAR_VG}" = "yes" ]; then
bb_o=$bb_incdir/agar_vg_cflags.h
echo '#ifndef AGAR_VG_CFLAGS' >$bb_o
echo "#define AGAR_VG_CFLAGS \"$AGAR_VG_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_VG_CFLAGS\"] = \"$AGAR_VG_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/agar_vg_libs.h
echo '#ifndef AGAR_VG_LIBS' >$bb_o
echo "#define AGAR_VG_LIBS \"$AGAR_VG_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"AGAR_VG_LIBS\"] = \"$AGAR_VG_LIBS\"" >>configure.lua
else
echo '#undef AGAR_VG_CFLAGS' >$bb_incdir/agar_vg_cflags.h
echo 'hdefs["AGAR_VG_CFLAGS"] = nil' >>configure.lua
AGAR_VG_CFLAGS=""
echo '#undef AGAR_VG_LIBS' >$bb_incdir/agar_vg_libs.h
echo 'hdefs["AGAR_VG_LIBS"] = nil' >>configure.lua
AGAR_VG_LIBS=""
fi
else
HAVE_AGAR_VG="no"
AGAR_VG_CFLAGS=""
AGAR_VG_LIBS=""
echo '#undef HAVE_AGAR_VG' >$bb_incdir/have_agar_vg.h
echo 'hdefs["HAVE_AGAR_VG"] = nil' >>configure.lua
echo '#undef AGAR_VG_CFLAGS' >$bb_incdir/agar_vg_cflags.h
echo 'hdefs["AGAR_VG_CFLAGS"] = nil' >>configure.lua
echo '#undef AGAR_VG_LIBS' >$bb_incdir/agar_vg_libs.h
echo 'hdefs["AGAR_VG_LIBS"] = nil' >>configure.lua
fi
# END agar-vg
if [ "${HAVE_AGAR_VG}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo "* $PACKAGE requires Agar-VG (version 1.5.0 or newer)."
echo "* $PACKAGE requires Agar-VG (version 1.5.0 or newer)." >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar-vg not found"
exit 1
fi
if [ "${MK_VERSION_OK}" != "yes" ]; then
echo '* '
echo '* ' >>config.log
echo '* This software requires agar-vg version >= 1.5.0,'
echo '* This software requires agar-vg version >= 1.5.0,' >>config.log
echo '* please update that package and try again.'
echo '* please update that package and try again.' >>config.log
echo '* WWW: http://libagar.org'
echo '* WWW: http://libagar.org' >>config.log
echo '* '
echo '* ' >>config.log
echo "Required dependency agar-vg version mismatch"
exit 1
fi
if [ "${with_ode}" != "no" ]
then
$ECHO_N 'checking for Open Dynamics Engine...'
$ECHO_N 'checking for Open Dynamics Engine...' >>config.log
# BEGIN ode(0 ${prefix_ode})
ODE_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/ode-config" ]; then
ODE_VERSION=`${path}/ode-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config"
break
elif [ -e "${path}/ode-config.exe" ]; then
ODE_VERSION=`${path}/ode-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config.exe"
break
fi
done
IFS=$bb_save_IFS
ODE_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/ode-config" ]; then
ODE_CFLAGS=`${path}/ode-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config"
break
elif [ -e "${path}/ode-config.exe" ]; then
ODE_CFLAGS=`${path}/ode-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config.exe"
break
fi
done
IFS=$bb_save_IFS
ODE_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -e "${path}/ode-config" ]; then
ODE_LIBS=`${path}/ode-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config"
break
elif [ -e "${path}/ode-config.exe" ]; then
ODE_LIBS=`${path}/ode-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/ode-config.exe"
break
fi
done
IFS=$bb_save_IFS
ODE_LIBS="${ODE_LIBS} -lstdc++ -lm"
if [ "${ODE_VERSION}" != "" ]; then
if [ "${prefix_ode}" != "" ]; then
echo "yes ($ODE_VERSION in ${prefix_ode})"
echo "yes ($ODE_VERSION in ${prefix_ode})" >>config.log
else
echo "yes ($ODE_VERSION)"
echo "yes ($ODE_VERSION)" >>config.log
fi
if [ "${MK_VERSION_OK}" = "no" ]; then
echo '*'
echo '*' >>config.log
echo "* Minimum required version is 0 (found $ODE_VERSION)"
echo "* Minimum required version is 0 (found $ODE_VERSION)" >>config.log
echo '*'
echo '*' >>config.log
fi
else
if [ "${prefix_ode}" != "" ]; then
echo "no (not in ${prefix_ode})"
echo "no (not in ${prefix_ode})" >>config.log
else
echo 'no'
echo 'no' >>config.log
fi
MK_VERSION_OK="no"
fi
if [ "${MK_VERSION_OK}" = "yes" ]; then
$ECHO_N 'checking whether ODE works...'
$ECHO_N 'checking whether ODE works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
dWorldID world;
dJointGroupID jgroup;
world = dWorldCreate();
jgroup = dJointGroupCreate(10000);
dWorldSetGravity(world, 0, 0, -0.5);
dJointGroupDestroy(jgroup);
dWorldDestroy(world);
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${ODE_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${ODE_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_ODE=yes
bb_o=$bb_incdir/have_ode.h
echo '#ifndef HAVE_ODE' >$bb_o
echo "#define HAVE_ODE \"$HAVE_ODE\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_ODE\"] = \"$HAVE_ODE\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_ODE=no
echo '#undef HAVE_ODE' >$bb_incdir/have_ode.h
echo 'hdefs["HAVE_ODE"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_ODE}" = "yes" ]; then
bb_o=$bb_incdir/ode_cflags.h
echo '#ifndef ODE_CFLAGS' >$bb_o
echo "#define ODE_CFLAGS \"$ODE_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"ODE_CFLAGS\"] = \"$ODE_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/ode_libs.h
echo '#ifndef ODE_LIBS' >$bb_o
echo "#define ODE_LIBS \"$ODE_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"ODE_LIBS\"] = \"$ODE_LIBS\"" >>configure.lua
else
echo '#undef ODE_CFLAGS' >$bb_incdir/ode_cflags.h
echo 'hdefs["ODE_CFLAGS"] = nil' >>configure.lua
ODE_CFLAGS=""
echo '#undef ODE_LIBS' >$bb_incdir/ode_libs.h
echo 'hdefs["ODE_LIBS"] = nil' >>configure.lua
ODE_LIBS=""
fi
else
echo '#undef HAVE_ODE' >$bb_incdir/have_ode.h
echo 'hdefs["HAVE_ODE"] = nil' >>configure.lua
fi
# END ode
if [ "${HAVE_ODE}" != "yes" ]
then
if [ "${with_ode}" = "yes" ]
then
echo "*"
echo "* --with-ode was requested, but ODE was not"
echo "* found on this system."
echo "*"
exit 1
else
echo '#undef HAVE_ODE' >$bb_incdir/have_ode.h
echo 'hdefs["HAVE_ODE"] = nil' >>configure.lua
fi
fi
else
echo '#undef HAVE_ODE' >$bb_incdir/have_ode.h
echo 'hdefs["HAVE_ODE"] = nil' >>configure.lua
fi
if [ "${with_cg}" != "no" ]
then
$ECHO_N 'checking for Cg...'
$ECHO_N 'checking for Cg...' >>config.log
# BEGIN cg(0 ${prefix_cg})
CG_CFLAGS=""
CG_LIBS=""
if [ "${prefix_cg}" != "" ]; then
CG_CFLAGS="-I${prefix_cg}/include"
CG_LIBS="-L${prefix_cg}/lib -lCgGL -lCg -lstdc++"
else
if [ -e "/usr/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/include"
fi
if [ -e "/usr/local/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/local/include"
fi
if [ -e "/usr/Cg/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/Cg/include"
fi
if [ -e "/usr/local/Cg/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/local/Cg/include"
fi
if [ -e "/usr/X11R6/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/X11R6/include"
fi
if [ -e "/usr/X11R6/Cg/include/Cg" ]; then
CG_CFLAGS="${CG_CFLAGS} -I/usr/X11R6/Cg/include"
fi
case "${host}" in
*-*-darwin*)
CG_LIBS="-F/System/Library/Frameworks -framework Cg"
;;
x86_64-*-linux*)
CG_LIBS="-L/usr/X11R6/lib64 -L/usr/lib64 -lCgGL -lCg -lstdc++"
;;
*-*-linux*)
CG_LIBS="-L/usr/X11R6/lib -lCgGL -lCg -lstdc++"
;;
*)
CG_LIBS="-lCgGL -lCg -lstdc++"
;;
esac
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
CGcontext context;
CGeffect effect;
CGtechnique technique;
int main(int argc, char *argv[]) {
context = cgCreateContext();
return (0);
}
EOT
$CC $CFLAGS $TEST_CFLAGS ${CG_CFLAGS} ${OPENGL_CFLAGS} ${PTHREADS_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${CG_LIBS} ${OPENGL_LIBS} ${PTHREADS_LIBS} 2>>config.log
if [ "$?" != "0" ]; then
echo "failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo 'yes'
echo 'yes' >>config.log
HAVE_CG=yes
bb_o=$bb_incdir/have_cg.h
echo '#ifndef HAVE_CG' >$bb_o
echo "#define HAVE_CG \"$HAVE_CG\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"HAVE_CG\"] = \"$HAVE_CG\"" >>configure.lua
else
echo 'no'
echo 'no' >>config.log
HAVE_CG=no
echo '#undef HAVE_CG' >$bb_incdir/have_cg.h
echo 'hdefs["HAVE_CG"] = nil' >>configure.lua
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CG}" = "yes" ]; then
bb_o=$bb_incdir/cg_cflags.h
echo '#ifndef CG_CFLAGS' >$bb_o
echo "#define CG_CFLAGS \"$CG_CFLAGS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"CG_CFLAGS\"] = \"$CG_CFLAGS\"" >>configure.lua
bb_o=$bb_incdir/cg_libs.h
echo '#ifndef CG_LIBS' >$bb_o
echo "#define CG_LIBS \"$CG_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
echo "hdefs[\"CG_LIBS\"] = \"$CG_LIBS\"" >>configure.lua
else
echo '#undef CG_CFLAGS' >$bb_incdir/cg_cflags.h
echo 'hdefs["CG_CFLAGS"] = nil' >>configure.lua
CG_CFLAGS=""
echo '#undef CG_LIBS' >$bb_incdir/cg_libs.h
echo 'hdefs["CG_LIBS"] = nil' >>configure.lua
CG_LIBS=""
fi
# END cg
if [ "${HAVE_CG}" != "yes" ]
then
if [ "${with_cg}" = "yes" ]
then
echo "*"
echo "* --with-cg was requested, but Cg was not"
echo "* found on this system."
echo "*"
exit 1
else
echo '#undef HAVE_CG' >$bb_incdir/have_cg.h
echo 'hdefs["HAVE_CG"] = nil' >>configure.lua
fi
fi
else
echo '#undef HAVE_CG' >$bb_incdir/have_cg.h
echo 'hdefs["HAVE_CG"] = nil' >>configure.lua
fi
if [ "${enable_debug}" = "yes" ]
then
CFLAGS="${CFLAGS} -g -DSG_DEBUG"
fi
if [ "${enable_debug_gl}" = "yes" ]
then
CFLAGS="${CFLAGS} -DGL_DEBUG"
fi
if [ "${enable_edition}" != "no" ]
then
CFLAGS="$CFLAGS -DEDITION"
CXXFLAGS="$CXXFLAGS -DEDITION"
fi
if [ ! -e "$BLD/include/freesg" ]; then
mkdir -p "$BLD/include/freesg"
fi
if [ "${includes}" = "link" ]; then
$ECHO_N "linking header files..."
if [ "${SRCDIR}" != "${BLDDIR}" ]; then
(cd ${SRCDIR} && ${PERL} mk/gen-includelinks.pl "${SRCDIR}" "$BLD/include/freesg" 1>>${BLDDIR}/config.log 2>&1)
else
${PERL} mk/gen-includelinks.pl "${SRCDIR}" "$BLD/include/freesg" 1>>config.log 2>&1
fi
if [ $? != 0 ]; then
echo "${PERL} mk/gen-includelinks.pl failed"
exit 1
fi
echo 'done'
else
if [ "${PERL}" = '' ]; then
echo '*'
echo '* The --includes=yes option requires perl, but no perl'
echo '* interpreter was found. If perl is unavailable, please'
echo '* please rerun configure with --includes=link'
echo '*'
exit 1
fi
$ECHO_N "preprocessing header files..."
if [ "${SRCDIR}" != "${BLDDIR}" ]; then
(cd ${SRCDIR} && ${PERL} mk/gen-includes.pl "$BLD/include/freesg" 1>>${BLDDIR}/config.log 2>&1)
else
${PERL} mk/gen-includes.pl "$BLD/include/freesg" 1>>config.log 2>&1
fi
if [ $? != 0 ]; then
echo "${PERL} mk/gen-includes.pl failed"
exit 1
fi
echo 'done'
fi
CFLAGS="$CFLAGS -I$BLD/include"
CXXFLAGS="$CXXFLAGS -I$BLD/include"
CFLAGS="$CFLAGS -I$BLD/include/freesg"
CXXFLAGS="$CXXFLAGS -I$BLD/include/freesg"
CONFIG_CFLAGS="-I${INCLDIR} ${CG_CFLAGS} ${GLU_CFLAGS} ${AGAR_MATH_CFLAGS}"
CONFIG_LIBS=""
if [ "${enable_pe}" != "no" ]
then
SUBDIR_pe="pe"
CONFIG_LIBS="${CONFIG_LIBS} -lfreesg_pe"
fi
if [ "${enable_sk}" != "no" ]
then
SUBDIR_sk="sk"
CONFIG_LIBS="${CONFIG_LIBS} -lfreesg_sk"
fi
if [ "${enable_sg}" != "no" ]
then
SUBDIR_sg="sg"
CONFIG_LIBS="${CONFIG_LIBS} -lfreesg"
fi
config_script_out="freesg-config"
config_script_cflags="-I${INCLDIR} ${CONFIG_CFLAGS}"
config_script_libs="-L${LIBDIR} ${CONFIG_LIBS} ${CG_LIBS} ${GLU_LIBS} ${AGAR_MATH_LIBS}"
cat << EOT > $config_script_out
#!/bin/sh
# Generated by ${PACKAGE}'s BSDBuild-based script.
# BSDBuild 3.2 (http://bsdbuild.hypertriton.com/).
prefix='${PREFIX}'
exec_prefix='${EXEC_PREFIX}'
exec_prefix_set='no'
libdir='${LIBDIR}'
usage='\
Usage: $config_script_out [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]'
if test \$# -eq 0; then
echo "\${usage}" 1>&2
exit 1
fi
while test \$# -gt 0; do
case "\$1" in
-*=*)
optarg=\`echo "\$1" | LC_ALL='C' sed 's/[-_a-zA-Z0-9]*=//'\`
;;
*)
optarg=
;;
esac
case \$1 in
--prefix=*)
prefix=\$optarg
if test \$exec_prefix_set = no ; then
exec_prefix=\$optarg
fi
;;
--prefix)
echo "\$prefix"
;;
--exec-prefix=*)
exec_prefix=\$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo "\$exec_prefix"
;;
--version)
echo '${VERSION}'
;;
--cflags)
echo '$config_script_cflags'
;;
--libs | --static-libs)
echo '$config_script_libs'
;;
*)
echo "\${usage}" 1>&2
exit 1
;;
esac
shift
done
EOT
AVAIL_CONFIGSCRIPTS="$AVAIL_CONFIGSCRIPTS freesg-config"
if [ "${enable_rg}" != "no" ]
then
SUBDIR_rg="rg"
fi
config_script_out="freesg-rg-config"
config_script_cflags="-I${INCLDIR}"
config_script_libs="-L${LIBDIR} -lfreesg_rg"
cat << EOT > $config_script_out
#!/bin/sh
# Generated by ${PACKAGE}'s BSDBuild-based script.
# BSDBuild 3.2 (http://bsdbuild.hypertriton.com/).
prefix='${PREFIX}'
exec_prefix='${EXEC_PREFIX}'
exec_prefix_set='no'
libdir='${LIBDIR}'
usage='\
Usage: $config_script_out [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]'
if test \$# -eq 0; then
echo "\${usage}" 1>&2
exit 1
fi
while test \$# -gt 0; do
case "\$1" in
-*=*)
optarg=\`echo "\$1" | LC_ALL='C' sed 's/[-_a-zA-Z0-9]*=//'\`
;;
*)
optarg=
;;
esac
case \$1 in
--prefix=*)
prefix=\$optarg
if test \$exec_prefix_set = no ; then
exec_prefix=\$optarg
fi
;;
--prefix)
echo "\$prefix"
;;
--exec-prefix=*)
exec_prefix=\$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo "\$exec_prefix"
;;
--version)
echo '${VERSION}'
;;
--cflags)
echo '$config_script_cflags'
;;
--libs | --static-libs)
echo '$config_script_libs'
;;
*)
echo "\${usage}" 1>&2
exit 1
;;
esac
shift
done
EOT
AVAIL_CONFIGSCRIPTS="$AVAIL_CONFIGSCRIPTS freesg-rg-config"
if [ "${enable_map}" != "no" ]
then
SUBDIR_map="map"
fi
config_script_out="freesg-map-config"
config_script_cflags="-I${INCLDIR}"
config_script_libs="-L${LIBDIR} -lfreesg_map"
cat << EOT > $config_script_out
#!/bin/sh
# Generated by ${PACKAGE}'s BSDBuild-based script.
# BSDBuild 3.2 (http://bsdbuild.hypertriton.com/).
prefix='${PREFIX}'
exec_prefix='${EXEC_PREFIX}'
exec_prefix_set='no'
libdir='${LIBDIR}'
usage='\
Usage: $config_script_out [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]'
if test \$# -eq 0; then
echo "\${usage}" 1>&2
exit 1
fi
while test \$# -gt 0; do
case "\$1" in
-*=*)
optarg=\`echo "\$1" | LC_ALL='C' sed 's/[-_a-zA-Z0-9]*=//'\`
;;
*)
optarg=
;;
esac
case \$1 in
--prefix=*)
prefix=\$optarg
if test \$exec_prefix_set = no ; then
exec_prefix=\$optarg
fi
;;
--prefix)
echo "\$prefix"
;;
--exec-prefix=*)
exec_prefix=\$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo "\$exec_prefix"
;;
--version)
echo '${VERSION}'
;;
--cflags)
echo '$config_script_cflags'
;;
--libs | --static-libs)
echo '$config_script_libs'
;;
*)
echo "\${usage}" 1>&2
exit 1
;;
esac
shift
done
EOT
AVAIL_CONFIGSCRIPTS="$AVAIL_CONFIGSCRIPTS freesg-map-config"
echo "AGAR_CFLAGS=$AGAR_CFLAGS" >>Makefile.config
echo "mdefs[\"AGAR_CFLAGS\"] = \"$AGAR_CFLAGS\"" >>configure.lua
echo "AGAR_LIBS=$AGAR_LIBS" >>Makefile.config
echo "mdefs[\"AGAR_LIBS\"] = \"$AGAR_LIBS\"" >>configure.lua
echo "AGAR_MATH_CFLAGS=$AGAR_MATH_CFLAGS" >>Makefile.config
echo "mdefs[\"AGAR_MATH_CFLAGS\"] = \"$AGAR_MATH_CFLAGS\"" >>configure.lua
echo "AGAR_MATH_LIBS=$AGAR_MATH_LIBS" >>Makefile.config
echo "mdefs[\"AGAR_MATH_LIBS\"] = \"$AGAR_MATH_LIBS\"" >>configure.lua
echo "AGAR_VG_CFLAGS=$AGAR_VG_CFLAGS" >>Makefile.config
echo "mdefs[\"AGAR_VG_CFLAGS\"] = \"$AGAR_VG_CFLAGS\"" >>configure.lua
echo "AGAR_VG_LIBS=$AGAR_VG_LIBS" >>Makefile.config
echo "mdefs[\"AGAR_VG_LIBS\"] = \"$AGAR_VG_LIBS\"" >>configure.lua
echo "AVAIL_CONFIGSCRIPTS=$AVAIL_CONFIGSCRIPTS" >>Makefile.config
echo "mdefs[\"AVAIL_CONFIGSCRIPTS\"] = \"$AVAIL_CONFIGSCRIPTS\"" >>configure.lua
echo "BINDIR=$BINDIR" >>Makefile.config
echo "mdefs[\"BINDIR\"] = \"$BINDIR\"" >>configure.lua
echo "CC=$CC" >>Makefile.config
echo "mdefs[\"CC\"] = \"$CC\"" >>configure.lua
echo "CC_COMPILE=$CC_COMPILE" >>Makefile.config
echo "mdefs[\"CC_COMPILE\"] = \"$CC_COMPILE\"" >>configure.lua
echo "CFLAGS=$CFLAGS" >>Makefile.config
echo "mdefs[\"CFLAGS\"] = \"$CFLAGS\"" >>configure.lua
echo "CG_CFLAGS=$CG_CFLAGS" >>Makefile.config
echo "mdefs[\"CG_CFLAGS\"] = \"$CG_CFLAGS\"" >>configure.lua
echo "CG_LIBS=$CG_LIBS" >>Makefile.config
echo "mdefs[\"CG_LIBS\"] = \"$CG_LIBS\"" >>configure.lua
echo "CXXFLAGS=$CXXFLAGS" >>Makefile.config
echo "mdefs[\"CXXFLAGS\"] = \"$CXXFLAGS\"" >>configure.lua
echo "DATADIR=$DATADIR" >>Makefile.config
echo "mdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
echo "ENABLE_NLS=$ENABLE_NLS" >>Makefile.config
echo "mdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
echo "EXECSUFFIX=$EXECSUFFIX" >>Makefile.config
echo "mdefs[\"EXECSUFFIX\"] = \"$EXECSUFFIX\"" >>configure.lua
echo "GLU_CFLAGS=$GLU_CFLAGS" >>Makefile.config
echo "mdefs[\"GLU_CFLAGS\"] = \"$GLU_CFLAGS\"" >>configure.lua
echo "GLU_LIBS=$GLU_LIBS" >>Makefile.config
echo "mdefs[\"GLU_LIBS\"] = \"$GLU_LIBS\"" >>configure.lua
echo "HAVE_AGAR=$HAVE_AGAR" >>Makefile.config
echo "mdefs[\"HAVE_AGAR\"] = \"$HAVE_AGAR\"" >>configure.lua
echo "HAVE_AGAR_MATH=$HAVE_AGAR_MATH" >>Makefile.config
echo "mdefs[\"HAVE_AGAR_MATH\"] = \"$HAVE_AGAR_MATH\"" >>configure.lua
echo "HAVE_AGAR_VG=$HAVE_AGAR_VG" >>Makefile.config
echo "mdefs[\"HAVE_AGAR_VG\"] = \"$HAVE_AGAR_VG\"" >>configure.lua
echo "HAVE_ALIGNED_ATTRIBUTE=$HAVE_ALIGNED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_ALIGNED_ATTRIBUTE\"] = \"$HAVE_ALIGNED_ATTRIBUTE\"" >>configure.lua
echo "HAVE_ASPRINTF=$HAVE_ASPRINTF" >>Makefile.config
echo "mdefs[\"HAVE_ASPRINTF\"] = \"$HAVE_ASPRINTF\"" >>configure.lua
echo "HAVE_BOUNDED_ATTRIBUTE=$HAVE_BOUNDED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_BOUNDED_ATTRIBUTE\"] = \"$HAVE_BOUNDED_ATTRIBUTE\"" >>configure.lua
echo "HAVE_CC=$HAVE_CC" >>Makefile.config
echo "mdefs[\"HAVE_CC\"] = \"$HAVE_CC\"" >>configure.lua
echo "HAVE_CC65=$HAVE_CC65" >>Makefile.config
echo "mdefs[\"HAVE_CC65\"] = \"$HAVE_CC65\"" >>configure.lua
echo "HAVE_CC_MCONSOLE=$HAVE_CC_MCONSOLE" >>Makefile.config
echo "mdefs[\"HAVE_CC_MCONSOLE\"] = \"$HAVE_CC_MCONSOLE\"" >>configure.lua
echo "HAVE_CC_MWINDOWS=$HAVE_CC_MWINDOWS" >>Makefile.config
echo "mdefs[\"HAVE_CC_MWINDOWS\"] = \"$HAVE_CC_MWINDOWS\"" >>configure.lua
echo "HAVE_CC_WARNINGS=$HAVE_CC_WARNINGS" >>Makefile.config
echo "mdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
echo "HAVE_CG=$HAVE_CG" >>Makefile.config
echo "mdefs[\"HAVE_CG\"] = \"$HAVE_CG\"" >>configure.lua
echo "HAVE_CONST_ATTRIBUTE=$HAVE_CONST_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_CONST_ATTRIBUTE\"] = \"$HAVE_CONST_ATTRIBUTE\"" >>configure.lua
echo "HAVE_CYGWIN=$HAVE_CYGWIN" >>Makefile.config
echo "mdefs[\"HAVE_CYGWIN\"] = \"$HAVE_CYGWIN\"" >>configure.lua
echo "HAVE_DEPRECATED_ATTRIBUTE=$HAVE_DEPRECATED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_DEPRECATED_ATTRIBUTE\"] = \"$HAVE_DEPRECATED_ATTRIBUTE\"" >>configure.lua
echo "HAVE_FORMAT_ATTRIBUTE=$HAVE_FORMAT_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_FORMAT_ATTRIBUTE\"] = \"$HAVE_FORMAT_ATTRIBUTE\"" >>configure.lua
echo "HAVE_GETTEXT=$HAVE_GETTEXT" >>Makefile.config
echo "mdefs[\"HAVE_GETTEXT\"] = \"$HAVE_GETTEXT\"" >>configure.lua
echo "HAVE_GLU=$HAVE_GLU" >>Makefile.config
echo "mdefs[\"HAVE_GLU\"] = \"$HAVE_GLU\"" >>configure.lua
echo "HAVE_INT64_T=$HAVE_INT64_T" >>Makefile.config
echo "mdefs[\"HAVE_INT64_T\"] = \"$HAVE_INT64_T\"" >>configure.lua
echo "HAVE_LD_NO_UNDEFINED=$HAVE_LD_NO_UNDEFINED" >>Makefile.config
echo "mdefs[\"HAVE_LD_NO_UNDEFINED\"] = \"$HAVE_LD_NO_UNDEFINED\"" >>configure.lua
echo "HAVE_LD_STATIC_LIBGCC=$HAVE_LD_STATIC_LIBGCC" >>Makefile.config
echo "mdefs[\"HAVE_LD_STATIC_LIBGCC\"] = \"$HAVE_LD_STATIC_LIBGCC\"" >>configure.lua
echo "HAVE_LIBOPENGL32=$HAVE_LIBOPENGL32" >>Makefile.config
echo "mdefs[\"HAVE_LIBOPENGL32\"] = \"$HAVE_LIBOPENGL32\"" >>configure.lua
echo "HAVE_MALLOC_ATTRIBUTE=$HAVE_MALLOC_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_MALLOC_ATTRIBUTE\"] = \"$HAVE_MALLOC_ATTRIBUTE\"" >>configure.lua
echo "HAVE_MATH=$HAVE_MATH" >>Makefile.config
echo "mdefs[\"HAVE_MATH\"] = \"$HAVE_MATH\"" >>configure.lua
echo "HAVE_NORETURN_ATTRIBUTE=$HAVE_NORETURN_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_NORETURN_ATTRIBUTE\"] = \"$HAVE_NORETURN_ATTRIBUTE\"" >>configure.lua
echo "HAVE_ODE=$HAVE_ODE" >>Makefile.config
echo "mdefs[\"HAVE_ODE\"] = \"$HAVE_ODE\"" >>configure.lua
echo "HAVE_OPENGL=$HAVE_OPENGL" >>Makefile.config
echo "mdefs[\"HAVE_OPENGL\"] = \"$HAVE_OPENGL\"" >>configure.lua
echo "HAVE_PACKED_ATTRIBUTE=$HAVE_PACKED_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PACKED_ATTRIBUTE\"] = \"$HAVE_PACKED_ATTRIBUTE\"" >>configure.lua
echo "HAVE_PURE_ATTRIBUTE=$HAVE_PURE_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_PURE_ATTRIBUTE\"] = \"$HAVE_PURE_ATTRIBUTE\"" >>configure.lua
echo "HAVE_UNUSED_VARIABLE_ATTRIBUTE=$HAVE_UNUSED_VARIABLE_ATTRIBUTE" >>Makefile.config
echo "mdefs[\"HAVE_UNUSED_VARIABLE_ATTRIBUTE\"] = \"$HAVE_UNUSED_VARIABLE_ATTRIBUTE\"" >>configure.lua
echo "HAVE_VASPRINTF=$HAVE_VASPRINTF" >>Makefile.config
echo "mdefs[\"HAVE_VASPRINTF\"] = \"$HAVE_VASPRINTF\"" >>configure.lua
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 "HAVE___INT64=$HAVE___INT64" >>Makefile.config
echo "mdefs[\"HAVE___INT64\"] = \"$HAVE___INT64\"" >>configure.lua
echo "INCLDIR=$INCLDIR" >>Makefile.config
echo "mdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
echo "LIBDIR=$LIBDIR" >>Makefile.config
echo "mdefs[\"LIBDIR\"] = \"$LIBDIR\"" >>configure.lua
echo "LIBEXECDIR=$LIBEXECDIR" >>Makefile.config
echo "mdefs[\"LIBEXECDIR\"] = \"$LIBEXECDIR\"" >>configure.lua
echo "LIBTOOLOPTS_SHARED=$LIBTOOLOPTS_SHARED" >>Makefile.config
echo "mdefs[\"LIBTOOLOPTS_SHARED\"] = \"$LIBTOOLOPTS_SHARED\"" >>configure.lua
echo "LOCALEDIR=$LOCALEDIR" >>Makefile.config
echo "mdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
echo "MANDIR=$MANDIR" >>Makefile.config
echo "mdefs[\"MANDIR\"] = \"$MANDIR\"" >>configure.lua
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 "MODULEDIR=$MODULEDIR" >>Makefile.config
echo "mdefs[\"MODULEDIR\"] = \"$MODULEDIR\"" >>configure.lua
echo "ODE_CFLAGS=$ODE_CFLAGS" >>Makefile.config
echo "mdefs[\"ODE_CFLAGS\"] = \"$ODE_CFLAGS\"" >>configure.lua
echo "ODE_LIBS=$ODE_LIBS" >>Makefile.config
echo "mdefs[\"ODE_LIBS\"] = \"$ODE_LIBS\"" >>configure.lua
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 "PACKAGE=$PACKAGE" >>Makefile.config
echo "mdefs[\"PACKAGE\"] = \"$PACKAGE\"" >>configure.lua
echo "PATH_SEPARATOR=$PATH_SEPARATOR" >>Makefile.config
echo "mdefs[\"PATH_SEPARATOR\"] = \"$PATH_SEPARATOR\"" >>configure.lua
echo "PKGCONFIG=$PKGCONFIG" >>Makefile.config
echo "mdefs[\"PKGCONFIG\"] = \"$PKGCONFIG\"" >>configure.lua
echo "PKGCONFIG_LIBDIR=$PKGCONFIG_LIBDIR" >>Makefile.config
echo "mdefs[\"PKGCONFIG_LIBDIR\"] = \"$PKGCONFIG_LIBDIR\"" >>configure.lua
echo "PROG_BUNDLE=$PROG_BUNDLE" >>Makefile.config
echo "mdefs[\"PROG_BUNDLE\"] = \"$PROG_BUNDLE\"" >>configure.lua
echo "PROG_CLI_CFLAGS=$PROG_CLI_CFLAGS" >>Makefile.config
echo "mdefs[\"PROG_CLI_CFLAGS\"] = \"$PROG_CLI_CFLAGS\"" >>configure.lua
echo "PROG_CLI_FLAGS=$PROG_CLI_FLAGS" >>Makefile.config
echo "mdefs[\"PROG_CLI_FLAGS\"] = \"$PROG_CLI_FLAGS\"" >>configure.lua
echo "PROG_GUI_CFLAGS=$PROG_GUI_CFLAGS" >>Makefile.config
echo "mdefs[\"PROG_GUI_CFLAGS\"] = \"$PROG_GUI_CFLAGS\"" >>configure.lua
echo "PROG_GUI_FLAGS=$PROG_GUI_FLAGS" >>Makefile.config
echo "mdefs[\"PROG_GUI_FLAGS\"] = \"$PROG_GUI_FLAGS\"" >>configure.lua
echo "PROG_PREFIX=$PROG_PREFIX" >>Makefile.config
echo "mdefs[\"PROG_PREFIX\"] = \"$PROG_PREFIX\"" >>configure.lua
echo "PROG_SUFFIX=$PROG_SUFFIX" >>Makefile.config
echo "mdefs[\"PROG_SUFFIX\"] = \"$PROG_SUFFIX\"" >>configure.lua
echo "PROG_TRANSFORM=$PROG_TRANSFORM" >>Makefile.config
echo "mdefs[\"PROG_TRANSFORM\"] = \"$PROG_TRANSFORM\"" >>configure.lua
echo "RELEASE=$RELEASE" >>Makefile.config
echo "mdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
echo "STATEDIR=$STATEDIR" >>Makefile.config
echo "mdefs[\"STATEDIR\"] = \"$STATEDIR\"" >>configure.lua
echo "SUBDIR_map=$SUBDIR_map" >>Makefile.config
echo "mdefs[\"SUBDIR_map\"] = \"$SUBDIR_map\"" >>configure.lua
echo "SUBDIR_pe=$SUBDIR_pe" >>Makefile.config
echo "mdefs[\"SUBDIR_pe\"] = \"$SUBDIR_pe\"" >>configure.lua
echo "SUBDIR_rg=$SUBDIR_rg" >>Makefile.config
echo "mdefs[\"SUBDIR_rg\"] = \"$SUBDIR_rg\"" >>configure.lua
echo "SUBDIR_sg=$SUBDIR_sg" >>Makefile.config
echo "mdefs[\"SUBDIR_sg\"] = \"$SUBDIR_sg\"" >>configure.lua
echo "SUBDIR_sk=$SUBDIR_sk" >>Makefile.config
echo "mdefs[\"SUBDIR_sk\"] = \"$SUBDIR_sk\"" >>configure.lua
echo "SYSCONFDIR=$SYSCONFDIR" >>Makefile.config
echo "mdefs[\"SYSCONFDIR\"] = \"$SYSCONFDIR\"" >>configure.lua
echo "VERSION=$VERSION" >>Makefile.config
echo "mdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
echo "WNO_UNINITIALIZED=$WNO_UNINITIALIZED" >>Makefile.config
echo "mdefs[\"WNO_UNINITIALIZED\"] = \"$WNO_UNINITIALIZED\"" >>configure.lua
echo "_MK_HAVE_LIMITS_H=$_MK_HAVE_LIMITS_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_LIMITS_H\"] = \"$_MK_HAVE_LIMITS_H\"" >>configure.lua
echo "_MK_HAVE_STDINT_H=$_MK_HAVE_STDINT_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_STDINT_H\"] = \"$_MK_HAVE_STDINT_H\"" >>configure.lua
echo "_MK_HAVE_STDLIB_H=$_MK_HAVE_STDLIB_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_STDLIB_H\"] = \"$_MK_HAVE_STDLIB_H\"" >>configure.lua
echo "_MK_HAVE_SYS_QUEUE_H=$_MK_HAVE_SYS_QUEUE_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_SYS_QUEUE_H\"] = \"$_MK_HAVE_SYS_QUEUE_H\"" >>configure.lua
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 "_MK_HAVE_UNISTD_H=$_MK_HAVE_UNISTD_H" >>Makefile.config
echo "mdefs[\"_MK_HAVE_UNISTD_H\"] = \"$_MK_HAVE_UNISTD_H\"" >>configure.lua
if [ "${srcdir}" != '' ]; then
$ECHO_N "preparing build environment (source in ${srcdir})..."
${PERL} ${SRC}/mk/mkconcurrent.pl ${SRC}
if [ $? != 0 ]; then
exit 1;
fi
echo 'ok'
fi
echo '*'
echo '* Configuration successful. Use the "make" command to compile,'
echo '* and complete the installation using "make install".'
echo '*'