#!/bin/sh
#
# Do not edit!
#
# This file was generated from configure.in. To regenerate it properly, get
# BSDBuild 3.2 or later from https://bsdbuild.hypertriton.com/ and use:
#
# $ mkconfigure < configure.in > configure
#
echo 'BSDBuild 3.2 '
echo '# BSDBuild 3.2 ' > config.log
echo '# ex:syn=sh' >> config.log
echo '#!/bin/sh' >config.status
echo >>config.status
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
SH='sh'
for path in $PATH; do
if [ -x "${path}/sh" -a ! -d "${path}/sh" ]; then
SH="${path}/sh"
break
elif [ -e "${path}/sh.exe" ]; then
SH="${path}/sh.exe"
break
fi
done
PERL=''
for path in $PATH; do
if [ -x "${path}/perl" -a ! -d "${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" -a ! -d "${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/agar/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-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 Manual page entries for all functions [no]'
echo ' --with-manpages Generate manual pages [yes]'
echo ''
echo 'Libraries to build:'
echo ' --enable-au AU: Audio and sound toolkit [no]'
echo ' --enable-gui GUI: The Agar GUI library [yes]'
echo ' --enable-map MAP: 2D tile engine [no]'
echo ' --enable-math MATH: Math library and advanced rendering [yes]'
echo ' --enable-micro MA: Micro-Agar GUI library [no]'
echo ' --enable-net NET: Network interface library [yes]'
echo ' --enable-sg SG: Scene graph and 3D engine [yes]'
echo ' --enable-sk SK: Sketch and constraint solver [yes]'
echo ' --enable-vg VG: Simple 2D vector graphics [yes]'
echo ''
echo 'Global Agar options:'
echo ' --with-memory-model=(S|M|L) Select Agar memory model [auto]'
echo ' --with-float Floating-point support [auto]'
echo ' --enable-shared Build shared libraries [check]'
echo ' --enable-type-safety Run-time type safety checks [no]'
echo ' --enable-debug Debug build (implies type-safety) [no]'
echo ' --enable-debug-surfaces Trace AG_Surface operations [no]'
echo ' --enable-legacy Deprecated interfaces [yes]'
echo ' --enable-threads Thread safety [check]'
echo ' --enable-warnings Suggested compiler warnings [no]'
echo ' --with-pthreads[=PREFIX] POSIX Threads support [check]'
echo ' --with-attributes Compiler attributes and annotations [yes]'
echo ' --with-inline Inline functions [yes]'
echo ''
echo 'Options specific to CORE library:'
echo ' --enable-ansi-color Produce colorized output [yes]'
echo ' --enable-dso Dynamically loaded modules [yes]'
echo ' --enable-exec The AG_Execute(3) interface [yes]'
echo ' --enable-event-loop The standard AG_EventLoop(3) [yes]'
echo ' --enable-namespaces Namespaces for object classes [yes]'
echo ' --enable-named-args Named AG_Event arguments [yes]'
echo ' --enable-serialization File I/O and serialization [yes]'
echo ' --enable-string AG_Printf(3) formatting engine [yes]'
echo ' --enable-timers The AG_Timer(3) interface [yes]'
echo ' --enable-unicode Support for Unicode [yes]'
echo ' --enable-user The AG_User(3) interface [yes]'
echo ' --enable-verbosity Verbose error messages [yes]'
echo ' --with-db[45][=PREFIX] AG_Db: Berkeley DB backend [no]'
echo ' --with-mysql[=PREFIX] AG_Db: MySQL backend [no]'
echo ' --with-iconv[=PREFIX] Character set conversion [check]'
echo ' --with-inline-byteswap Inline endianness swaps [yes]'
echo ' --with-inline-error Inline malloc() wrappers [yes]'
echo ' --with-inline-event Inline event argument accessors [yes]'
echo ' --with-inline-io Inline serialization frontends [yes]'
echo ' --with-inline-object Inline some AG_Object calls [yes]'
echo ' --with-inline-string Inline some string functions [yes]'
echo ' --with-inline-tbl Inline some AG_Tbl functions [yes]'
echo ' --with-inline-threads Inline AG_Threads functions [yes]'
echo ' --with-inline-variable Inline some AG_Variable calls [yes]'
echo ''
echo 'Options specific to MATH library:'
echo ' --with--fp Precision (single|double|quad) [double]'
echo ' --with-altivec[=inline] AltiVec-optimized routines [check]'
echo ' --with-sse[=inline] SSE-optimized routines [check]'
echo ' --with-sse[234] SSE2 SSE3 SSE4 routines [check]'
echo ''
echo 'Options specific to NET library:'
echo ' --enable-web HTTP/1.1 application server [no]'
echo ' --with-z[=PREFIX] zlib compression library [check]'
echo ''
echo 'Options specific to GUI library:'
echo ' --enable-widgets The standard widget library [yes]'
echo ' --enable-wm-hints Interface with window managers [yes]'
echo ' --with-freetype[=PREFIX] Enable FreeType support [check]'
echo ' --with-fontconfig[=PREFIX] Enable Fontconfig support [check]'
echo ' --with-gl[=PREFIX] OpenGL rendering support [check]'
echo ' --with-jpeg[=PREFIX] Built-in JPEG image support [check]'
echo ' --with-png[=PREFIX] Built-in PNG image support [check]'
echo ' --with-x[=PREFIX] Build with X windows support [check]'
echo ' --with-xinerama[=PREFIX] Build with Xinerama support [check]'
echo ' --with-glx[=PREFIX] Enable accelerated X driver [check]'
echo ' --with-sdl[=PREFIX] Enable SDL 1.2 driver [check]'
echo ' --with-sdl2[=PREFIX] Enable SDL 2.0 driver [check]'
echo ' --with-wgl Enable MS Windows driver [check]'
echo ' --with-cocoa Enable MacOS X Cocoa driver [check]'
echo ' --with-inline-surface Inline pixel access routines [yes]'
echo ' --with-inline-widget Inline some AG_Widget functions [yes]'
echo ''
echo 'Options specific to AU library:'
echo ' --with-sndfile[=PREFIX] Enable sndfile support [check]'
echo ' --with-portaudio[=PREFIX] Enable portaudio driver [check]'
echo ''
echo 'Options specific to SG library:'
echo ' --with-glu[=PREFIX] OpenGL Utility Library (GLU) [check]'
echo ''
echo 'Some influential environment variables:'
echo ' ADA Ada compiler command'
echo ' ADABFLAGS Ada binder flags'
echo ' ADABIND Ada binder command'
echo ' ADAFLAGS Ada compiler flags'
echo ' ADALFLAGS Ada linker flags'
echo ' ADALINK Ada linker command'
echo ' ADAMKDEP Ada dependency output command'
echo ' CC C compiler command'
echo ' CFLAGS C compiler flags'
echo ' CPP C preprocessor'
echo ' CPPFLAGS C preprocessor flags'
echo ' CXX C++ compiler command'
echo ' CXXCPP C++ preprocessor'
echo ' CXXFLAGS C++ compiler 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 "ECHO_N=${ECHO_N}" >> Makefile.config
if [ "${SUDO}" != "" ]; then
if [ -e "${PREFIX}" ]; then
bb_test_file="${PREFIX}/bsdbuild_test_file$$"
$ECHO_N "# checking the writeability of ${PREFIX}..." >>config.log
echo "echo 'Test' > '${bb_test_file}'" > conftest$$.sh
${SH} conftest$$.sh 2>/dev/null
if [ -e "${bb_test_file}" ]; then
rm -f "${bb_test_file}"
echo "yes (ignoring SUDO)" >>config.log
echo "SUDO=" >> Makefile.config
else
echo "no (honoring ${SUDO})" >>config.log
fi
rm -f conftest$$.sh
fi
fi
$ECHO_N 'env ' >>config.log
$ECHO_N 'env ' >>config.status
if [ "$ADA" != "" ]; then
$ECHO_N 'ADA="' >> config.log
$ECHO_N 'ADA="' >> config.status
$ECHO_N "${ADA}" >> config.log
$ECHO_N "${ADA}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADABFLAGS" != "" ]; then
$ECHO_N 'ADABFLAGS="' >> config.log
$ECHO_N 'ADABFLAGS="' >> config.status
$ECHO_N "${ADABFLAGS}" >> config.log
$ECHO_N "${ADABFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADABIND" != "" ]; then
$ECHO_N 'ADABIND="' >> config.log
$ECHO_N 'ADABIND="' >> config.status
$ECHO_N "${ADABIND}" >> config.log
$ECHO_N "${ADABIND}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADAFLAGS" != "" ]; then
$ECHO_N 'ADAFLAGS="' >> config.log
$ECHO_N 'ADAFLAGS="' >> config.status
$ECHO_N "${ADAFLAGS}" >> config.log
$ECHO_N "${ADAFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADALFLAGS" != "" ]; then
$ECHO_N 'ADALFLAGS="' >> config.log
$ECHO_N 'ADALFLAGS="' >> config.status
$ECHO_N "${ADALFLAGS}" >> config.log
$ECHO_N "${ADALFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADALINK" != "" ]; then
$ECHO_N 'ADALINK="' >> config.log
$ECHO_N 'ADALINK="' >> config.status
$ECHO_N "${ADALINK}" >> config.log
$ECHO_N "${ADALINK}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$ADAMKDEP" != "" ]; then
$ECHO_N 'ADAMKDEP="' >> config.log
$ECHO_N 'ADAMKDEP="' >> config.status
$ECHO_N "${ADAMKDEP}" >> config.log
$ECHO_N "${ADAMKDEP}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CC" != "" ]; then
$ECHO_N 'CC="' >> config.log
$ECHO_N 'CC="' >> config.status
$ECHO_N "${CC}" >> config.log
$ECHO_N "${CC}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CFLAGS" != "" ]; then
$ECHO_N 'CFLAGS="' >> config.log
$ECHO_N 'CFLAGS="' >> config.status
$ECHO_N "${CFLAGS}" >> config.log
$ECHO_N "${CFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CPP" != "" ]; then
$ECHO_N 'CPP="' >> config.log
$ECHO_N 'CPP="' >> config.status
$ECHO_N "${CPP}" >> config.log
$ECHO_N "${CPP}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CPPFLAGS" != "" ]; then
$ECHO_N 'CPPFLAGS="' >> config.log
$ECHO_N 'CPPFLAGS="' >> config.status
$ECHO_N "${CPPFLAGS}" >> config.log
$ECHO_N "${CPPFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CXX" != "" ]; then
$ECHO_N 'CXX="' >> config.log
$ECHO_N 'CXX="' >> config.status
$ECHO_N "${CXX}" >> config.log
$ECHO_N "${CXX}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CXXCPP" != "" ]; then
$ECHO_N 'CXXCPP="' >> config.log
$ECHO_N 'CXXCPP="' >> config.status
$ECHO_N "${CXXCPP}" >> config.log
$ECHO_N "${CXXCPP}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$CXXFLAGS" != "" ]; then
$ECHO_N 'CXXFLAGS="' >> config.log
$ECHO_N 'CXXFLAGS="' >> config.status
$ECHO_N "${CXXFLAGS}" >> config.log
$ECHO_N "${CXXFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$LDFLAGS" != "" ]; then
$ECHO_N 'LDFLAGS="' >> config.log
$ECHO_N 'LDFLAGS="' >> config.status
$ECHO_N "${LDFLAGS}" >> config.log
$ECHO_N "${LDFLAGS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
if [ "$LIBS" != "" ]; then
$ECHO_N 'LIBS="' >> config.log
$ECHO_N 'LIBS="' >> config.status
$ECHO_N "${LIBS}" >> config.log
$ECHO_N "${LIBS}" >> config.status
$ECHO_N '" ' >> config.log
$ECHO_N '" ' >> config.status
fi
$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/agar/config" ]; then
echo '* Overwriting $BLD/include/agar/config directory'
rm -fR "$BLD/include/agar/config"
fi
mkdir -p "$BLD/include/agar/config"
if [ $? != 0 ]; then
echo 'Could not create $BLD/include/agar/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_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
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
else
ENABLE_NLS="no"
HAVE_GETTEXT="no"
echo '#undef ENABLE_NLS' >$bb_incdir/enable_nls.h
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}" != '' -a "${with_libtool}" != "no" ]; 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
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
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
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
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
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
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
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
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
if [ "${mandir}" != '' ]; then
MANDIR="${mandir}"
MANDIR_SPECIFIED='yes'
else
case "${host}" in
*-*-darwin*)
MANDIR="${PREFIX}/share/man"
;;
*)
MANDIR="${PREFIX}/man"
;;
esac
fi
bb_o=$bb_incdir/mandir.h
echo '#ifndef MANDIR' >$bb_o
echo "#define MANDIR \"$MANDIR\"" >>$bb_o
echo '#endif' >>$bb_o
PACKAGE="Agar"
bb_o=$bb_incdir/package.h
echo '#ifndef PACKAGE' >$bb_o
echo "#define PACKAGE \"$PACKAGE\"" >>$bb_o
echo '#endif' >>$bb_o
VERSION="1.7.1"
bb_o=$bb_incdir/version.h
echo '#ifndef VERSION' >$bb_o
echo "#define VERSION \"$VERSION\"" >>$bb_o
echo '#endif' >>$bb_o
RELEASE="Ancient Egypt"
bb_o=$bb_incdir/release.h
echo '#ifndef RELEASE' >$bb_o
echo "#define RELEASE \"$RELEASE\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${DATADIR_SPECIFIED}" != 'yes' ]; then
DATADIR="${PREFIX}/share/agar"
bb_o=$bb_incdir/datadir.h
echo '#ifndef DATADIR' >$bb_o
echo "#define DATADIR \"$DATADIR\"" >>$bb_o
echo '#endif' >>$bb_o
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
fi
if [ "${TTFDIR_SPECIFIED}" != 'yes' ]; then
TTFDIR="${DATADIR}/fonts"
bb_o=$bb_incdir/ttfdir.h
echo '#ifndef TTFDIR' >$bb_o
echo "#define TTFDIR \"$TTFDIR\"" >>$bb_o
echo '#endif' >>$bb_o
fi
if [ "${INCLDIR_SPECIFIED}" != 'yes' ]; then
INCLDIR="${PREFIX}/include/agar"
bb_o=$bb_incdir/incldir.h
echo '#ifndef INCLDIR' >$bb_o
echo "#define INCLDIR \"$INCLDIR\"" >>$bb_o
echo '#endif' >>$bb_o
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
LOCALEDIR="NONE"
TTFDIR="NONE"
bb_o=$bb_incdir/ttfdir.h
echo '#ifndef TTFDIR' >$bb_o
echo "#define TTFDIR \"$TTFDIR\"" >>$bb_o
echo '#endif' >>$bb_o
TTFDIR="NONE"
fi
echo ' _ _ _ ___'
echo ' / _ \ / _ \ / _ \ | _ \'
echo ' | |_| | | (_| | | |_| | | |_) |'
echo ' |_| |_| \__, | |_| |_| |_| |_|'
echo ' |___/ '
if [ "${with_memory_model}" = '' ]
then
case "${host}" in
amd64-* | hppa64-* | ia64-* | mips64-* | ppc64*-* | sh64-* | sparc64-* | x86_64-*)
with_memory_model="L"
;;
bbc | c64 | c128 | geos | nes)
with_memory_model="S"
;;
*)
with_memory_model="M"
;;
esac
fi
case "${with_memory_model}" in
S* | s*)
AG_MODEL="AG_SMALL"
bb_o=$BLD/include/agar/config/ag_model.h
echo '#ifndef AG_MODEL' >$bb_o
echo "#define AG_MODEL $AG_MODEL" >>$bb_o
echo '#endif' >>$bb_o
MEMORY_MODEL="SMALL"
;;
M* | m*)
AG_MODEL="AG_MEDIUM"
bb_o=$BLD/include/agar/config/ag_model.h
echo '#ifndef AG_MODEL' >$bb_o
echo "#define AG_MODEL $AG_MODEL" >>$bb_o
echo '#endif' >>$bb_o
MEMORY_MODEL="MEDIUM"
;;
L* | l*)
AG_MODEL="AG_LARGE"
bb_o=$BLD/include/agar/config/ag_model.h
echo '#ifndef AG_MODEL' >$bb_o
echo "#define AG_MODEL $AG_MODEL" >>$bb_o
echo '#endif' >>$bb_o
MEMORY_MODEL="LARGE"
;;
*)
echo "No such memory model: ${with_memory_model} (use: SMALL, MEDIUM or LARGE)"
exit 1
esac
echo " v$VERSION for $host_machine ($MEMORY_MODEL)"
echo ""
case "${host}" in
gba | gp32 | nds | 3ds)
host="arm-none-eabi"
PATH="${DEVKITARM}/bin:${PATH}"
$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"
HAVE_EMCC="no"
if [ "$CC" = "" ]; then
case "${host}" in
emscripten)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/emcc" ]; then
CC="${i}/emcc"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/emcc.exe" ]; then
CC="${i}/emcc.exe"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
fi
done
IFS=$bb_save_IFS
;;
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
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/cc65.exe" ]; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
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
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
echo "no"
echo "no" >>config.log
HAVE_CC="no"
else
echo "yes, ${CC}"
echo "yes, ${CC}" >>config.log
HAVE_CC="yes"
fi
else
HAVE_CC="yes"
case "${host}" in
c64)
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
echo "using cc65 (${CC})" >>config.log
HAVE_CC65="yes"
CROSS_COMPILING="yes"
fi
;;
emscripten)
if ${CC} --version 2>&1 |grep -q ^emcc; then
echo "using emcc (${CC})"
echo "using emcc (${CC})" >>config.log
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
fi
;;
*)
echo "using ${CC}"
echo "using ${CC}" >>config.log
;;
esac
fi
HAVE_CC_ASM="no"
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 1>/dev/null 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation 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 | *.wasm | *.html | *.js )
;;
*.* )
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/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
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
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking whether compiler is Clang...'
$ECHO_N '# cc: checking whether compiler is Clang...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__clang__)
# error "is not clang"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_CLANG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CLANG=yes
bb_o=$bb_incdir/have_cc_clang.h
echo '#ifndef HAVE_CC_CLANG' >$bb_o
echo "#define HAVE_CC_CLANG \"$HAVE_CC_CLANG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_CLANG=no
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_CLANG}" = "yes" ]; then
HAVE_CC_ASM="yes"
fi
$ECHO_N 'cc: checking whether compiler is cc65...'
$ECHO_N '# cc: checking whether compiler is cc65...' >>config.log
if [ "${HAVE_CC65}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
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
else
echo "no"
echo "# no" >>config.log
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
fi
$ECHO_N 'cc: checking whether compiler is emcc...'
$ECHO_N '# cc: checking whether compiler is emcc...' >>config.log
if [ "${HAVE_EMCC}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
bb_o=$bb_incdir/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "no"
echo "# no" >>config.log
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
fi
$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
echo >>config.log
echo '# C: HAVE_CC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall"
fi
$ECHO_N 'cc: checking whether compiler is GCC...'
$ECHO_N '# cc: checking whether compiler is GCC...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__GNUC__) || defined(__clang__)
# error "is not gcc"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_GCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GCC=yes
bb_o=$bb_incdir/have_cc_gcc.h
echo '#ifndef HAVE_CC_GCC' >$bb_o
echo "#define HAVE_CC_GCC \"$HAVE_CC_GCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_GCC=no
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_GCC}" = "yes" ]; then
HAVE_CC_ASM="yes"
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
echo >>config.log
echo '# C: HAVE_FLOAT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
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
echo >>config.log
echo '# C: HAVE_LONG_DOUBLE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_DOUBLE=no
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
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
echo >>config.log
echo '# C: HAVE_LONG_LONG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_LONG=no
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
PICFLAGS=""
$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
echo >>config.log
echo '# C: HAVE_LD_NO_UNDEFINED' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_LD_STATIC_LIBGCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
$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
echo >>config.log
echo '# C: HAVE_CYGWIN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
;;
*)
PICFLAGS="-fPIC"
HAVE_CYGWIN="no"
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
;;
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
else
HAVE_CC65="no"
HAVE_EMCC="no"
HAVE_CC_WARNINGS="no"
HAVE_CC_ASM="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
fi
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${HAVE_CC_ASM}" = "yes" ]; then
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
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 "***"
echo "*** ERROR: Required dependency cc not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
$ECHO_N 'checking for devkitPro...'
$ECHO_N '# checking for devkitPro...' >>config.log
# BEGIN devkitpro(0 ${with_devkitpro})
HAVE_DEVKITPRO="no"
if [ "${with_devkitpro}" != "" ]; then
if [ -e "${with_devkitpro}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${with_devkitpro}/devkitA64"
fi
if [ -e "${with_devkitpro}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${with_devkitpro}/devkitARM"
fi
if [ -e "${with_devkitpro}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${with_devkitpro}/devkitPPC"
fi
else
if [ -e "${DEVKITPRO}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${DEVKITPRO}/devkitA64"
fi
if [ -e "${DEVKITPRO}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${DEVKITPRO}/devkitARM"
fi
if [ -e "${DEVKITPRO}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${DEVKITPRO}/devkitPPC"
fi
fi
if [ "${HAVE_DEVKITPRO}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
$ECHO_N "checking whether gamecube works..."
$ECHO_N "# checking whether gamecube works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int main(int argc, char *argv[]) {
GXRModeObj *rmode;
VIDEO_Init();
PAD_Init();
rmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Flush();
return (rmode != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GAMECUBE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 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_GAMECUBE=yes
bb_o=$bb_incdir/have_gamecube.h
echo '#ifndef HAVE_GAMECUBE' >$bb_o
echo "#define HAVE_GAMECUBE \"$HAVE_GAMECUBE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GAMECUBE=no
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether gba works..."
$ECHO_N "# checking whether gba works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
int main(int argc, char *argv[]) {
irqInit();
irqEnable(IRQ_VBLANK);
iprintf("\x1b[2J");
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GBA' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 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_GBA=yes
bb_o=$bb_incdir/have_gba.h
echo '#ifndef HAVE_GBA' >$bb_o
echo "#define HAVE_GBA \"$HAVE_GBA\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GBA=no
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether switch works..."
$ECHO_N "# checking whether switch works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int main(int argc, char *argv[]) {
consoleInit(NULL);
printf("\x1b[16;20H" "Hello World!");
while (appletMainLoop()) {
u64 kd;
hidScanInput();
kd = hidKeysDown(CONTROLLER_P1_AUTO);
if (kd & KEY_PLUS) { break; }
consoleUpdate(NULL);
}
consoleExit(NULL);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SWITCH' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 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_SWITCH=yes
bb_o=$bb_incdir/have_switch.h
echo '#ifndef HAVE_SWITCH' >$bb_o
echo "#define HAVE_SWITCH \"$HAVE_SWITCH\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SWITCH=no
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
HAVE_DEVKITPRO="no"
HAVE_GAMECUBE="no"
HAVE_GBA="no"
HAVE_SWITCH="no"
DEVKITPRO=""
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
echo "no"
echo "# no" >>config.log
fi
# END devkitpro
if [ "${HAVE_DEVKITPRO}" != "yes" ]; then
echo '* '
echo '# * ' >>config.log
echo '* This software requires devkitPro'
echo '# * This software requires devkitPro' >>config.log
echo '* WWW: https://devkitpro.org'
echo '# * WWW: https://devkitpro.org' >>config.log
echo '* '
echo '# * ' >>config.log
echo "***"
echo "*** ERROR: Required dependency devkitpro not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
echo "checking for byte order...little-endian (${host})"
_MK_BYTE_ORDER="LE"
_MK_LITTLE_ENDIAN="yes"
bb_o=$bb_incdir/_mk_little_endian.h
echo '#ifndef _MK_LITTLE_ENDIAN' >$bb_o
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_BIG_ENDIAN' >$bb_incdir/_mk_big_endian.h
;;
gamecube | wii | wiiu)
host="powerpc-eabi"
PATH="${DEVKITPPC}/bin:${PATH}"
$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"
HAVE_EMCC="no"
if [ "$CC" = "" ]; then
case "${host}" in
emscripten)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/emcc" ]; then
CC="${i}/emcc"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/emcc.exe" ]; then
CC="${i}/emcc.exe"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
fi
done
IFS=$bb_save_IFS
;;
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
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/cc65.exe" ]; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
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
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
echo "no"
echo "no" >>config.log
HAVE_CC="no"
else
echo "yes, ${CC}"
echo "yes, ${CC}" >>config.log
HAVE_CC="yes"
fi
else
HAVE_CC="yes"
case "${host}" in
c64)
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
echo "using cc65 (${CC})" >>config.log
HAVE_CC65="yes"
CROSS_COMPILING="yes"
fi
;;
emscripten)
if ${CC} --version 2>&1 |grep -q ^emcc; then
echo "using emcc (${CC})"
echo "using emcc (${CC})" >>config.log
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
fi
;;
*)
echo "using ${CC}"
echo "using ${CC}" >>config.log
;;
esac
fi
HAVE_CC_ASM="no"
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 1>/dev/null 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation 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 | *.wasm | *.html | *.js )
;;
*.* )
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/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
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
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking whether compiler is Clang...'
$ECHO_N '# cc: checking whether compiler is Clang...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__clang__)
# error "is not clang"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_CLANG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CLANG=yes
bb_o=$bb_incdir/have_cc_clang.h
echo '#ifndef HAVE_CC_CLANG' >$bb_o
echo "#define HAVE_CC_CLANG \"$HAVE_CC_CLANG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_CLANG=no
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_CLANG}" = "yes" ]; then
HAVE_CC_ASM="yes"
fi
$ECHO_N 'cc: checking whether compiler is cc65...'
$ECHO_N '# cc: checking whether compiler is cc65...' >>config.log
if [ "${HAVE_CC65}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
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
else
echo "no"
echo "# no" >>config.log
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
fi
$ECHO_N 'cc: checking whether compiler is emcc...'
$ECHO_N '# cc: checking whether compiler is emcc...' >>config.log
if [ "${HAVE_EMCC}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
bb_o=$bb_incdir/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "no"
echo "# no" >>config.log
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
fi
$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
echo >>config.log
echo '# C: HAVE_CC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall"
fi
$ECHO_N 'cc: checking whether compiler is GCC...'
$ECHO_N '# cc: checking whether compiler is GCC...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__GNUC__) || defined(__clang__)
# error "is not gcc"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_GCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GCC=yes
bb_o=$bb_incdir/have_cc_gcc.h
echo '#ifndef HAVE_CC_GCC' >$bb_o
echo "#define HAVE_CC_GCC \"$HAVE_CC_GCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_GCC=no
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_GCC}" = "yes" ]; then
HAVE_CC_ASM="yes"
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
echo >>config.log
echo '# C: HAVE_FLOAT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
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
echo >>config.log
echo '# C: HAVE_LONG_DOUBLE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_DOUBLE=no
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
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
echo >>config.log
echo '# C: HAVE_LONG_LONG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_LONG=no
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
PICFLAGS=""
$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
echo >>config.log
echo '# C: HAVE_LD_NO_UNDEFINED' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_LD_STATIC_LIBGCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
$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
echo >>config.log
echo '# C: HAVE_CYGWIN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
;;
*)
PICFLAGS="-fPIC"
HAVE_CYGWIN="no"
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
;;
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
else
HAVE_CC65="no"
HAVE_EMCC="no"
HAVE_CC_WARNINGS="no"
HAVE_CC_ASM="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
fi
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${HAVE_CC_ASM}" = "yes" ]; then
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
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 "***"
echo "*** ERROR: Required dependency cc not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
$ECHO_N 'checking for devkitPro...'
$ECHO_N '# checking for devkitPro...' >>config.log
# BEGIN devkitpro(0 ${with_devkitpro})
HAVE_DEVKITPRO="no"
if [ "${with_devkitpro}" != "" ]; then
if [ -e "${with_devkitpro}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${with_devkitpro}/devkitA64"
fi
if [ -e "${with_devkitpro}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${with_devkitpro}/devkitARM"
fi
if [ -e "${with_devkitpro}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${with_devkitpro}/devkitPPC"
fi
else
if [ -e "${DEVKITPRO}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${DEVKITPRO}/devkitA64"
fi
if [ -e "${DEVKITPRO}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${DEVKITPRO}/devkitARM"
fi
if [ -e "${DEVKITPRO}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${DEVKITPRO}/devkitPPC"
fi
fi
if [ "${HAVE_DEVKITPRO}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
$ECHO_N "checking whether gamecube works..."
$ECHO_N "# checking whether gamecube works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int main(int argc, char *argv[]) {
GXRModeObj *rmode;
VIDEO_Init();
PAD_Init();
rmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Flush();
return (rmode != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GAMECUBE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 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_GAMECUBE=yes
bb_o=$bb_incdir/have_gamecube.h
echo '#ifndef HAVE_GAMECUBE' >$bb_o
echo "#define HAVE_GAMECUBE \"$HAVE_GAMECUBE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GAMECUBE=no
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether gba works..."
$ECHO_N "# checking whether gba works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
int main(int argc, char *argv[]) {
irqInit();
irqEnable(IRQ_VBLANK);
iprintf("\x1b[2J");
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GBA' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 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_GBA=yes
bb_o=$bb_incdir/have_gba.h
echo '#ifndef HAVE_GBA' >$bb_o
echo "#define HAVE_GBA \"$HAVE_GBA\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GBA=no
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether switch works..."
$ECHO_N "# checking whether switch works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int main(int argc, char *argv[]) {
consoleInit(NULL);
printf("\x1b[16;20H" "Hello World!");
while (appletMainLoop()) {
u64 kd;
hidScanInput();
kd = hidKeysDown(CONTROLLER_P1_AUTO);
if (kd & KEY_PLUS) { break; }
consoleUpdate(NULL);
}
consoleExit(NULL);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SWITCH' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 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_SWITCH=yes
bb_o=$bb_incdir/have_switch.h
echo '#ifndef HAVE_SWITCH' >$bb_o
echo "#define HAVE_SWITCH \"$HAVE_SWITCH\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SWITCH=no
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
HAVE_DEVKITPRO="no"
HAVE_GAMECUBE="no"
HAVE_GBA="no"
HAVE_SWITCH="no"
DEVKITPRO=""
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
echo "no"
echo "# no" >>config.log
fi
# END devkitpro
if [ "${HAVE_DEVKITPRO}" != "yes" ]; then
echo '* '
echo '# * ' >>config.log
echo '* This software requires devkitPro'
echo '# * This software requires devkitPro' >>config.log
echo '* WWW: https://devkitpro.org'
echo '# * WWW: https://devkitpro.org' >>config.log
echo '* '
echo '# * ' >>config.log
echo "***"
echo "*** ERROR: Required dependency devkitpro not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
_MK_BYTE_ORDER="BE"
_MK_BIG_ENDIAN="yes"
bb_o=$bb_incdir/_mk_big_endian.h
echo '#ifndef _MK_BIG_ENDIAN' >$bb_o
echo "#define _MK_BIG_ENDIAN \"$_MK_BIG_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_LITTLE_ENDIAN' >$bb_incdir/_mk_little_endian.h
;;
switch)
host="aarch64-none-elf"
PATH="${DEVKITA64}/bin:${PATH}"
$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"
HAVE_EMCC="no"
if [ "$CC" = "" ]; then
case "${host}" in
emscripten)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/emcc" ]; then
CC="${i}/emcc"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/emcc.exe" ]; then
CC="${i}/emcc.exe"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
fi
done
IFS=$bb_save_IFS
;;
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
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/cc65.exe" ]; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
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
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
echo "no"
echo "no" >>config.log
HAVE_CC="no"
else
echo "yes, ${CC}"
echo "yes, ${CC}" >>config.log
HAVE_CC="yes"
fi
else
HAVE_CC="yes"
case "${host}" in
c64)
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
echo "using cc65 (${CC})" >>config.log
HAVE_CC65="yes"
CROSS_COMPILING="yes"
fi
;;
emscripten)
if ${CC} --version 2>&1 |grep -q ^emcc; then
echo "using emcc (${CC})"
echo "using emcc (${CC})" >>config.log
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
fi
;;
*)
echo "using ${CC}"
echo "using ${CC}" >>config.log
;;
esac
fi
HAVE_CC_ASM="no"
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 1>/dev/null 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation 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 | *.wasm | *.html | *.js )
;;
*.* )
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/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
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
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking whether compiler is Clang...'
$ECHO_N '# cc: checking whether compiler is Clang...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__clang__)
# error "is not clang"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_CLANG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CLANG=yes
bb_o=$bb_incdir/have_cc_clang.h
echo '#ifndef HAVE_CC_CLANG' >$bb_o
echo "#define HAVE_CC_CLANG \"$HAVE_CC_CLANG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_CLANG=no
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_CLANG}" = "yes" ]; then
HAVE_CC_ASM="yes"
fi
$ECHO_N 'cc: checking whether compiler is cc65...'
$ECHO_N '# cc: checking whether compiler is cc65...' >>config.log
if [ "${HAVE_CC65}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
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
else
echo "no"
echo "# no" >>config.log
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
fi
$ECHO_N 'cc: checking whether compiler is emcc...'
$ECHO_N '# cc: checking whether compiler is emcc...' >>config.log
if [ "${HAVE_EMCC}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
bb_o=$bb_incdir/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "no"
echo "# no" >>config.log
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
fi
$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
echo >>config.log
echo '# C: HAVE_CC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall"
fi
$ECHO_N 'cc: checking whether compiler is GCC...'
$ECHO_N '# cc: checking whether compiler is GCC...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__GNUC__) || defined(__clang__)
# error "is not gcc"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_GCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GCC=yes
bb_o=$bb_incdir/have_cc_gcc.h
echo '#ifndef HAVE_CC_GCC' >$bb_o
echo "#define HAVE_CC_GCC \"$HAVE_CC_GCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_GCC=no
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_GCC}" = "yes" ]; then
HAVE_CC_ASM="yes"
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
echo >>config.log
echo '# C: HAVE_FLOAT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
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
echo >>config.log
echo '# C: HAVE_LONG_DOUBLE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_DOUBLE=no
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
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
echo >>config.log
echo '# C: HAVE_LONG_LONG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_LONG=no
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
PICFLAGS=""
$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
echo >>config.log
echo '# C: HAVE_LD_NO_UNDEFINED' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_LD_STATIC_LIBGCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
$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
echo >>config.log
echo '# C: HAVE_CYGWIN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
;;
*)
PICFLAGS="-fPIC"
HAVE_CYGWIN="no"
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
;;
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
else
HAVE_CC65="no"
HAVE_EMCC="no"
HAVE_CC_WARNINGS="no"
HAVE_CC_ASM="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
fi
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${HAVE_CC_ASM}" = "yes" ]; then
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
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 "***"
echo "*** ERROR: Required dependency cc not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
$ECHO_N 'checking for devkitPro...'
$ECHO_N '# checking for devkitPro...' >>config.log
# BEGIN devkitpro(0 ${with_devkitpro})
HAVE_DEVKITPRO="no"
if [ "${with_devkitpro}" != "" ]; then
if [ -e "${with_devkitpro}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${with_devkitpro}/devkitA64"
fi
if [ -e "${with_devkitpro}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${with_devkitpro}/devkitARM"
fi
if [ -e "${with_devkitpro}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${with_devkitpro}/devkitPPC"
fi
else
if [ -e "${DEVKITPRO}/devkitA64" ]; then
HAVE_DEVKITPRO="yes"
DEVKITA64="${DEVKITPRO}/devkitA64"
fi
if [ -e "${DEVKITPRO}/devkitARM" ]; then
HAVE_DEVKITPRO="yes"
DEVKITARM="${DEVKITPRO}/devkitARM"
fi
if [ -e "${DEVKITPRO}/devkitPPC" ]; then
HAVE_DEVKITPRO="yes"
DEVKITPPC="${DEVKITPRO}/devkitPPC"
fi
fi
if [ "${HAVE_DEVKITPRO}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
$ECHO_N "checking whether gamecube works..."
$ECHO_N "# checking whether gamecube works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int main(int argc, char *argv[]) {
GXRModeObj *rmode;
VIDEO_Init();
PAD_Init();
rmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Flush();
return (rmode != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GAMECUBE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float -ffunction-sections -fdata-sections -fmodulo-sched -I${DEVKITPRO}/libogc/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libogc/lib/cube -logc -lm -lgcc 1>/dev/null 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_GAMECUBE=yes
bb_o=$bb_incdir/have_gamecube.h
echo '#ifndef HAVE_GAMECUBE' >$bb_o
echo "#define HAVE_GAMECUBE \"$HAVE_GAMECUBE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GAMECUBE=no
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether gba works..."
$ECHO_N "# checking whether gba works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
int main(int argc, char *argv[]) {
irqInit();
irqEnable(IRQ_VBLANK);
iprintf("\x1b[2J");
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GBA' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -I${DEVKITPRO}/libgba/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libgba/lib -lgba 1>/dev/null 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_GBA=yes
bb_o=$bb_incdir/have_gba.h
echo '#ifndef HAVE_GBA' >$bb_o
echo "#define HAVE_GBA \"$HAVE_GBA\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GBA=no
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N "checking whether switch works..."
$ECHO_N "# checking whether switch works..." >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int main(int argc, char *argv[]) {
consoleInit(NULL);
printf("\x1b[16;20H" "Hello World!");
while (appletMainLoop()) {
u64 kd;
hidScanInput();
kd = hidKeysDown(CONTROLLER_P1_AUTO);
if (kd & KEY_PLUS) { break; }
consoleUpdate(NULL);
}
consoleExit(NULL);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SWITCH' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -D__SWITCH__ -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE -ffunction-sections -I${DEVKITPRO}/libnx/include -o $testdir/conftest$$ conftest$$.c -L${DEVKITPRO}/libnx/lib -lnx -specs=${DEVKITPRO}/libnx/switch.specs 1>/dev/null 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_SWITCH=yes
bb_o=$bb_incdir/have_switch.h
echo '#ifndef HAVE_SWITCH' >$bb_o
echo "#define HAVE_SWITCH \"$HAVE_SWITCH\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SWITCH=no
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
HAVE_DEVKITPRO="no"
HAVE_GAMECUBE="no"
HAVE_GBA="no"
HAVE_SWITCH="no"
DEVKITPRO=""
echo '#undef HAVE_GAMECUBE' >$bb_incdir/have_gamecube.h
echo '#undef HAVE_GBA' >$bb_incdir/have_gba.h
echo '#undef HAVE_SWITCH' >$bb_incdir/have_switch.h
echo "no"
echo "# no" >>config.log
fi
# END devkitpro
if [ "${HAVE_DEVKITPRO}" != "yes" ]; then
echo '* '
echo '# * ' >>config.log
echo '* This software requires devkitPro'
echo '# * This software requires devkitPro' >>config.log
echo '* WWW: https://devkitpro.org'
echo '# * WWW: https://devkitpro.org' >>config.log
echo '* '
echo '# * ' >>config.log
echo "***"
echo "*** ERROR: Required dependency devkitpro not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
CFLAGS="${CFLAGS} -mlittle-endian"
_MK_BYTE_ORDER="LE"
_MK_LITTLE_ENDIAN="yes"
bb_o=$bb_incdir/_mk_little_endian.h
echo '#ifndef _MK_LITTLE_ENDIAN' >$bb_o
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_BIG_ENDIAN' >$bb_incdir/_mk_big_endian.h
;;
bbc | c64 | c128 | geos | nes)
$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"
HAVE_EMCC="no"
if [ "$CC" = "" ]; then
case "${host}" in
emscripten)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/emcc" ]; then
CC="${i}/emcc"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/emcc.exe" ]; then
CC="${i}/emcc.exe"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
fi
done
IFS=$bb_save_IFS
;;
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
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/cc65.exe" ]; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
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
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
echo "no"
echo "no" >>config.log
HAVE_CC="no"
else
echo "yes, ${CC}"
echo "yes, ${CC}" >>config.log
HAVE_CC="yes"
fi
else
HAVE_CC="yes"
case "${host}" in
c64)
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
echo "using cc65 (${CC})" >>config.log
HAVE_CC65="yes"
CROSS_COMPILING="yes"
fi
;;
emscripten)
if ${CC} --version 2>&1 |grep -q ^emcc; then
echo "using emcc (${CC})"
echo "using emcc (${CC})" >>config.log
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
fi
;;
*)
echo "using ${CC}"
echo "using ${CC}" >>config.log
;;
esac
fi
HAVE_CC_ASM="no"
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 1>/dev/null 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation 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 | *.wasm | *.html | *.js )
;;
*.* )
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/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
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
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking whether compiler is Clang...'
$ECHO_N '# cc: checking whether compiler is Clang...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__clang__)
# error "is not clang"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_CLANG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CLANG=yes
bb_o=$bb_incdir/have_cc_clang.h
echo '#ifndef HAVE_CC_CLANG' >$bb_o
echo "#define HAVE_CC_CLANG \"$HAVE_CC_CLANG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_CLANG=no
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_CLANG}" = "yes" ]; then
HAVE_CC_ASM="yes"
fi
$ECHO_N 'cc: checking whether compiler is cc65...'
$ECHO_N '# cc: checking whether compiler is cc65...' >>config.log
if [ "${HAVE_CC65}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
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
else
echo "no"
echo "# no" >>config.log
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
fi
$ECHO_N 'cc: checking whether compiler is emcc...'
$ECHO_N '# cc: checking whether compiler is emcc...' >>config.log
if [ "${HAVE_EMCC}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
bb_o=$bb_incdir/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "no"
echo "# no" >>config.log
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
fi
$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
echo >>config.log
echo '# C: HAVE_CC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall"
fi
$ECHO_N 'cc: checking whether compiler is GCC...'
$ECHO_N '# cc: checking whether compiler is GCC...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__GNUC__) || defined(__clang__)
# error "is not gcc"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_GCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GCC=yes
bb_o=$bb_incdir/have_cc_gcc.h
echo '#ifndef HAVE_CC_GCC' >$bb_o
echo "#define HAVE_CC_GCC \"$HAVE_CC_GCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_GCC=no
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_GCC}" = "yes" ]; then
HAVE_CC_ASM="yes"
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
echo >>config.log
echo '# C: HAVE_FLOAT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
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
echo >>config.log
echo '# C: HAVE_LONG_DOUBLE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_DOUBLE=no
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
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
echo >>config.log
echo '# C: HAVE_LONG_LONG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_LONG=no
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
PICFLAGS=""
$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
echo >>config.log
echo '# C: HAVE_LD_NO_UNDEFINED' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_LD_STATIC_LIBGCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
$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
echo >>config.log
echo '# C: HAVE_CYGWIN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
;;
*)
PICFLAGS="-fPIC"
HAVE_CYGWIN="no"
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
;;
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
else
HAVE_CC65="no"
HAVE_EMCC="no"
HAVE_CC_WARNINGS="no"
HAVE_CC_ASM="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
fi
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${HAVE_CC_ASM}" = "yes" ]; then
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
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 "***"
echo "*** ERROR: Required dependency cc not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
HAVE_OBJC="no"
HAVE_OBJC_WARNINGS="no"
TEST_OBJCFLAGS=""
echo '#undef HAVE_OBJC' >$bb_incdir/have_objc.h
echo '#undef HAVE_OBJC_WARNINGS' >$bb_incdir/have_objc_warnings.h
enable_micro="yes"
enable_gui="no"
enable_sg="no"
enable_sk="no"
enable_vg="no"
enable_shared="no"
with_attributes="no"
with_float="no"
enable_ansi_color="no"
enable_dso="no"
enable_exec="no"
enable_event_loop="no"
enable_namespaces="no"
enable_named_args="no"
enable_net="no"
enable_serialization="no"
enable_string="no"
enable_threads="no"
enable_timers="no"
enable_type_safety="no"
enable_unicode="no"
enable_user="no"
enable_verbosity="no"
enable_math="no"
echo "checking for byte order...little-endian (${host})"
_MK_BYTE_ORDER="LE"
_MK_LITTLE_ENDIAN="yes"
bb_o=$bb_incdir/_mk_little_endian.h
echo '#ifndef _MK_LITTLE_ENDIAN' >$bb_o
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_BIG_ENDIAN' >$bb_incdir/_mk_big_endian.h
;;
*)
$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"
HAVE_EMCC="no"
if [ "$CC" = "" ]; then
case "${host}" in
emscripten)
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/emcc" ]; then
CC="${i}/emcc"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/emcc.exe" ]; then
CC="${i}/emcc.exe"
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
break
fi
done
IFS=$bb_save_IFS
;;
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
CC="${i}/cc65"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
elif [ -x "${i}/cc65.exe" ]; then
CC="${i}/cc65.exe"
HAVE_CC65="yes"
CROSS_COMPILING="yes"
break
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
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
echo "no"
echo "no" >>config.log
HAVE_CC="no"
else
echo "yes, ${CC}"
echo "yes, ${CC}" >>config.log
HAVE_CC="yes"
fi
else
HAVE_CC="yes"
case "${host}" in
c64)
if ${CC} -V 2>&1 |grep -q ^cc65; then
echo "using cc65 (${CC})"
echo "using cc65 (${CC})" >>config.log
HAVE_CC65="yes"
CROSS_COMPILING="yes"
fi
;;
emscripten)
if ${CC} --version 2>&1 |grep -q ^emcc; then
echo "using emcc (${CC})"
echo "using emcc (${CC})" >>config.log
HAVE_EMCC="yes"
CROSS_COMPILING="yes"
fi
;;
*)
echo "using ${CC}"
echo "using ${CC}" >>config.log
;;
esac
fi
HAVE_CC_ASM="no"
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 1>/dev/null 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation 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 | *.wasm | *.html | *.js )
;;
*.* )
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/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
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
bb_o=$bb_incdir/execsuffix.h
echo '#ifndef EXECSUFFIX' >$bb_o
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.c conftest conftest$EXECSUFFIX
fi
TEST_CFLAGS=''
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N 'cc: checking whether compiler is Clang...'
$ECHO_N '# cc: checking whether compiler is Clang...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__clang__)
# error "is not clang"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_CLANG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CLANG=yes
bb_o=$bb_incdir/have_cc_clang.h
echo '#ifndef HAVE_CC_CLANG' >$bb_o
echo "#define HAVE_CC_CLANG \"$HAVE_CC_CLANG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_CLANG=no
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_CLANG}" = "yes" ]; then
HAVE_CC_ASM="yes"
fi
$ECHO_N 'cc: checking whether compiler is cc65...'
$ECHO_N '# cc: checking whether compiler is cc65...' >>config.log
if [ "${HAVE_CC65}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
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
else
echo "no"
echo "# no" >>config.log
CC_COMPILE="-c"
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
fi
$ECHO_N 'cc: checking whether compiler is emcc...'
$ECHO_N '# cc: checking whether compiler is emcc...' >>config.log
if [ "${HAVE_EMCC}" = "yes" ]; then
echo "yes"
echo "# yes" >>config.log
bb_o=$bb_incdir/have_emcc.h
echo '#ifndef HAVE_EMCC' >$bb_o
echo "#define HAVE_EMCC \"$HAVE_EMCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo "no"
echo "# no" >>config.log
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
fi
$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
echo >>config.log
echo '# C: HAVE_CC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_WARNINGS=no
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall"
fi
$ECHO_N 'cc: checking whether compiler is GCC...'
$ECHO_N '# cc: checking whether compiler is GCC...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#if !defined(__GNUC__) || defined(__clang__)
# error "is not gcc"
#endif
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_CC_GCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GCC=yes
bb_o=$bb_incdir/have_cc_gcc.h
echo '#ifndef HAVE_CC_GCC' >$bb_o
echo "#define HAVE_CC_GCC \"$HAVE_CC_GCC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CC_GCC=no
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CC_GCC}" = "yes" ]; then
HAVE_CC_ASM="yes"
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
echo >>config.log
echo '# C: HAVE_FLOAT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_FLOAT=no
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
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
echo >>config.log
echo '# C: HAVE_LONG_DOUBLE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_DOUBLE=no
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
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
echo >>config.log
echo '# C: HAVE_LONG_LONG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LONG_LONG=no
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
PICFLAGS=""
$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
echo >>config.log
echo '# C: HAVE_LD_NO_UNDEFINED' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wl,--no-undefined -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_LD_STATIC_LIBGCC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -static-libgcc -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
$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
echo >>config.log
echo '# C: HAVE_CYGWIN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_CYGWIN=no
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
;;
*)
PICFLAGS="-fPIC"
HAVE_CYGWIN="no"
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
;;
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
else
HAVE_CC65="no"
HAVE_EMCC="no"
HAVE_CC_WARNINGS="no"
HAVE_CC_ASM="no"
PROG_GUI_FLAGS=""
PROG_CLI_FLAGS=""
TEST_CFLAGS=""
echo '#undef HAVE_CC' >$bb_incdir/have_cc.h
echo '#undef HAVE_CC_WARNINGS' >$bb_incdir/have_cc_warnings.h
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
echo '#undef HAVE_CC_CLANG' >$bb_incdir/have_cc_clang.h
echo '#undef HAVE_CC_GCC' >$bb_incdir/have_cc_gcc.h
echo '#undef HAVE_CC65' >$bb_incdir/have_cc65.h
echo '#undef HAVE_EMCC' >$bb_incdir/have_emcc.h
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
echo '#undef HAVE_LONG_LONG' >$bb_incdir/have_long_long.h
echo '#undef HAVE_CYGWIN' >$bb_incdir/have_cygwin.h
echo '#undef HAVE_LD_NO_UNDEFINED' >$bb_incdir/have_ld_no_undefined.h
echo '#undef HAVE_LD_STATIC_LIBGCC' >$bb_incdir/have_ld_static_libgcc.h
fi
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${HAVE_CC_ASM}" = "yes" ]; then
bb_o=$bb_incdir/have_cc_asm.h
echo '#ifndef HAVE_CC_ASM' >$bb_o
echo "#define HAVE_CC_ASM \"$HAVE_CC_ASM\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_CC_ASM' >$bb_incdir/have_cc_asm.h
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 "***"
echo "*** ERROR: Required dependency cc not found"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
$ECHO_N 'checking for Objective-C compiler...'
$ECHO_N '# checking for Objective-C compiler...' >>config.log
# BEGIN objc
if [ "$CROSS_COMPILING" = "yes" ]; then
CROSSPFX="${host}-"
else
CROSSPFX=""
fi
if [ "$OBJC" = "" ]; then
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for i in $PATH; do
if [ -x "${i}/${CROSSPFX}clang" ]; then
OBJC="${i}/${CROSSPFX}clang"
break
elif [ -x "${i}/${CROSSPFX}clang70" ]; then
OBJC="${i}/${CROSSPFX}clang70"
break
elif [ -x "${i}/${CROSSPFX}clang60" ]; then
OBJC="${i}/${CROSSPFX}clang60"
break
elif [ -x "${i}/${CROSSPFX}gcc" ]; then
OBJC="${i}/${CROSSPFX}gcc"
break
elif [ -x "${i}/${CROSSPFX}gcc-6" ]; then
OBJC="${i}/${CROSSPFX}gcc-6"
break
elif [ -x "${i}/${CROSSPFX}gcc7" ]; then
OBJC="${i}/${CROSSPFX}gcc7"
break
elif [ -x "${i}/${CROSSPFX}gcc8" ]; then
OBJC="${i}/${CROSSPFX}gcc8"
break
elif [ -x "${i}/${CROSSPFX}gcc5" ]; then
OBJC="${i}/${CROSSPFX}gcc5"
break
elif [ -x "${i}/${CROSSPFX}gcc49" ]; then
OBJC="${i}/${CROSSPFX}gcc49"
break
elif [ -x "${i}/${CROSSPFX}gcc48" ]; then
OBJC="${i}/${CROSSPFX}gcc48"
break
elif [ -x "${i}/${CROSSPFX}clang.exe" ]; then
OBJC="${i}/${CROSSPFX}clang.exe"
break
elif [ -x "${i}/${CROSSPFX}cc.exe" ]; then
OBJC="${i}/${CROSSPFX}cc.exe"
break
elif [ -x "${i}/${CROSSPFX}gcc.exe" ]; then
OBJC="${i}/${CROSSPFX}gcc.exe"
break
fi
done
IFS=$bb_save_IFS
if [ "$OBJC" = '' ]; then
echo "*"
echo "* Cannot find one of clang, clang70, clang60, 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 OBJC environment variable."
echo "*"
echo "Cannot find Objective C compiler in PATH." >>config.log
HAVE_OBJC="no"
echo "no"
else
HAVE_OBJC="yes"
echo "yes, ${OBJC}"
echo "yes, ${OBJC}" >>config.log
fi
else
HAVE_OBJC="yes"
echo "using ${OBJC}"
fi
if [ "${HAVE_OBJC}" = "yes" ]; then
$ECHO_N 'checking whether the Objective-C compiler works...'
$ECHO_N '# checking whether the Objective-C compiler works...' >>config.log
cat << 'EOT' > conftest.m
#import
int main(int argc, char *argv[]) { return (0); }
EOT
$OBJC -x objective-c -o conftest conftest.m 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no, compilation failed" >>config.log
HAVE_OBJC="no"
else
HAVE_OBJC="yes"
fi
if [ "${HAVE_OBJC}" = "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
else
echo "yes"
echo "yes" >>config.log
fi
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest.m conftest$EXECSUFFIX
fi
TEST_OBJCFLAGS=''
fi
if [ "${HAVE_OBJC}" = "yes" ]; then
$ECHO_N 'objc: checking for compiler warning options...'
$ECHO_N '# objc: checking for compiler warning options...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.m
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# ObjC: HAVE_OBJC_WARNINGS' >>config.log
echo "cat << EOT >conftest$$.m" >>config.log
cat conftest$$.m>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -x objective-c -o $testdir/conftest$$ conftest$$.m 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -x objective-c -o $testdir/conftest$$ conftest$$.m 1>/dev/null 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_OBJC_WARNINGS=yes
bb_o=$bb_incdir/have_objc_warnings.h
echo '#ifndef HAVE_OBJC_WARNINGS' >$bb_o
echo "#define HAVE_OBJC_WARNINGS \"$HAVE_OBJC_WARNINGS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_OBJC_WARNINGS=no
echo '#undef HAVE_OBJC_WARNINGS' >$bb_incdir/have_objc_warnings.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.m $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_OBJC_WARNINGS}" = "yes" ]; then
TEST_OBJCFLAGS="-Wall"
fi
bb_o=$bb_incdir/have_objc.h
echo '#ifndef HAVE_OBJC' >$bb_o
echo "#define HAVE_OBJC \"$HAVE_OBJC\"" >>$bb_o
echo '#endif' >>$bb_o
rm -f conftest.m $testdir/conftest$EXECSUFFIX
else
HAVE_OBJC_WARNINGS="no"
TEST_OBJCFLAGS=""
echo '#undef HAVE_OBJC' >$bb_incdir/have_objc.h
echo '#undef HAVE_OBJC_WARNINGS' >$bb_incdir/have_objc_warnings.h
fi
# END objc
if [ "${HAVE_FLOAT}" = "yes" -a "${with_float}" = "no" ]
then
echo "disabling floating-point support"
HAVE_FLOAT="no"
HAVE_LONG_DOUBLE="no"
echo '#undef HAVE_FLOAT' >$bb_incdir/have_float.h
echo '#undef HAVE_LONG_DOUBLE' >$bb_incdir/have_long_double.h
fi
if [ "${CROSS_COMPILING}" = "yes" ]
then
if [ "${byte_order}" = "" ]
then
case "${host}" in
armel-* | sh5el-* | earmvel-* | i*86-* | mips*el-* | mipsel-* | powerpcle-* | powerpc64le-* | riscv*-* | vax-* | x86_64-*)
byte_order="LE"
;;
aarch64_be-* | armeb-* | avr32-* | earmveb-* | hppa*-* | m68k-* | mc68* | mips*eb-* | mipseb-* | openrisc-* | powerpc-* | rs6000-* | sh3eb-* | sparc*-*)
byte_order="BE"
;;
*)
echo "*"
echo "* Could not guess the byte order of ${host}."
echo "* Please use --byte-order=LE or --byte-order=BE"
echo "*"
exit 1
;;
esac
fi
fi
$ECHO_N 'checking for byte order...'
$ECHO_N '# checking for byte order...' >>config.log
# BEGIN byte_order
if [ "${byte_order}" != "" ]; then
if [ "${byte_order}" = "LE" ]; then
_MK_BYTE_ORDER="LE"
_MK_LITTLE_ENDIAN="yes"
bb_o=$bb_incdir/_mk_little_endian.h
echo '#ifndef _MK_LITTLE_ENDIAN' >$bb_o
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_BIG_ENDIAN' >$bb_incdir/_mk_big_endian.h
else
if [ "${byte_order}" = "BE" ]; then
_MK_BYTE_ORDER="BE"
_MK_BIG_ENDIAN="yes"
bb_o=$bb_incdir/_mk_big_endian.h
echo '#ifndef _MK_BIG_ENDIAN' >$bb_o
echo "#define _MK_BIG_ENDIAN \"$_MK_BIG_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_LITTLE_ENDIAN' >$bb_incdir/_mk_little_endian.h
else
echo "***"
echo "*** ERROR: Usage: --byte-order=[LE|BE]"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
else
cat << EOT > conftest.c
#include
#include
int
main(int argc, char *argv[])
{
#if BYTE_ORDER == BIG_ENDIAN
static volatile char *bo = "BiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiANBiGEnDiAN";
#else
static volatile char *bo = "LiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiANLiTTLeEnDiAN";
#endif
int c = 0;
volatile char *p = bo;
while (*p != '\0') { c *= (int)*p; }
return (c>123?c:456);
}
EOT
echo "$CC $CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "Failed to compile test for byte order, code $?"
echo "Failed to compile test for byte order, code $?" >> config.log
exit 1
fi
rm -f conftest.c
_MK_BYTE_ORDER=''
_MK_BYTE_ORDER_LESTRING='LiTTLeEnD'
_MK_BYTE_ORDER_BESTRING='BiGEnDiAN'
od -tc $testdir/conftest$EXECSUFFIX | sed 's/ //g' > $testdir/conftest.dump
if grep "$_MK_BYTE_ORDER_LESTRING" $testdir/conftest.dump >/dev/null; then
_MK_BYTE_ORDER="LE"
if grep "$_MK_BYTE_ORDER_BESTRING" $testdir/conftest.dump >/dev/null; then
echo '*'
echo '* Unable to auto-determine host byte order. Please re-run ./configure'
echo '* with --byte-order=LE or --byte-order=BE.'
echo '*'
exit 1
fi
else
if grep "$_MK_BYTE_ORDER_BESTRING" $testdir/conftest.dump >/dev/null; then
_MK_BYTE_ORDER="BE"
if grep "$_MK_BYTE_ORDER_LESTRING" $testdir/conftest.dump >/dev/null; then
echo '*'
echo '* Unable to auto-determine host byte order. Please re-run ./configure'
echo '* with --byte-order=LE or --byte-order=BE.'
echo '*'
exit 1
fi
fi
fi
rm -f conftest.c $testdir/conftest $testdir/conftest.dump
fi
if [ "$_MK_BYTE_ORDER" = "LE" ]; then
echo 'little-endian'
echo '# little-endian' >>config.log
_MK_LITTLE_ENDIAN="yes"
bb_o=$bb_incdir/_mk_little_endian.h
echo '#ifndef _MK_LITTLE_ENDIAN' >$bb_o
echo "#define _MK_LITTLE_ENDIAN \"$_MK_LITTLE_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_BIG_ENDIAN' >$bb_incdir/_mk_big_endian.h
else
echo 'big-endian'
echo '# big-endian' >>config.log
_MK_BIG_ENDIAN="yes"
bb_o=$bb_incdir/_mk_big_endian.h
echo '#ifndef _MK_BIG_ENDIAN' >$bb_o
echo "#define _MK_BIG_ENDIAN \"$_MK_BIG_ENDIAN\"" >>$bb_o
echo '#endif' >>$bb_o
echo '#undef _MK_LITTLE_ENDIAN' >$bb_incdir/_mk_little_endian.h
fi
# END byte_order
;;
esac
if [ "${enable_shared}" != 'no' ]
then
LIB_SHARED="Yes"
else
LIB_SHARED="No"
fi
if [ "${with_attributes}" != 'no' ]
then
$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
echo >>config.log
echo '# C: HAVE_ALIGNED_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_ALIGNED_ATTRIBUTE=no
echo '#undef HAVE_ALIGNED_ATTRIBUTE' >$bb_incdir/have_aligned_attribute.h
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
echo >>config.log
echo '# C: HAVE_BOUNDED_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_BOUNDED_ATTRIBUTE=no
echo '#undef HAVE_BOUNDED_ATTRIBUTE' >$bb_incdir/have_bounded_attribute.h
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
echo >>config.log
echo '# C: HAVE_CONST_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_CONST_ATTRIBUTE=no
echo '#undef HAVE_CONST_ATTRIBUTE' >$bb_incdir/have_const_attribute.h
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
echo >>config.log
echo '# C: HAVE_DEPRECATED_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_DEPRECATED_ATTRIBUTE=no
echo '#undef HAVE_DEPRECATED_ATTRIBUTE' >$bb_incdir/have_deprecated_attribute.h
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
echo >>config.log
echo '# C: HAVE_FORMAT_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_FORMAT_ATTRIBUTE=no
echo '#undef HAVE_FORMAT_ATTRIBUTE' >$bb_incdir/have_format_attribute.h
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
echo >>config.log
echo '# C: HAVE_MALLOC_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_MALLOC_ATTRIBUTE=no
echo '#undef HAVE_MALLOC_ATTRIBUTE' >$bb_incdir/have_malloc_attribute.h
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
echo >>config.log
echo '# C: HAVE_NORETURN_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_NORETURN_ATTRIBUTE=no
echo '#undef HAVE_NORETURN_ATTRIBUTE' >$bb_incdir/have_noreturn_attribute.h
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
echo >>config.log
echo '# C: HAVE_PACKED_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_PACKED_ATTRIBUTE=no
echo '#undef HAVE_PACKED_ATTRIBUTE' >$bb_incdir/have_packed_attribute.h
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
echo >>config.log
echo '# C: HAVE_PURE_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_PURE_ATTRIBUTE=no
echo '#undef HAVE_PURE_ATTRIBUTE' >$bb_incdir/have_pure_attribute.h
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
echo >>config.log
echo '# C: HAVE_UNUSED_VARIABLE_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_UNUSED_VARIABLE_ATTRIBUTE=no
echo '#undef HAVE_UNUSED_VARIABLE_ATTRIBUTE' >$bb_incdir/have_unused_variable_attribute.h
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
echo >>config.log
echo '# C: HAVE_WARN_UNUSED_RESULT_ATTRIBUTE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
HAVE_WARN_UNUSED_RESULT_ATTRIBUTE=no
echo '#undef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE' >$bb_incdir/have_warn_unused_result_attribute.h
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
else
echo '#undef HAVE_ALIGNED_ATTRIBUTE' >$bb_incdir/have_aligned_attribute.h
echo '#undef HAVE_BOUNDED_ATTRIBUTE' >$bb_incdir/have_bounded_attribute.h
echo '#undef HAVE_CONST_ATTRIBUTE' >$bb_incdir/have_const_attribute.h
echo '#undef HAVE_DEPRECATED_ATTRIBUTE' >$bb_incdir/have_deprecated_attribute.h
echo '#undef HAVE_FORMAT_ATTRIBUTE' >$bb_incdir/have_format_attribute.h
echo '#undef HAVE_MALLOC_ATTRIBUTE' >$bb_incdir/have_malloc_attribute.h
echo '#undef HAVE_NORETURN_ATTRIBUTE' >$bb_incdir/have_noreturn_attribute.h
echo '#undef HAVE_PACKED_ATTRIBUTE' >$bb_incdir/have_packed_attribute.h
echo '#undef HAVE_PURE_ATTRIBUTE' >$bb_incdir/have_pure_attribute.h
echo '#undef HAVE_UNUSED_VARIABLE_ATTRIBUTE' >$bb_incdir/have_unused_variable_attribute.h
echo '#undef HAVE_WARN_UNUSED_RESULT_ATTRIBUTE' >$bb_incdir/have_warn_unused_result_attribute.h
fi
if [ "${with_attributes}" != 'no' ]; then
AG_USE_ATTRIBUTES="yes"
bb_o=$bb_incdir/ag_use_attributes.h
echo '#ifndef AG_USE_ATTRIBUTES' >$bb_o
echo "#define AG_USE_ATTRIBUTES \"$AG_USE_ATTRIBUTES\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_USE_ATTRIBUTES' >$bb_incdir/ag_use_attributes.h
fi
if [ "${with_inline}" = 'no' ]
then
with_inline_byteswap="no"
with_inline_error="no"
with_inline_io="no"
with_inline_object="no"
with_inline_string="no"
with_inline_tbl="no"
with_inline_threads="no"
with_inline_variable="no"
with_inline_surface="no"
with_inline_widget="no"
fi
if [ "${with_inline_byteswap}" != "no" ]; then
AG_INLINE_BYTESWAP="yes"
bb_o=$bb_incdir/ag_inline_byteswap.h
echo '#ifndef AG_INLINE_BYTESWAP' >$bb_o
echo "#define AG_INLINE_BYTESWAP \"$AG_INLINE_BYTESWAP\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_BYTESWAP' >$bb_incdir/ag_inline_byteswap.h
fi
if [ "${with_inline_error}" != "no" ]; then
AG_INLINE_ERROR="yes"
bb_o=$bb_incdir/ag_inline_error.h
echo '#ifndef AG_INLINE_ERROR' >$bb_o
echo "#define AG_INLINE_ERROR \"$AG_INLINE_ERROR\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_ERROR' >$bb_incdir/ag_inline_error.h
fi
if [ "${with_inline_io}" != "no" ]; then
AG_INLINE_IO="yes"
bb_o=$bb_incdir/ag_inline_io.h
echo '#ifndef AG_INLINE_IO' >$bb_o
echo "#define AG_INLINE_IO \"$AG_INLINE_IO\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_IO' >$bb_incdir/ag_inline_io.h
fi
if [ "${with_inline_object}" != "no" ]; then
AG_INLINE_OBJECT="yes"
bb_o=$bb_incdir/ag_inline_object.h
echo '#ifndef AG_INLINE_OBJECT' >$bb_o
echo "#define AG_INLINE_OBJECT \"$AG_INLINE_OBJECT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_OBJECT' >$bb_incdir/ag_inline_object.h
fi
if [ "${with_inline_string}" != "no" ]; then
AG_INLINE_STRING="yes"
bb_o=$bb_incdir/ag_inline_string.h
echo '#ifndef AG_INLINE_STRING' >$bb_o
echo "#define AG_INLINE_STRING \"$AG_INLINE_STRING\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_STRING' >$bb_incdir/ag_inline_string.h
fi
if [ "${with_inline_tbl}" != "no" ]; then
AG_INLINE_TBL="yes"
bb_o=$bb_incdir/ag_inline_tbl.h
echo '#ifndef AG_INLINE_TBL' >$bb_o
echo "#define AG_INLINE_TBL \"$AG_INLINE_TBL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_TBL' >$bb_incdir/ag_inline_tbl.h
fi
if [ "${with_inline_threads}" != "no" ]; then
AG_INLINE_THREADS="yes"
bb_o=$bb_incdir/ag_inline_threads.h
echo '#ifndef AG_INLINE_THREADS' >$bb_o
echo "#define AG_INLINE_THREADS \"$AG_INLINE_THREADS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_THREADS' >$bb_incdir/ag_inline_threads.h
fi
if [ "${with_inline_variable}" != "no" ]; then
AG_INLINE_VARIABLE="yes"
bb_o=$bb_incdir/ag_inline_variable.h
echo '#ifndef AG_INLINE_VARIABLE' >$bb_o
echo "#define AG_INLINE_VARIABLE \"$AG_INLINE_VARIABLE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_VARIABLE' >$bb_incdir/ag_inline_variable.h
fi
if [ "${with_inline_surface}" != "no" ]; then
AG_INLINE_SURFACE="yes"
bb_o=$bb_incdir/ag_inline_surface.h
echo '#ifndef AG_INLINE_SURFACE' >$bb_o
echo "#define AG_INLINE_SURFACE \"$AG_INLINE_SURFACE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_SURFACE' >$bb_incdir/ag_inline_surface.h
fi
if [ "${with_inline_widget}" != "no" ]; then
AG_INLINE_WIDGET="yes"
bb_o=$bb_incdir/ag_inline_widget.h
echo '#ifndef AG_INLINE_WIDGET' >$bb_o
echo "#define AG_INLINE_WIDGET \"$AG_INLINE_WIDGET\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_INLINE_WIDGET' >$bb_incdir/ag_inline_widget.h
fi
$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
echo >>config.log
echo '# C: _MK_HAVE_SYS_TYPES_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: _MK_HAVE_STDINT_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: HAVE_INT64_T' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_INT64_T=no
echo '#undef HAVE_INT64_T' >$bb_incdir/have_int64_t.h
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
echo >>config.log
echo '# C: HAVE___INT64' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE___INT64=no
echo '#undef HAVE___INT64' >$bb_incdir/have___int64.h
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
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
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
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
echo >>config.log
echo '# C: HAVE_INT64_T' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_INT64_T=no
echo '#undef HAVE_INT64_T' >$bb_incdir/have_int64_t.h
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
echo >>config.log
echo '# C: HAVE___INT64' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE___INT64=no
echo '#undef HAVE___INT64' >$bb_incdir/have___int64.h
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
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
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
fi
fi
else
echo '#undef HAVE_64BIT' >$bb_incdir/have_64bit.h
fi
fi
# END sys_types
$ECHO_N 'checking for ...'
$ECHO_N '# checking for ...' >>config.log
# BEGIN sys_stat
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[]) {
struct stat sb;
uid_t uid;
if (stat("/tmp/foo", &sb) != 0) { return (1); }
return ((uid = sb.st_uid) == (uid_t)0);
}
EOT
echo >>config.log
echo '# C: _MK_HAVE_SYS_STAT_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_STAT_H=yes
bb_o=$bb_incdir/_mk_have_sys_stat_h.h
echo '#ifndef _MK_HAVE_SYS_STAT_H' >$bb_o
echo "#define _MK_HAVE_SYS_STAT_H \"$_MK_HAVE_SYS_STAT_H\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
_MK_HAVE_SYS_STAT_H=no
echo '#undef _MK_HAVE_SYS_STAT_H' >$bb_incdir/_mk_have_sys_stat_h.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END sys_stat
$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
echo >>config.log
echo '# C: _MK_HAVE_STDLIB_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: _MK_HAVE_UNISTD_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
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
echo >>config.log
echo '# C: _MK_HAVE_LIMITS_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
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
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END limits_h
$ECHO_N 'checking for ...'
$ECHO_N '# checking for ...' >>config.log
# BEGIN float_h
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
float flt = 0.0f;
double dbl = 0.0;
flt += FLT_EPSILON;
dbl += DBL_EPSILON;
return (0);
}
EOT
echo >>config.log
echo '# C: _MK_HAVE_FLOAT_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_FLOAT_H=yes
bb_o=$bb_incdir/_mk_have_float_h.h
echo '#ifndef _MK_HAVE_FLOAT_H' >$bb_o
echo "#define _MK_HAVE_FLOAT_H \"$_MK_HAVE_FLOAT_H\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
_MK_HAVE_FLOAT_H=no
echo '#undef _MK_HAVE_FLOAT_H' >$bb_incdir/_mk_have_float_h.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END float_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
echo >>config.log
echo '# C: HAVE_MATH' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${MATH_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${MATH_LIBS} 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_MATH=no
echo '#undef HAVE_MATH' >$bb_incdir/have_math.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END math
$ECHO_N 'checking for the C math library (C99)...'
$ECHO_N '# checking for the C math library (C99)...' >>config.log
# BEGIN math_c99
if [ "" != "" ]; then
MATH_C99_CFLAGS="-I"
MATH_C99_LIBS="-L -lm"
else
MATH_C99_CFLAGS=""
MATH_C99_LIBS="-lm"
fi
case "${host}" in
*-pc-mingw32*)
echo 'skipping (libmingwex linker errors)'
echo '# skipping (libmingwex linker errors)' >>config.log
HAVE_MATH_C99="no"
MATH_C99_CFLAGS=""
MATH_C99_LIBS=""
echo '#undef HAVE_MATH_C99' >$bb_incdir/have_math_c99.h
;;
*)
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
float f = 1.0;
double d = 1.0;
d = fabs(d);
f = sqrtf(fabsf(f));
return (f > d) ? 0 : 1;
}
EOT
echo >>config.log
echo '# C: HAVE_MATH_C99' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_C99_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${MATH_C99_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${CFLAGS} ${MATH_C99_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${MATH_C99_LIBS} 1>/dev/null 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_C99=yes
bb_o=$bb_incdir/have_math_c99.h
echo '#ifndef HAVE_MATH_C99' >$bb_o
echo "#define HAVE_MATH_C99 \"$HAVE_MATH_C99\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_MATH_C99=no
echo '#undef HAVE_MATH_C99' >$bb_incdir/have_math_c99.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_MATH_C99}" = "no" ]; then
MATH_C99_CFLAGS=""
MATH_C99_LIBS=""
echo '#undef HAVE_MATH_C99' >$bb_incdir/have_math_c99.h
fi
;;
esac
# END math_c99
$ECHO_N 'checking for a fdclose() function...'
$ECHO_N '# checking for a fdclose() function...' >>config.log
# BEGIN fdclose
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
FILE *f = fopen("/dev/null","r");
int fdp;
return fdclose(f, &fdp);
}
EOT
echo >>config.log
echo '# C: HAVE_FDCLOSE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_FDCLOSE=yes
bb_o=$bb_incdir/have_fdclose.h
echo '#ifndef HAVE_FDCLOSE' >$bb_o
echo "#define HAVE_FDCLOSE \"$HAVE_FDCLOSE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_FDCLOSE=no
echo '#undef HAVE_FDCLOSE' >$bb_incdir/have_fdclose.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END fdclose
$ECHO_N 'checking for getpwuid()...'
$ECHO_N '# checking for getpwuid()...' >>config.log
# BEGIN getpwuid
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
struct passwd *pwd;
uid_t uid = 0;
pwd = getpwuid(uid);
return (pwd != NULL && pwd->pw_dir != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GETPWUID' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETPWUID=yes
bb_o=$bb_incdir/have_getpwuid.h
echo '#ifndef HAVE_GETPWUID' >$bb_o
echo "#define HAVE_GETPWUID \"$HAVE_GETPWUID\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETPWUID=no
echo '#undef HAVE_GETPWUID' >$bb_incdir/have_getpwuid.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getpwuid
$ECHO_N 'checking for the getpwnam_r() interface...'
$ECHO_N '# checking for the getpwnam_r() interface...' >>config.log
# BEGIN getpwnam_r
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
struct passwd pw, *res;
char *buf;
size_t bufSize;
int rv;
bufSize = sysconf(_SC_GETPW_R_SIZE_MAX);
if (bufSize == -1) { bufSize = 16384; }
if ((buf = malloc(bufSize)) == NULL) { return (1); }
rv = getpwnam_r("foo", &pw, buf, bufSize, &res);
if (res == NULL) {
return (rv == 0);
}
return (pw.pw_dir != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GETPWNAM_R' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETPWNAM_R=yes
bb_o=$bb_incdir/have_getpwnam_r.h
echo '#ifndef HAVE_GETPWNAM_R' >$bb_o
echo "#define HAVE_GETPWNAM_R \"$HAVE_GETPWNAM_R\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETPWNAM_R=no
echo '#undef HAVE_GETPWNAM_R' >$bb_incdir/have_getpwnam_r.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getpwnam_r
$ECHO_N 'checking for getenv()...'
$ECHO_N '# checking for getenv()...' >>config.log
# BEGIN getenv
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
(void)getenv("PATH");
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GETENV' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETENV=yes
bb_o=$bb_incdir/have_getenv.h
echo '#ifndef HAVE_GETENV' >$bb_o
echo "#define HAVE_GETENV \"$HAVE_GETENV\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETENV=no
echo '#undef HAVE_GETENV' >$bb_incdir/have_getenv.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getenv
$ECHO_N 'checking for getuid()...'
$ECHO_N '# checking for getuid()...' >>config.log
# BEGIN getuid
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int
main(int argc, char *argv[])
{
uid_t uid = getuid();
return (uid != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_GETUID' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETUID=yes
bb_o=$bb_incdir/have_getuid.h
echo '#ifndef HAVE_GETUID' >$bb_o
echo "#define HAVE_GETUID \"$HAVE_GETUID\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETUID=no
echo '#undef HAVE_GETUID' >$bb_incdir/have_getuid.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getuid
$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
echo >>config.log
echo '# C: HAVE_STRSEP' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_STRSEP=no
echo '#undef HAVE_STRSEP' >$bb_incdir/have_strsep.h
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
echo >>config.log
echo '# C: HAVE_ASPRINTF' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_ASPRINTF=no
echo '#undef HAVE_ASPRINTF' >$bb_incdir/have_asprintf.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END asprintf
$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
echo >>config.log
echo '# C: HAVE_SNPRINTF' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_SNPRINTF=no
echo '#undef HAVE_SNPRINTF' >$bb_incdir/have_snprintf.h
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
echo >>config.log
echo '# C: HAVE_VSNPRINTF' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_VSNPRINTF=no
echo '#undef HAVE_VSNPRINTF' >$bb_incdir/have_vsnprintf.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END vsnprintf
$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
echo >>config.log
echo '# C: HAVE_VASPRINTF' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -D_GNU_SOURCE -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_VASPRINTF=no
echo '#undef HAVE_VASPRINTF' >$bb_incdir/have_vasprintf.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END vasprintf
$ECHO_N 'checking for ANSI-style signal() facilities...'
$ECHO_N '# checking for ANSI-style signal() facilities...' >>config.log
# BEGIN signal
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
void sighandler(int sig) { }
int
main(int argc, char *argv[])
{
signal(SIGTERM, sighandler);
signal(SIGILL, sighandler);
return (0);
}
EOT
echo >>config.log
echo '# C: _MK_HAVE_SIGNAL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SIGNAL=yes
bb_o=$bb_incdir/_mk_have_signal.h
echo '#ifndef _MK_HAVE_SIGNAL' >$bb_o
echo "#define _MK_HAVE_SIGNAL \"$_MK_HAVE_SIGNAL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
_MK_HAVE_SIGNAL=no
echo '#undef _MK_HAVE_SIGNAL' >$bb_incdir/_mk_have_signal.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END signal
$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
echo >>config.log
echo '# C: _MK_HAVE_STRTOLL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
_MK_HAVE_STRTOLL=no
echo '#undef _MK_HAVE_STRTOLL' >$bb_incdir/_mk_have_strtoll.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END strtoll
$ECHO_N 'checking for strtold()...'
$ECHO_N '# checking for strtold()...' >>config.log
# BEGIN strtold
if [ "${HAVE_LONG_DOUBLE}" = "yes" ]; then
if [ "${HAVE_CYGWIN}" = "no" ]; then
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifndef __NetBSD__
# define _XOPEN_SOURCE 600
#endif
#include
int
main(int argc, char *argv[])
{
long double ld;
char *ep = NULL;
char *foo = "1234";
ld = strtold(foo, &ep);
return (ld != 1234.0);
}
EOT
echo >>config.log
echo '# C: _MK_HAVE_STRTOLD' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_STRTOLD=yes
bb_o=$bb_incdir/_mk_have_strtold.h
echo '#ifndef _MK_HAVE_STRTOLD' >$bb_o
echo "#define _MK_HAVE_STRTOLD \"$_MK_HAVE_STRTOLD\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
_MK_HAVE_STRTOLD=no
echo '#undef _MK_HAVE_STRTOLD' >$bb_incdir/_mk_have_strtold.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
_MK_HAVE_STRTOLD="no"
echo '#undef _MK_HAVE_STRTOLD' >$bb_incdir/_mk_have_strtold.h
echo 'not checking (cygwin issues)'
echo '# not checking (cygwin issues)' >>config.log
fi
else
_MK_HAVE_STRTOLD="no"
echo '#undef _MK_HAVE_STRTOLD' >$bb_incdir/_mk_have_strtold.h
echo 'skipping (no long double)'
echo '# skipping (no long double)' >>config.log
fi
# END strtold
$ECHO_N 'checking for dlopen() interface...'
$ECHO_N '# checking for dlopen() interface...' >>config.log
# BEGIN dlopen
DSO_CFLAGS=""
DSO_LIBS=""
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS=Yes
echo >conftest$$.c
echo '#include ' >>conftest$$.c
echo 'int main (int argc, char *argv[]) { return (0); }' >>conftest$$.c
MK_COMPILE_STATUS=OK
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log
if [ "$?" != "0" ]; then
echo "# failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_DLFCN_H=yes
bb_o=$bb_incdir/have_dlfcn_h.h
echo '#ifndef HAVE_DLFCN_H' >$bb_o
echo "#define HAVE_DLFCN_H \"$HAVE_DLFCN_H\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_DLFCN_H"
fi
else
HAVE_DLFCN_H=no
echo '#undef HAVE_DLFCN_H' >$bb_incdir/have_dlfcn_h.h
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#ifdef HAVE_DLFCN_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (error != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_DLOPEN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_DLOPEN=yes
bb_o=$bb_incdir/have_dlopen.h
echo '#ifndef HAVE_DLOPEN' >$bb_o
echo "#define HAVE_DLOPEN \"$HAVE_DLOPEN\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_DLOPEN=no
echo '#undef HAVE_DLOPEN' >$bb_incdir/have_dlopen.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_DLOPEN}" = "no" ]; then
$ECHO_N 'checking for dlopen() in -ldl...'
$ECHO_N '# checking for dlopen() in -ldl...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#ifdef HAVE_DLFCN_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
char *error;
handle = dlopen("foo.so", 0);
error = dlerror();
(void)dlsym(handle, "foo");
return (error != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_DLOPEN' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -ldl -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -ldl -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_DLOPEN=yes
bb_o=$bb_incdir/have_dlopen.h
echo '#ifndef HAVE_DLOPEN' >$bb_o
echo "#define HAVE_DLOPEN \"$HAVE_DLOPEN\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_DLOPEN=no
echo '#undef HAVE_DLOPEN' >$bb_incdir/have_dlopen.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_DLOPEN}" = "yes" ]; then
DSO_CFLAGS=""
DSO_LIBS="-ldl"
else
HAVE_DLFCN_H="no"
DSO_CFLAGS=""
DSO_LIBS=""
echo '#undef HAVE_DLOPEN' >$bb_incdir/have_dlopen.h
echo '#undef HAVE_DLFCN_H' >$bb_incdir/have_dlfcn_h.h
fi
fi
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=
# END dlopen
$ECHO_N 'checking for dyld interface...'
$ECHO_N '# checking for dyld interface...' >>config.log
# BEGIN dyld
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS=Yes
echo >conftest$$.c
echo '#include ' >>conftest$$.c
echo 'int main (int argc, char *argv[]) { return (0); }' >>conftest$$.c
MK_COMPILE_STATUS=OK
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log
if [ "$?" != "0" ]; then
echo "# failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_MACH_O_DYLD_H=yes
bb_o=$bb_incdir/have_mach_o_dyld_h.h
echo '#ifndef HAVE_MACH_O_DYLD_H' >$bb_o
echo "#define HAVE_MACH_O_DYLD_H \"$HAVE_MACH_O_DYLD_H\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_MACH_O_DYLD_H"
fi
else
HAVE_MACH_O_DYLD_H=no
echo '#undef HAVE_MACH_O_DYLD_H' >$bb_incdir/have_mach_o_dyld_h.h
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef __APPLE__
# include
# ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
# if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
# error "deprecated in Leopard and later"
# endif
# endif
#endif
#ifdef HAVE_MACH_O_DYLD_H
#include
#endif
int
main(int argc, char *argv[])
{
NSObjectFileImage img;
NSObjectFileImageReturnCode rv;
rv = NSCreateObjectFileImageFromFile("foo", &img);
return (rv == NSObjectFileImageSuccess);
}
EOT
echo >>config.log
echo '# C: HAVE_DYLD' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_DYLD=yes
bb_o=$bb_incdir/have_dyld.h
echo '#ifndef HAVE_DYLD' >$bb_o
echo "#define HAVE_DYLD \"$HAVE_DYLD\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_DYLD=no
echo '#undef HAVE_DYLD' >$bb_incdir/have_dyld.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_DYLD}" = "yes" ]; then
$ECHO_N 'checking for NSLINKMODULE_OPTION_RETURN_ON_ERROR'
$ECHO_N '# checking for NSLINKMODULE_OPTION_RETURN_ON_ERROR' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef HAVE_MACH_O_DYLD_H
#include
#endif
int
main(int argc, char *argv[])
{
NSObjectFileImage img;
NSObjectFileImageReturnCode rv;
void *handle;
rv = NSCreateObjectFileImageFromFile("foo", &img);
handle = (void *)NSLinkModule(img, "foo",
NSLINKMODULE_OPTION_RETURN_ON_ERROR|
NSLINKMODULE_OPTION_NONE);
if (handle == NULL) {
NSLinkEditErrors errs;
int n;
const char *f, *s = NULL;
NSLinkEditError(&errs, &n, &f, &s);
}
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_DYLD_RETURN_ON_ERROR' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_DYLD_RETURN_ON_ERROR=yes
bb_o=$bb_incdir/have_dyld_return_on_error.h
echo '#ifndef HAVE_DYLD_RETURN_ON_ERROR' >$bb_o
echo "#define HAVE_DYLD_RETURN_ON_ERROR \"$HAVE_DYLD_RETURN_ON_ERROR\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_DYLD_RETURN_ON_ERROR=no
echo '#undef HAVE_DYLD_RETURN_ON_ERROR' >$bb_incdir/have_dyld_return_on_error.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
HAVE_MACH_O_DYLD_H="no"
HAVE_DYLD_RETURN_ON_ERROR="no"
echo '#undef HAVE_DYLD' >$bb_incdir/have_dyld.h
echo '#undef HAVE_MACH_O_DYLD_H' >$bb_incdir/have_mach_o_dyld_h.h
echo '#undef HAVE_DYLD_RETURN_ON_ERROR' >$bb_incdir/have_dyld_return_on_error.h
fi
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=
# END dyld
$ECHO_N 'checking for the shl_load() interface...'
$ECHO_N '# checking for the shl_load() interface...' >>config.log
# BEGIN shl_load
TEST_CFLAGS_ORIG="${TEST_CFLAGS}"
TEST_HEADERS=Yes
echo >conftest$$.c
echo '#include ' >>conftest$$.c
echo 'int main (int argc, char *argv[]) { return (0); }' >>conftest$$.c
MK_COMPILE_STATUS=OK
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log
if [ "$?" != "0" ]; then
echo "# failed $?" >>config.log
MK_COMPILE_STATUS="FAIL $?"
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
HAVE_DL_H=yes
bb_o=$bb_incdir/have_dl_h.h
echo '#ifndef HAVE_DL_H' >$bb_o
echo "#define HAVE_DL_H \"$HAVE_DL_H\"" >>$bb_o
echo '#endif' >>$bb_o
if [ "${TEST_HEADERS}" = "Yes" ]; then
TEST_CFLAGS="${TEST_CFLAGS} -DHAVE_DL_H"
fi
else
HAVE_DL_H=no
echo '#undef HAVE_DL_H' >$bb_incdir/have_dl_h.h
fi
if [ "" != "" ]; then
SHL_LOAD_LIBS="-L -ldld"
else
SHL_LOAD_LIBS="-ldld"
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#ifdef HAVE_DL_H
#include
#endif
int
main(int argc, char *argv[])
{
void *handle;
void **p;
handle = shl_load("foo.so", BIND_IMMEDIATE, 0);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_PROCEDURE, p);
(void)shl_findsym((shl_t *)&handle, "foo", TYPE_DATA, p);
shl_unload((shl_t)handle);
return (handle != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_SHL_LOAD' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${SHL_LOAD_LIBS} -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${SHL_LOAD_LIBS} -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SHL_LOAD=yes
bb_o=$bb_incdir/have_shl_load.h
echo '#ifndef HAVE_SHL_LOAD' >$bb_o
echo "#define HAVE_SHL_LOAD \"$HAVE_SHL_LOAD\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SHL_LOAD=no
echo '#undef HAVE_SHL_LOAD' >$bb_incdir/have_shl_load.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SHL_LOAD}" = "yes" ]; then
DSO_LIBS="$DSO_LIBS $SHL_LOAD_LIBS"
bb_o=$bb_incdir/have_shl_load.h
echo '#ifndef HAVE_SHL_LOAD' >$bb_o
echo "#define HAVE_SHL_LOAD \"$HAVE_SHL_LOAD\"" >>$bb_o
echo '#endif' >>$bb_o
else
HAVE_DL_H="no"
SHL_LOAD_LIBS=""
echo '#undef HAVE_SHL_LOAD' >$bb_incdir/have_shl_load.h
echo '#undef HAVE_DL_H' >$bb_incdir/have_dl_h.h
fi
TEST_CFLAGS="${TEST_CFLAGS_ORIG}"
TEST_HEADERS=
# END shl_load
$ECHO_N 'checking for gettimeofday()...'
$ECHO_N '# checking for gettimeofday()...' >>config.log
# BEGIN gettimeofday
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int
main(int argc, char *argv[])
{
struct timeval tv;
int rv = gettimeofday(&tv, NULL);
return (rv);
}
EOT
echo >>config.log
echo '# C: HAVE_GETTIMEOFDAY' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETTIMEOFDAY=yes
bb_o=$bb_incdir/have_gettimeofday.h
echo '#ifndef HAVE_GETTIMEOFDAY' >$bb_o
echo "#define HAVE_GETTIMEOFDAY \"$HAVE_GETTIMEOFDAY\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETTIMEOFDAY=no
echo '#undef HAVE_GETTIMEOFDAY' >$bb_incdir/have_gettimeofday.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END gettimeofday
$ECHO_N 'checking for the select() interface...'
$ECHO_N '# checking for the select() interface...' >>config.log
# BEGIN select
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
struct timeval tv;
int rv;
tv.tv_sec = 1;
tv.tv_usec = 1;
rv = select(0, NULL, NULL, NULL, &tv);
return (rv == -1 && errno != EINTR);
}
EOT
echo >>config.log
echo '# C: HAVE_SELECT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SELECT=yes
bb_o=$bb_incdir/have_select.h
echo '#ifndef HAVE_SELECT' >$bb_o
echo "#define HAVE_SELECT \"$HAVE_SELECT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SELECT=no
echo '#undef HAVE_SELECT' >$bb_incdir/have_select.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END select
$ECHO_N 'checking for glob()...'
$ECHO_N '# checking for glob()...' >>config.log
# BEGIN glob
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
glob_t gl;
int rv, i;
char *s = NULL;
rv = glob("~/foo", GLOB_TILDE, NULL, &gl);
for (i = 0; i < gl.gl_pathc; i++) { s = gl.gl_pathv[i]; }
return (rv != 0 && s != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GLOB' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GLOB=yes
bb_o=$bb_incdir/have_glob.h
echo '#ifndef HAVE_GLOB' >$bb_o
echo "#define HAVE_GLOB \"$HAVE_GLOB\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GLOB=no
echo '#undef HAVE_GLOB' >$bb_incdir/have_glob.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END glob
$ECHO_N 'checking for the getopt() function...'
$ECHO_N '# checking for the getopt() function...' >>config.log
# BEGIN getopt
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int
main(int argc, char *argv[])
{
int c, x = 0;
while ((c = getopt(argc, argv, "foo")) != -1) {
extern char *optarg;
extern int optind, opterr, optopt;
if (optarg != NULL) { x = 1; }
if (optind > 0) { x = 2; }
if (opterr > 0) { x = 3; }
if (optopt > 0) { x = 4; }
}
return (x != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_GETOPT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETOPT=yes
bb_o=$bb_incdir/have_getopt.h
echo '#ifndef HAVE_GETOPT' >$bb_o
echo "#define HAVE_GETOPT \"$HAVE_GETOPT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETOPT=no
echo '#undef HAVE_GETOPT' >$bb_incdir/have_getopt.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getopt
$ECHO_N 'checking for the execvp() function...'
$ECHO_N '# checking for the execvp() function...' >>config.log
# BEGIN execvp
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
char *args[3] = { "foo", NULL, NULL };
int rv;
rv = execvp(args[0], args);
return (rv);
}
EOT
echo >>config.log
echo '# C: HAVE_EXECVP' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_EXECVP=yes
bb_o=$bb_incdir/have_execvp.h
echo '#ifndef HAVE_EXECVP' >$bb_o
echo "#define HAVE_EXECVP \"$HAVE_EXECVP\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_EXECVP=no
echo '#undef HAVE_EXECVP' >$bb_incdir/have_execvp.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END execvp
$ECHO_N 'checking for clock_gettime() interface (w/o -lrt)...'
$ECHO_N '# checking for clock_gettime() interface (w/o -lrt)...' >>config.log
# BEGIN clock_gettime
CLOCK_CFLAGS=""
CLOCK_LIBS=""
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
#ifdef __FreeBSD__
clock_gettime(CLOCK_SECOND, &ts);
#endif
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_CLOCK_GETTIME' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${CLOCK_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${CLOCK_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${CLOCK_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${CLOCK_LIBS} 1>/dev/null 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_CLOCK_GETTIME=yes
bb_o=$bb_incdir/have_clock_gettime.h
echo '#ifndef HAVE_CLOCK_GETTIME' >$bb_o
echo "#define HAVE_CLOCK_GETTIME \"$HAVE_CLOCK_GETTIME\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CLOCK_GETTIME=no
echo '#undef HAVE_CLOCK_GETTIME' >$bb_incdir/have_clock_gettime.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CLOCK_GETTIME}" = "yes" ]; then
bb_o=$bb_incdir/have_clock_gettime.h
echo '#ifndef HAVE_CLOCK_GETTIME' >$bb_o
echo "#define HAVE_CLOCK_GETTIME \"$HAVE_CLOCK_GETTIME\"" >>$bb_o
echo '#endif' >>$bb_o
else
$ECHO_N 'checking for clock_gettime() interface (with -lrt)...'
$ECHO_N '# checking for clock_gettime() interface (with -lrt)...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
#ifdef __FreeBSD__
clock_gettime(CLOCK_SECOND, &ts);
#endif
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_CLOCK_GETTIME' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${CLOCK_CFLAGS} -o $testdir/conftest$$ conftest$$.c -lrt 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${CLOCK_CFLAGS} -o $testdir/conftest$$ conftest$$.c -lrt 1>/dev/null 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_CLOCK_GETTIME=yes
bb_o=$bb_incdir/have_clock_gettime.h
echo '#ifndef HAVE_CLOCK_GETTIME' >$bb_o
echo "#define HAVE_CLOCK_GETTIME \"$HAVE_CLOCK_GETTIME\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CLOCK_GETTIME=no
echo '#undef HAVE_CLOCK_GETTIME' >$bb_incdir/have_clock_gettime.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CLOCK_GETTIME}" = "yes" ]; then
CLOCK_LIBS="-lrt"
bb_o=$bb_incdir/have_clock_gettime.h
echo '#ifndef HAVE_CLOCK_GETTIME' >$bb_o
echo "#define HAVE_CLOCK_GETTIME \"$HAVE_CLOCK_GETTIME\"" >>$bb_o
echo '#endif' >>$bb_o
else
CLOCK_CFLAGS=""
CLOCK_LIBS=""
echo '#undef HAVE_CLOCK_GETTIME' >$bb_incdir/have_clock_gettime.h
fi
fi
# END clock_gettime
$ECHO_N 'checking for winmm time interface...'
$ECHO_N '# checking for winmm time interface...' >>config.log
# BEGIN clock_win32
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _XBOX
#include
#else
#include
#include
#endif
int
main(int argc, char *argv[])
{
DWORD t0;
#ifndef _XBOX
timeBeginPeriod(1);
#endif
t0 = timeGetTime();
Sleep(1);
return (t0 != 0) ? 0 : 1;
}
EOT
echo >>config.log
echo '# C: HAVE_CLOCK_WIN32' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c -lwinmm 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c -lwinmm 1>/dev/null 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_CLOCK_WIN32=yes
bb_o=$bb_incdir/have_clock_win32.h
echo '#ifndef HAVE_CLOCK_WIN32' >$bb_o
echo "#define HAVE_CLOCK_WIN32 \"$HAVE_CLOCK_WIN32\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CLOCK_WIN32=no
echo '#undef HAVE_CLOCK_WIN32' >$bb_incdir/have_clock_win32.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_CLOCK_WIN32}" = "yes" ]; then
CLOCK_CFLAGS=""
CLOCK_LIBS="-lwinmm"
bb_o=$bb_incdir/have_clock_win32.h
echo '#ifndef HAVE_CLOCK_WIN32' >$bb_o
echo "#define HAVE_CLOCK_WIN32 \"$HAVE_CLOCK_WIN32\"" >>$bb_o
echo '#endif' >>$bb_o
else
CLOCK_CFLAGS=""
CLOCK_LIBS=""
echo '#undef HAVE_CLOCK_WIN32' >$bb_incdir/have_clock_win32.h
fi
# END clock_win32
$ECHO_N 'checking for nanosleep()...'
$ECHO_N '# checking for nanosleep()...' >>config.log
# BEGIN nanosleep
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
struct timespec rqtp, rmtp;
int rv;
rqtp.tv_sec = 1;
rqtp.tv_nsec = 1000000;
rv = nanosleep(&rqtp, &rmtp);
return (rv == -1);
}
EOT
echo >>config.log
echo '# C: HAVE_NANOSLEEP' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_NANOSLEEP=yes
bb_o=$bb_incdir/have_nanosleep.h
echo '#ifndef HAVE_NANOSLEEP' >$bb_o
echo "#define HAVE_NANOSLEEP \"$HAVE_NANOSLEEP\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_NANOSLEEP=no
echo '#undef HAVE_NANOSLEEP' >$bb_incdir/have_nanosleep.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END nanosleep
$ECHO_N 'checking for the kqueue() mechanism...'
$ECHO_N '# checking for the kqueue() mechanism...' >>config.log
# BEGIN kqueue
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
struct kevent kev, chg;
int kq, fd = -1, nev;
if ((kq = kqueue()) == -1) { return (1); }
#if defined(__NetBSD__)
EV_SET(&kev, (uintptr_t)fd, EVFILT_READ, EV_ADD|EV_ENABLE|EV_ONESHOT, 0, 0, (intptr_t)NULL);
EV_SET(&kev, (uintptr_t)1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 0, (intptr_t)NULL);
#else
EV_SET(&kev, fd, EVFILT_READ, EV_ADD|EV_ENABLE|EV_ONESHOT, 0, 0, NULL);
EV_SET(&kev, 1, EVFILT_TIMER, EV_ADD|EV_ENABLE, 0, 0, NULL);
#endif
nev = kevent(kq, &kev, 1, &chg, 1, NULL);
return (chg.flags & EV_ERROR);
}
EOT
echo >>config.log
echo '# C: HAVE_KQUEUE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_KQUEUE=yes
bb_o=$bb_incdir/have_kqueue.h
echo '#ifndef HAVE_KQUEUE' >$bb_o
echo "#define HAVE_KQUEUE \"$HAVE_KQUEUE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_KQUEUE=no
echo '#undef HAVE_KQUEUE' >$bb_incdir/have_kqueue.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END kqueue
$ECHO_N 'checking for the timerfd interface...'
$ECHO_N '# checking for the timerfd interface...' >>config.log
# BEGIN timerfd
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
struct itimerspec its;
int fd;
if ((fd = timerfd_create(CLOCK_MONOTONIC, TFD_TIMER_ABSTIME)) != -1) {
its.it_interval.tv_sec = 0;
its.it_interval.tv_nsec = 0L;
its.it_value.tv_sec = 0;
its.it_value.tv_nsec = 0L;
return (timerfd_settime(fd, 0, &its, NULL) == -1);
}
return (1);
}
EOT
echo >>config.log
echo '# C: HAVE_TIMERFD' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_TIMERFD=yes
bb_o=$bb_incdir/have_timerfd.h
echo '#ifndef HAVE_TIMERFD' >$bb_o
echo "#define HAVE_TIMERFD \"$HAVE_TIMERFD\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_TIMERFD=no
echo '#undef HAVE_TIMERFD' >$bb_incdir/have_timerfd.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END timerfd
$ECHO_N 'checking for Windows CSIDL...'
$ECHO_N '# checking for Windows CSIDL...' >>config.log
# BEGIN csidl
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
WCHAR path[MAX_PATH];
if (SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, path))) {
return (0);
} else {
return (1);
}
}
EOT
echo >>config.log
echo '# C: HAVE_CSIDL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_CSIDL=yes
bb_o=$bb_incdir/have_csidl.h
echo '#ifndef HAVE_CSIDL' >$bb_o
echo "#define HAVE_CSIDL \"$HAVE_CSIDL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_CSIDL=no
echo '#undef HAVE_CSIDL' >$bb_incdir/have_csidl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END csidl
$ECHO_N 'checking for the Xbox XDK...'
$ECHO_N '# checking for the Xbox XDK...' >>config.log
# BEGIN xbox
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#ifndef _XBOX
# error undefined
#endif
int
main(int argc, char *argv[])
{
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_XBOX' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_XBOX=yes
bb_o=$bb_incdir/have_xbox.h
echo '#ifndef HAVE_XBOX' >$bb_o
echo "#define HAVE_XBOX \"$HAVE_XBOX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_XBOX=no
echo '#undef HAVE_XBOX' >$bb_incdir/have_xbox.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END xbox
$ECHO_N 'checking for mprotect()...'
$ECHO_N '# checking for mprotect()...' >>config.log
# BEGIN mprotect
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
void *p;
int psz;
char *buffer;
psz = sysconf(_SC_PAGE_SIZE);
if (psz == -1) {
return (1);
}
posix_memalign(&buffer, psz, psz*4);
if (buffer == NULL)
return (1);
mprotect(buffer + psz*2, psz, PROT_READ);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_MPROTECT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_MPROTECT=yes
bb_o=$bb_incdir/have_mprotect.h
echo '#ifndef HAVE_MPROTECT' >$bb_o
echo "#define HAVE_MPROTECT \"$HAVE_MPROTECT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_MPROTECT=no
echo '#undef HAVE_MPROTECT' >$bb_incdir/have_mprotect.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END mprotect
$ECHO_N 'checking for dirfd()...'
$ECHO_N '# checking for dirfd()...' >>config.log
# BEGIN dirfd
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int
main(int argc, char *argv[])
{
DIR *dirp = opendir("foo");
int fd = -1;
if (dirp != NULL) {
fd = dirfd(dirp);
closedir(dirp);
}
return (fd == -1);
}
EOT
echo >>config.log
echo '# C: HAVE_DIRFD' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_DIRFD=yes
bb_o=$bb_incdir/have_dirfd.h
echo '#ifndef HAVE_DIRFD' >$bb_o
echo "#define HAVE_DIRFD \"$HAVE_DIRFD\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_DIRFD=no
echo '#undef HAVE_DIRFD' >$bb_incdir/have_dirfd.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END dirfd
CFLAGS="$CFLAGS -D_AGAR_INTERNAL"
CFLAGS="$CFLAGS -D_DEFAULT_SOURCE"
CFLAGS="$CFLAGS -D_BSD_SOURCE"
case "${host}" in
*-*-darwin*)
CFLAGS="$CFLAGS -D_DARWIN_C_SOURCE"
;;
esac
if [ "${enable_warnings}" = 'yes' ]
then
CFLAGS="$CFLAGS -Wall"
CFLAGS="$CFLAGS -Werror"
CFLAGS="$CFLAGS -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wno-switch"
case "${host}" in
*-*-darwin*)
CFLAGS="$CFLAGS -Wno-deprecated-declarations"
;;
esac
fi
if [ "${enable_debug}" = 'yes' ]
then
AG_DEBUG="yes"
bb_o=$bb_incdir/ag_debug.h
echo '#ifndef AG_DEBUG' >$bb_o
echo "#define AG_DEBUG \"$AG_DEBUG\"" >>$bb_o
echo '#endif' >>$bb_o
AG_TYPE_SAFETY="yes"
bb_o=$bb_incdir/ag_type_safety.h
echo '#ifndef AG_TYPE_SAFETY' >$bb_o
echo "#define AG_TYPE_SAFETY \"$AG_TYPE_SAFETY\"" >>$bb_o
echo '#endif' >>$bb_o
CFLAGS="${CFLAGS} -g"
else
echo '#undef AG_DEBUG' >$bb_incdir/ag_debug.h
if [ "${enable_type_safety}" = 'yes' ]; then
AG_TYPE_SAFETY="yes"
bb_o=$bb_incdir/ag_type_safety.h
echo '#ifndef AG_TYPE_SAFETY' >$bb_o
echo "#define AG_TYPE_SAFETY \"$AG_TYPE_SAFETY\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_TYPE_SAFETY' >$bb_incdir/ag_type_safety.h
fi
fi
if [ "${enable_debug_surfaces}" = 'yes' ]
then
CFLAGS="${CFLAGS} -DDEBUG_SURFACES"
fi
if [ "${enable_ansi_color}" != 'no' ]; then
AG_ANSI_COLOR="yes"
bb_o=$bb_incdir/ag_ansi_color.h
echo '#ifndef AG_ANSI_COLOR' >$bb_o
echo "#define AG_ANSI_COLOR \"$AG_ANSI_COLOR\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_ANSI_COLOR' >$bb_incdir/ag_ansi_color.h
fi
if [ "${enable_dso}" != 'no' ]; then
AG_ENABLE_DSO="yes"
bb_o=$bb_incdir/ag_enable_dso.h
echo '#ifndef AG_ENABLE_DSO' >$bb_o
echo "#define AG_ENABLE_DSO \"$AG_ENABLE_DSO\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_ENABLE_DSO' >$bb_incdir/ag_enable_dso.h
fi
if [ "${enable_event_loop}" != 'no' ]; then
AG_EVENT_LOOP="yes"
bb_o=$bb_incdir/ag_event_loop.h
echo '#ifndef AG_EVENT_LOOP' >$bb_o
echo "#define AG_EVENT_LOOP \"$AG_EVENT_LOOP\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_EVENT_LOOP' >$bb_incdir/ag_event_loop.h
fi
if [ "${enable_exec}" != 'no' ]; then
AG_ENABLE_EXEC="yes"
bb_o=$bb_incdir/ag_enable_exec.h
echo '#ifndef AG_ENABLE_EXEC' >$bb_o
echo "#define AG_ENABLE_EXEC \"$AG_ENABLE_EXEC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_ENABLE_EXEC' >$bb_incdir/ag_enable_exec.h
fi
if [ "${enable_legacy}" != 'no' ]; then
AG_LEGACY="yes"
bb_o=$bb_incdir/ag_legacy.h
echo '#ifndef AG_LEGACY' >$bb_o
echo "#define AG_LEGACY \"$AG_LEGACY\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_LEGACY' >$bb_incdir/ag_legacy.h
fi
if [ "${enable_named_args}" != 'no' ]; then
AG_NAMED_ARGS="yes"
bb_o=$bb_incdir/ag_named_args.h
echo '#ifndef AG_NAMED_ARGS' >$bb_o
echo "#define AG_NAMED_ARGS \"$AG_NAMED_ARGS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_NAMED_ARGS' >$bb_incdir/ag_named_args.h
fi
if [ "${enable_namespaces}" != 'no' ]; then
AG_NAMESPACES="yes"
bb_o=$bb_incdir/ag_namespaces.h
echo '#ifndef AG_NAMESPACES' >$bb_o
echo "#define AG_NAMESPACES \"$AG_NAMESPACES\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_NAMESPACES' >$bb_incdir/ag_namespaces.h
fi
if [ "${enable_serialization}" != 'no' ]; then
AG_SERIALIZATION="yes"
bb_o=$bb_incdir/ag_serialization.h
echo '#ifndef AG_SERIALIZATION' >$bb_o
echo "#define AG_SERIALIZATION \"$AG_SERIALIZATION\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_SERIALIZATION' >$bb_incdir/ag_serialization.h
fi
if [ "${enable_string}" != 'no' ]; then
AG_ENABLE_STRING="yes"
bb_o=$bb_incdir/ag_enable_string.h
echo '#ifndef AG_ENABLE_STRING' >$bb_o
echo "#define AG_ENABLE_STRING \"$AG_ENABLE_STRING\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_ENABLE_STRING' >$bb_incdir/ag_enable_string.h
fi
if [ "${enable_timers}" != 'no' ]; then
AG_TIMERS="yes"
bb_o=$bb_incdir/ag_timers.h
echo '#ifndef AG_TIMERS' >$bb_o
echo "#define AG_TIMERS \"$AG_TIMERS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_TIMERS' >$bb_incdir/ag_timers.h
fi
if [ "${enable_unicode}" != 'no' ]; then
AG_UNICODE="yes"
bb_o=$bb_incdir/ag_unicode.h
echo '#ifndef AG_UNICODE' >$bb_o
echo "#define AG_UNICODE \"$AG_UNICODE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_UNICODE' >$bb_incdir/ag_unicode.h
fi
if [ "${enable_user}" != 'no' ]; then
AG_USER="yes"
bb_o=$bb_incdir/ag_user.h
echo '#ifndef AG_USER' >$bb_o
echo "#define AG_USER \"$AG_USER\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_USER' >$bb_incdir/ag_user.h
fi
if [ "${enable_verbosity}" != 'no' ]; then
AG_VERBOSITY="yes"
bb_o=$bb_incdir/ag_verbosity.h
echo '#ifndef AG_VERBOSITY' >$bb_o
echo "#define AG_VERBOSITY \"$AG_VERBOSITY\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_VERBOSITY' >$bb_incdir/ag_verbosity.h
fi
if [ "${enable_widgets}" != 'no' ]; then
AG_WIDGETS="yes"
bb_o=$bb_incdir/ag_widgets.h
echo '#ifndef AG_WIDGETS' >$bb_o
echo "#define AG_WIDGETS \"$AG_WIDGETS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_WIDGETS' >$bb_incdir/ag_widgets.h
fi
if [ "${enable_wm_hints}" != 'no' ]; then
AG_WM_HINTS="yes"
bb_o=$bb_incdir/ag_wm_hints.h
echo '#ifndef AG_WM_HINTS' >$bb_o
echo "#define AG_WM_HINTS \"$AG_WM_HINTS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef AG_WM_HINTS' >$bb_incdir/ag_wm_hints.h
fi
if [ "${enable_gui}" != 'no' ]
then
ENABLE_GUI="yes"
bb_o=$bb_incdir/enable_gui.h
echo '#ifndef ENABLE_GUI' >$bb_o
echo "#define ENABLE_GUI \"$ENABLE_GUI\"" >>$bb_o
echo '#endif' >>$bb_o
ENABLE_GUI_LIBS="-L../gui -lag_gui"
SUBDIR_gui="gui"
if [ "${with_sdl2}" != 'no' ]
then
$ECHO_N 'checking for SDL 2.0...'
$ECHO_N '# checking for SDL 2.0...' >>config.log
# BEGIN sdl2(2.0.22 ${prefix_sdl2})
if [ "${prefix_sdl2}" != "" ]; then
SDL2_PREFIX=
MK_EXEC_FOUND=No
if [ "${prefix_sdl2}" != "" ]; then
if [ -x "${prefix_sdl2}/bin/sdl2-config" -a ! -d "${prefix_sdl2}/bin/sdl2-config" ]; then
SDL2_PREFIX=`${prefix_sdl2}/bin/sdl2-config --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl2}/bin/sdl2-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_PREFIX=`${path}/sdl2-config --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config"
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_PREFIX=`${path}/sdl2-config.exe --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL2_VERSION=
MK_EXEC_FOUND=No
if [ "${prefix_sdl2}" != "" ]; then
if [ -x "${prefix_sdl2}/bin/sdl2-config" -a ! -d "${prefix_sdl2}/bin/sdl2-config" ]; then
SDL2_VERSION=`${prefix_sdl2}/bin/sdl2-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl2}/bin/sdl2-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_VERSION=`${path}/sdl2-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config"
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_VERSION=`${path}/sdl2-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL2_CFLAGS=
MK_EXEC_FOUND=No
if [ "${prefix_sdl2}" != "" ]; then
if [ -x "${prefix_sdl2}/bin/sdl2-config" -a ! -d "${prefix_sdl2}/bin/sdl2-config" ]; then
SDL2_CFLAGS=`${prefix_sdl2}/bin/sdl2-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl2}/bin/sdl2-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_CFLAGS=`${path}/sdl2-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config"
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_CFLAGS=`${path}/sdl2-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL2_LIBS=
MK_EXEC_FOUND=No
if [ "${prefix_sdl2}" != "" ]; then
if [ -x "${prefix_sdl2}/bin/sdl2-config" -a ! -d "${prefix_sdl2}/bin/sdl2-config" ]; then
SDL2_LIBS=`${prefix_sdl2}/bin/sdl2-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl2}/bin/sdl2-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_LIBS=`${path}/sdl2-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config"
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_LIBS=`${path}/sdl2-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl2-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
else
case "${host}" in
*-*-darwin*)
MK_EXEC_FOUND=No
SDL2_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_VERSION=`${path}/sdl2-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_VERSION=`${path}/sdl2-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
if [ "${SDL2_VERSION}" != "" ]; then
MK_EXEC_FOUND=No
SDL2_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_PREFIX=`${path}/sdl2-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_PREFIX=`${path}/sdl2-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL2_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_CFLAGS=`${path}/sdl2-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_CFLAGS=`${path}/sdl2-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL2_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_LIBS=`${path}/sdl2-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_LIBS=`${path}/sdl2-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
else
$ECHO_N 'framework...'
$ECHO_N '# framework...' >>config.log
SDL2_VERSION="2.0.0"
SDL2_CFLAGS="-D_USE_SDL_FRAMEWORK"
SDL2_LIBS="-framework SDL2"
fi
;;
*)
MK_EXEC_FOUND=No
SDL2_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_PREFIX=`${path}/sdl2-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_PREFIX=`${path}/sdl2-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL2_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_VERSION=`${path}/sdl2-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_VERSION=`${path}/sdl2-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL2_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_CFLAGS=`${path}/sdl2-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_CFLAGS=`${path}/sdl2-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL2_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl2-config" -a ! -d "${path}/sdl2-config" ]; then
SDL2_LIBS=`${path}/sdl2-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl2-config.exe" ]; then
SDL2_LIBS=`${path}/sdl2-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
;;
esac
fi
if [ "${SDL2_VERSION}" != "" ]; then
if [ "${prefix_sdl2}" != "" ]; then
echo "yes ($SDL2_VERSION in ${prefix_sdl2})"
echo "# yes ($SDL2_VERSION in ${prefix_sdl2})" >>config.log
else
echo "yes ($SDL2_VERSION)"
echo "# yes ($SDL2_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$SDL2_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$SDL2_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$SDL2_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 2 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 2 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 0 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 0 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 22 ]; 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 2.0.22 (found $SDL2_VERSION)"
echo "# * Minimum required version is 2.0.22 (found $SDL2_VERSION)" >>config.log
echo '*'
echo '# *' >>config.log
fi
else
if [ "${prefix_sdl2}" != "" ]; then
echo "no (not in ${prefix_sdl2})"
echo "# no (not in ${prefix_sdl2})" >>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 SDL2 works...'
$ECHO_N '# checking whether SDL2 works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_SDL_FRAMEWORK
# include
# ifdef main
# undef main
# endif
#else
# include
#endif
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SDL2' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL2_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL2_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL2_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL2_LIBS} 1>/dev/null 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_SDL2=yes
bb_o=$bb_incdir/have_sdl2.h
echo '#ifndef HAVE_SDL2' >$bb_o
echo "#define HAVE_SDL2 \"$HAVE_SDL2\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SDL2=no
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SDL2}" = "yes" ]; then
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
if [ -e "${SDL2_PREFIX}/include/SDL2" ]; then
SDL2_CFLAGS="-I${SDL2_PREFIX}/include/SDL2 -D_GNU_SOURCE=1"
fi
if [ -e "${SDL2_PREFIX}/lib/libSDL2.dll.a" ]; then
SDL2_LIBS="-L${SDL2_PREFIX}/lib -lSDL2.dll"
fi
;;
esac
bb_save_IFS=$IFS
IFS=" "
SDL2_LIBS_FIXED=""
for sdl2_lib in $SDL2_LIBS; do
case "${sdl2_lib}" in
-Wl*)
;;
-pthread)
SDL2_LIBS_FIXED="$SDL2_LIBS_FIXED -lpthread"
;;
*)
SDL2_LIBS_FIXED="$SDL2_LIBS_FIXED ${sdl2_lib}"
;;
esac
done
IFS=$bb_save_IFS
SDL2_LIBS="${SDL2_LIBS_FIXED}"
else
$ECHO_N 'checking whether SDL2 works (with X11 libs)...'
$ECHO_N '# checking whether SDL2 works (with X11 libs)...' >>config.log
SDL2_LIBS="${SDL2_LIBS} -L/usr/X11R6/lib -lX11 -lXext -lXrandr -lXrender"
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_SDL_FRAMEWORK
# include
# ifdef main
# undef main
# endif
#else
# include
#endif
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SDL2' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL2_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL2_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL2_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL2_LIBS} 1>/dev/null 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_SDL2=yes
bb_o=$bb_incdir/have_sdl2.h
echo '#ifndef HAVE_SDL2' >$bb_o
echo "#define HAVE_SDL2 \"$HAVE_SDL2\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SDL2=no
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SDL2}" = "no" ]; then
SDL2_CFLAGS=""
SDL2_LIBS=""
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
fi
else
HAVE_SDL2="no"
SDL2_CFLAGS=""
SDL2_LIBS=""
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
if [ "${HAVE_SDL2}" = "yes" ]; then
SDL2_PC="sdl2"
fi
# END sdl2
if [ "${HAVE_SDL2}" != 'yes' ]
then
if [ "${with_sdl2}" = 'yes' ]
then
echo "*"
echo "* --with-sdl2 was requested, but SDL 2.0 "
echo "* library was not found."
echo "*"
exit 1
fi
HAVE_SDL2="no"
SDL2_CFLAGS=""
SDL2_LIBS=""
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
else
HAVE_SDL2="no"
SDL2_CFLAGS=""
SDL2_LIBS=""
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
fi
if [ "${HAVE_SDL2}" != "yes" -a "${with_sdl}" != 'no' ]
then
$ECHO_N 'checking for SDL 1.2...'
$ECHO_N '# checking for SDL 1.2...' >>config.log
# BEGIN sdl(1.2.0 ${prefix_sdl})
if [ "${prefix_sdl}" != "" ]; then
SDL_PREFIX=
MK_EXEC_FOUND=No
if [ "${prefix_sdl}" != "" ]; then
if [ -x "${prefix_sdl}/bin/sdl-config" -a ! -d "${prefix_sdl}/bin/sdl-config" ]; then
SDL_PREFIX=`${prefix_sdl}/bin/sdl-config --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl}/bin/sdl-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_PREFIX=`${path}/sdl-config --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config"
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_PREFIX=`${path}/sdl-config.exe --prefix`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL_VERSION=
MK_EXEC_FOUND=No
if [ "${prefix_sdl}" != "" ]; then
if [ -x "${prefix_sdl}/bin/sdl-config" -a ! -d "${prefix_sdl}/bin/sdl-config" ]; then
SDL_VERSION=`${prefix_sdl}/bin/sdl-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl}/bin/sdl-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config"
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_VERSION=`${path}/sdl-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL_CFLAGS=
MK_EXEC_FOUND=No
if [ "${prefix_sdl}" != "" ]; then
if [ -x "${prefix_sdl}/bin/sdl-config" -a ! -d "${prefix_sdl}/bin/sdl-config" ]; then
SDL_CFLAGS=`${prefix_sdl}/bin/sdl-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl}/bin/sdl-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config"
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_CFLAGS=`${path}/sdl-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
SDL_LIBS=
MK_EXEC_FOUND=No
if [ "${prefix_sdl}" != "" ]; then
if [ -x "${prefix_sdl}/bin/sdl-config" -a ! -d "${prefix_sdl}/bin/sdl-config" ]; then
SDL_LIBS=`${prefix_sdl}/bin/sdl-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_sdl}/bin/sdl-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config"
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_LIBS=`${path}/sdl-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/sdl-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
else
case "${host}" in
*-*-darwin*)
MK_EXEC_FOUND=No
SDL_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_VERSION=`${path}/sdl-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
if [ "${SDL_VERSION}" != "" ]; then
MK_EXEC_FOUND=No
SDL_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_PREFIX=`${path}/sdl-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_PREFIX=`${path}/sdl-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_CFLAGS=`${path}/sdl-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_LIBS=`${path}/sdl-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
else
$ECHO_N 'framework...'
$ECHO_N '# framework...' >>config.log
SDL_VERSION="1.2.15"
SDL_CFLAGS="-D_USE_SDL_FRAMEWORK"
SDL_LIBS="-framework SDL"
fi
;;
*-*-freebsd*)
MK_EXEC_FOUND=No
SDL_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl11-config" -a ! -d "${path}/sdl11-config" ]; then
SDL_VERSION=`${path}/sdl11-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl11-config.exe" ]; then
SDL_VERSION=`${path}/sdl11-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
if [ "${SDL_VERSION}" != "" ]; then
MK_EXEC_FOUND=No
SDL_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl11-config" -a ! -d "${path}/sdl11-config" ]; then
SDL_PREFIX=`${path}/sdl11-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl11-config.exe" ]; then
SDL_PREFIX=`${path}/sdl11-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl11-config" -a ! -d "${path}/sdl11-config" ]; then
SDL_CFLAGS=`${path}/sdl11-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl11-config.exe" ]; then
SDL_CFLAGS=`${path}/sdl11-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl11-config" -a ! -d "${path}/sdl11-config" ]; then
SDL_LIBS=`${path}/sdl11-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl11-config.exe" ]; then
SDL_LIBS=`${path}/sdl11-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
else
MK_EXEC_FOUND=No
SDL_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_PREFIX=`${path}/sdl-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_PREFIX=`${path}/sdl-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_VERSION=`${path}/sdl-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_CFLAGS=`${path}/sdl-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_LIBS=`${path}/sdl-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
fi
;;
*)
MK_EXEC_FOUND=No
SDL_PREFIX=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_PREFIX=`${path}/sdl-config --prefix`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_PREFIX=`${path}/sdl-config.exe --prefix`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_VERSION=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_VERSION=`${path}/sdl-config --version`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_VERSION=`${path}/sdl-config.exe --version`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_CFLAGS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_CFLAGS=`${path}/sdl-config --cflags`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_CFLAGS=`${path}/sdl-config.exe --cflags`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
MK_EXEC_FOUND=No
SDL_LIBS=
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/sdl-config" -a ! -d "${path}/sdl-config" ]; then
SDL_LIBS=`${path}/sdl-config --libs`
MK_EXEC_FOUND=Yes
break
elif [ -e "${path}/sdl-config.exe" ]; then
SDL_LIBS=`${path}/sdl-config.exe --libs`
MK_EXEC_FOUND=Yes
break
fi
done
IFS=$bb_save_IFS
;;
esac
fi
if [ "${SDL_VERSION}" != "" ]; then
if [ "${prefix_sdl}" != "" ]; then
echo "yes ($SDL_VERSION in ${prefix_sdl})"
echo "# yes ($SDL_VERSION in ${prefix_sdl})" >>config.log
else
echo "yes ($SDL_VERSION)"
echo "# yes ($SDL_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$SDL_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$SDL_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$SDL_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 2 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 2 ]; 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.2.0 (found $SDL_VERSION)"
echo "# * Minimum required version is 1.2.0 (found $SDL_VERSION)" >>config.log
echo '*'
echo '# *' >>config.log
fi
else
if [ "${prefix_sdl}" != "" ]; then
echo "no (not in ${prefix_sdl})"
echo "# no (not in ${prefix_sdl})" >>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 SDL works...'
$ECHO_N '# checking whether SDL works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_SDL_FRAMEWORK
# include
# ifdef main
# undef main
# endif
#else
# include
#endif
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SDL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL_LIBS} 1>/dev/null 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_SDL=yes
bb_o=$bb_incdir/have_sdl.h
echo '#ifndef HAVE_SDL' >$bb_o
echo "#define HAVE_SDL \"$HAVE_SDL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SDL=no
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SDL}" = "yes" ]; then
case "${host}" in
*-*-cygwin* | *-*-mingw32*)
if [ -e "${SDL_PREFIX}/include/SDL" ]; then
SDL_CFLAGS="-I${SDL_PREFIX}/include/SDL -D_GNU_SOURCE=1"
fi
if [ -e "${SDL_PREFIX}/lib/libSDL.dll.a" ]; then
SDL_LIBS="-L${SDL_PREFIX}/lib -lSDL.dll"
fi
;;
esac
bb_save_IFS=$IFS
IFS=" "
SDL_LIBS_FIXED=""
for sdl_lib in $SDL_LIBS; do
case "${sdl_lib}" in
-Wl*)
;;
-pthread)
SDL_LIBS_FIXED="$SDL_LIBS_FIXED -lpthread"
;;
*)
SDL_LIBS_FIXED="$SDL_LIBS_FIXED ${sdl_lib}"
;;
esac
done
IFS=$bb_save_IFS
SDL_LIBS="${SDL_LIBS_FIXED}"
else
$ECHO_N 'checking whether SDL works (with X11 libs)...'
$ECHO_N '# checking whether SDL works (with X11 libs)...' >>config.log
SDL_LIBS="${SDL_LIBS} -L/usr/X11R6/lib -lX11 -lXext -lXrandr -lXrender"
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#ifdef _USE_SDL_FRAMEWORK
# include
# ifdef main
# undef main
# endif
#else
# include
#endif
int main(int argc, char *argv[]) {
SDL_Surface *su;
if (SDL_Init(SDL_INIT_TIMER|SDL_INIT_NOPARACHUTE) != 0) {
return (1);
}
su = SDL_CreateRGBSurface(0, 16, 16, 32, 0, 0, 0, 0);
SDL_FreeSurface(su);
SDL_Quit();
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SDL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${SDL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${SDL_LIBS} 1>/dev/null 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_SDL=yes
bb_o=$bb_incdir/have_sdl.h
echo '#ifndef HAVE_SDL' >$bb_o
echo "#define HAVE_SDL \"$HAVE_SDL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SDL=no
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SDL}" = "no" ]; then
SDL_CFLAGS=""
SDL_LIBS=""
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
fi
else
HAVE_SDL="no"
SDL_CFLAGS=""
SDL_LIBS=""
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
if [ "${HAVE_SDL}" = "yes" ]; then
SDL_PC="sdl"
fi
# END sdl
if [ "${HAVE_SDL}" != 'yes' ]
then
if [ "${with_sdl}" = 'yes' ]
then
echo "*"
echo "* --with-sdl was requested, but SDL 1.2 "
echo "* library was not found."
echo "*"
exit 1
fi
HAVE_SDL="no"
SDL_CFLAGS=""
SDL_LIBS=""
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
else
HAVE_SDL="no"
SDL_CFLAGS=""
SDL_LIBS=""
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
fi
if [ "${with_gl}" != 'no' ]
then
$ECHO_N 'checking for OpenGL...'
$ECHO_N '# checking for OpenGL...' >>config.log
# BEGIN opengl(0 ${prefix_gl})
GL_CFLAGS=""
GL_LIBS=""
GL_FOUND=""
if [ "${prefix_gl}" != "" ]; then
if [ -e "${prefix_gl}/include" ]; then
GL_CFLAGS="-I${prefix_gl}/include"
GL_LIBS="${GL_LIBS} -L${prefix_gl}/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
echo >>config.log
echo '# C: HAVE_LIBOPENGL32' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c -lopengl32 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c -lopengl32 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_LIBOPENGL32=no
echo '#undef HAVE_LIBOPENGL32' >$bb_incdir/have_libopengl32.h
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
echo >>config.log
echo '# C: HAVE_OPENGL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_OPENGL=no
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_OPENGL}" = "no" ]; then
$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
echo >>config.log
echo '# C: HAVE_OPENGL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 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
else
echo 'no'
echo '# no' >>config.log
HAVE_OPENGL=no
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_OPENGL}" = "no" ]; then
HAVE_GLEXT="no"
OPENGL_CFLAGS=""
OPENGL_LIBS=""
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
fi
fi
$ECHO_N 'checking whether OpenGL has glext...'
$ECHO_N '# checking whether OpenGL has glext...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#define GL_GLEXT_PROTOTYPES
#ifdef _USE_OPENGL_FRAMEWORK
# include
# include
#else
# include
# include
#endif
static void
DebugMessageCallback(GLenum source, GLenum type, GLuint id, GLenum severity,
GLsizei length, const GLchar *message, const void *userParam)
{ }
int main(int argc, char *argv[]) {
glEnable(GL_DEBUG_OUTPUT);
glDebugMessageCallback(DebugMessageCallback, 0);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GLEXT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} 1>/dev/null 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_GLEXT=yes
bb_o=$bb_incdir/have_glext.h
echo '#ifndef HAVE_GLEXT' >$bb_o
echo "#define HAVE_GLEXT \"$HAVE_GLEXT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GLEXT=no
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
echo 'no'
echo '# no' >>config.log
HAVE_OPENGL="no"
HAVE_GLEXT="no"
OPENGL_CFLAGS=""
OPENGL_LIBS=""
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
fi
if [ "${HAVE_OPENGL}" = "yes" ]; then
OPENGL_PC="gl"
fi
# END opengl
if [ "${HAVE_OPENGL}" = 'yes' ]
then
SDL_CFLAGS="$SDL_CFLAGS $OPENGL_CFLAGS"
else
if [ "${with_gl}" = 'yes' ]
then
echo "*"
echo "* --with-gl was requested, but no OpenGL"
echo "* library was found."
echo "*"
exit 1
fi
HAVE_OPENGL="no"
HAVE_GLEXT="no"
OPENGL_CFLAGS=""
OPENGL_LIBS=""
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
fi
else
HAVE_OPENGL="no"
HAVE_GLEXT="no"
OPENGL_CFLAGS=""
OPENGL_LIBS=""
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
fi
if [ "${with_x}" != 'no' ]
then
$ECHO_N 'checking for the X window system...'
$ECHO_N '# checking for the X window system...' >>config.log
# BEGIN x11(0 ${prefix_x})
if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix x11 2>/dev/null`" != '' ]; then
if [ "${prefix_x}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_x} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
X11_VERSION=`$PKGCONFIG x11 --modversion 2>/dev/null`
if [ "${prefix_x}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_x} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
X11_CFLAGS=`$PKGCONFIG x11 --cflags 2>/dev/null`
if [ "${prefix_x}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_x} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
X11_LIBS=`$PKGCONFIG x11 --libs 2>/dev/null`
else
X11_CFLAGS=""
X11_LIBS=""
if [ "${prefix_x}" != "" ]; then
if [ -e "${prefix_x}/include/X11" ]; then
X11_CFLAGS="-I${prefix_x}/include"
fi
if [ -e "${prefix_x}/lib" ]; then
X11_LIBS="-L${prefix_x}/lib -lX11"
fi
else
if [ "${with_x_libraries}" != "" ]; then
if [ -e "${with_x_includes}/X11" ]; then
X11_CFLAGS="-I${with_x_includes}/X11"
else
X11_CFLAGS="-I${with_x_includes}"
fi
X11_LIBS="-L${with_x_libraries} -lX11"
else
if [ -e "/usr/local/include/X11" ]; then
X11_CFLAGS="-I/usr/local/include"
break
fi
if [ -e "/usr/include/X11" ]; then
X11_CFLAGS="-I/usr/include"
break
fi
if [ -e "/usr/include/X11/X11" ]; then
X11_CFLAGS="-I/usr/include/X11"
break
fi
if [ -e "/usr/include/X11R7/X11" ]; then
X11_CFLAGS="-I/usr/include/X11R7"
break
fi
if [ -e "/usr/include/X11R6/X11" ]; then
X11_CFLAGS="-I/usr/include/X11R6"
break
fi
if [ -e "/usr/include/X11R5/X11" ]; then
X11_CFLAGS="-I/usr/include/X11R5"
break
fi
if [ -e "/usr/include/X11R4/X11" ]; then
X11_CFLAGS="-I/usr/include/X11R4"
break
fi
if [ -e "/usr/local/X11/include/X11" ]; then
X11_CFLAGS="-I/usr/local/X11/include"
break
fi
if [ -e "/usr/local/X11R7/include/X11" ]; then
X11_CFLAGS="-I/usr/local/X11R7/include"
break
fi
if [ -e "/usr/local/X11R6/include/X11" ]; then
X11_CFLAGS="-I/usr/local/X11R6/include"
break
fi
if [ -e "/usr/local/X11R5/include/X11" ]; then
X11_CFLAGS="-I/usr/local/X11R5/include"
break
fi
if [ -e "/usr/local/X11R4/include/X11" ]; then
X11_CFLAGS="-I/usr/local/X11R4/include"
break
fi
if [ -e "/usr/local/include/X11/X11" ]; then
X11_CFLAGS="-I/usr/local/include/X11"
break
fi
if [ -e "/usr/local/include/X11R7/X11" ]; then
X11_CFLAGS="-I/usr/local/include/X11R7"
break
fi
if [ -e "/usr/local/include/X11R6/X11" ]; then
X11_CFLAGS="-I/usr/local/include/X11R6"
break
fi
if [ -e "/usr/local/include/X11R5/X11" ]; then
X11_CFLAGS="-I/usr/local/include/X11R5"
break
fi
if [ -e "/usr/local/include/X11R4/X11" ]; then
X11_CFLAGS="-I/usr/local/include/X11R4"
break
fi
if [ -e "/usr/X11/include/X11" ]; then
X11_CFLAGS="-I/usr/X11/include"
break
fi
if [ -e "/usr/X11R7/include/X11" ]; then
X11_CFLAGS="-I/usr/X11R7/include"
break
fi
if [ -e "/usr/X11R6/include/X11" ]; then
X11_CFLAGS="-I/usr/X11R6/include"
break
fi
if [ -e "/usr/X11R5/include/X11" ]; then
X11_CFLAGS="-I/usr/X11R5/include"
break
fi
if [ -e "/usr/X11R4/include/X11" ]; then
X11_CFLAGS="-I/usr/X11R4/include"
break
fi
if [ -e "/opt/X11/include/X11" ]; then
X11_CFLAGS="-I/opt/X11/include"
break
fi
if [ -e "/usr/local/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/lib -lX11"
break
fi
if [ -e "/usr/local/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/lib -lX11"
break
fi
if [ -e "/usr/lib/libX11.so" ]; then
X11_LIBS="-L/usr/lib -lX11"
break
fi
if [ -e "/usr/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/lib -lX11"
break
fi
if [ -e "/usr/local/X11/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/X11/lib -lX11"
break
fi
if [ -e "/usr/local/X11/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/X11/lib -lX11"
break
fi
if [ -e "/usr/local/X11R7/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/X11R7/lib -lX11"
break
fi
if [ -e "/usr/local/X11R7/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/X11R7/lib -lX11"
break
fi
if [ -e "/usr/local/X11R6/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/X11R6/lib -lX11"
break
fi
if [ -e "/usr/local/X11R6/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/X11R6/lib -lX11"
break
fi
if [ -e "/usr/local/X11R5/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/X11R5/lib -lX11"
break
fi
if [ -e "/usr/local/X11R5/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/X11R5/lib -lX11"
break
fi
if [ -e "/usr/local/X11R4/lib/libX11.so" ]; then
X11_LIBS="-L/usr/local/X11R4/lib -lX11"
break
fi
if [ -e "/usr/local/X11R4/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/local/X11R4/lib -lX11"
break
fi
if [ -e "/usr/X11/lib/libX11.so" ]; then
X11_LIBS="-L/usr/X11/lib -lX11"
break
fi
if [ -e "/usr/X11/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/X11/lib -lX11"
break
fi
if [ -e "/usr/X11R7/lib/libX11.so" ]; then
X11_LIBS="-L/usr/X11R7/lib -lX11"
break
fi
if [ -e "/usr/X11R7/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/X11R7/lib -lX11"
break
fi
if [ -e "/usr/X11R6/lib/libX11.so" ]; then
X11_LIBS="-L/usr/X11R6/lib -lX11"
break
fi
if [ -e "/usr/X11R6/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/X11R6/lib -lX11"
break
fi
if [ -e "/usr/X11R5/lib/libX11.so" ]; then
X11_LIBS="-L/usr/X11R5/lib -lX11"
break
fi
if [ -e "/usr/X11R5/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/X11R5/lib -lX11"
break
fi
if [ -e "/usr/X11R4/lib/libX11.so" ]; then
X11_LIBS="-L/usr/X11R4/lib -lX11"
break
fi
if [ -e "/usr/X11R4/lib/libX11.so.*" ]; then
X11_LIBS="-L/usr/X11R4/lib -lX11"
break
fi
if [ -e "/opt/X11/lib/libX11.so" ]; then
X11_LIBS="-L/opt/X11/lib -lX11"
break
fi
if [ -e "/opt/X11/lib/libX11.so.*" ]; then
X11_LIBS="-L/opt/X11/lib -lX11"
break
fi
fi
fi
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[])
{
Display *disp = XOpenDisplay(NULL);
XCloseDisplay(disp);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_X11' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} 1>/dev/null 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_X11=yes
bb_o=$bb_incdir/have_x11.h
echo '#ifndef HAVE_X11' >$bb_o
echo "#define HAVE_X11 \"$HAVE_X11\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_X11=no
echo '#undef HAVE_X11' >$bb_incdir/have_x11.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_X11}" = "yes" ]; then
X11_PC="x11"
$ECHO_N 'checking for the XKB extension...'
$ECHO_N '# checking for the XKB extension...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[])
{
Display *disp = XOpenDisplay(NULL);
KeyCode kc = 0;
KeySym ks = XkbKeycodeToKeysym(disp, kc, 0, 0);
XCloseDisplay(disp);
return (ks != NoSymbol);
}
EOT
echo >>config.log
echo '# C: HAVE_XKB' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} -lX11 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} -lX11 1>/dev/null 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_XKB=yes
bb_o=$bb_incdir/have_xkb.h
echo '#ifndef HAVE_XKB' >$bb_o
echo "#define HAVE_XKB \"$HAVE_XKB\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_XKB=no
echo '#undef HAVE_XKB' >$bb_incdir/have_xkb.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_XKB}" = "yes" ]; then
HAVE_XF86MISC="no"
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
else
$ECHO_N 'checking for the XF86MISC extension...'
$ECHO_N '# checking for the XF86MISC extension...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[])
{
Display *disp = XOpenDisplay(NULL);
int dummy, rv;
rv = XF86MiscQueryExtension(disp, &dummy, &dummy);
XCloseDisplay(disp);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_XF86MISC' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} -lX11 -lXxf86misc 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} -lX11 -lXxf86misc 1>/dev/null 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_XF86MISC=yes
bb_o=$bb_incdir/have_xf86misc.h
echo '#ifndef HAVE_XF86MISC' >$bb_o
echo "#define HAVE_XF86MISC \"$HAVE_XF86MISC\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_XF86MISC=no
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_XF86MISC}" = "yes" ]; then
X11_LIBS="${X11_LIBS} -lXxf86misc"
bb_o=$bb_incdir/have_xf86misc.h
echo '#ifndef HAVE_XF86MISC' >$bb_o
echo "#define HAVE_XF86MISC \"$HAVE_XF86MISC\"" >>$bb_o
echo '#endif' >>$bb_o
bb_o=$bb_incdir/x11_libs.h
echo '#ifndef X11_LIBS' >$bb_o
echo "#define X11_LIBS \"$X11_LIBS\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
fi
fi
else
X11_CFLAGS=""
X11_LIBS=""
HAVE_XKB="no"
HAVE_XF86MISC="no"
echo '#undef HAVE_X11' >$bb_incdir/have_x11.h
echo '#undef HAVE_XKB' >$bb_incdir/have_xkb.h
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
fi
# END x11
if [ "${HAVE_X11}" != 'yes' ]
then
if [ "${with_x}" = 'yes' ]
then
echo "*"
echo "* --with-x was requested, but Xlib "
echo "* was not found."
echo "*"
exit 1
else
HAVE_X11="no"
X11_CFLAGS=""
X11_LIBS=""
HAVE_XKB="no"
HAVE_XF86MISC="no"
echo '#undef HAVE_X11' >$bb_incdir/have_x11.h
echo '#undef HAVE_XKB' >$bb_incdir/have_xkb.h
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
fi
fi
if [ "${with_xinerama}" != 'no' ]
then
$ECHO_N 'checking for the Xinerama extension...'
$ECHO_N '# checking for the Xinerama extension...' >>config.log
# BEGIN xinerama(0 ${prefix_xinerama})
if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix xinerama 2>/dev/null`" != '' ]; then
if [ "${prefix_xinerama}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
XINERAMA_VERSION=`$PKGCONFIG xinerama --modversion 2>/dev/null`
if [ "${prefix_xinerama}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
XINERAMA_CFLAGS=`$PKGCONFIG xinerama --cflags 2>/dev/null`
if [ "${prefix_xinerama}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
XINERAMA_LIBS=`$PKGCONFIG xinerama --libs 2>/dev/null`
else
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
if [ "${prefix_xinerama}" != "" ]; then
if [ -e "${prefix_xinerama}/include/X11" ]; then
XINERAMA_CFLAGS="-I${prefix_xinerama}/include"
fi
if [ -e "${prefix_xinerama}/lib" ]; then
XINERAMA_LIBS="-L${prefix_xinerama}/lib"
fi
else
if [ -e "/usr/include/X11/X11" ]; then
XINERAMA_CFLAGS="-I/usr/include/X11"
fi
if [ -e "/usr/include/X11R6/X11" ]; then
XINERAMA_CFLAGS="-I/usr/include/X11R6"
fi
if [ -e "/usr/local/X11/include/X11" ]; then
XINERAMA_CFLAGS="-I/usr/local/X11/include"
fi
if [ -e "/usr/local/X11R6/include/X11" ]; then
XINERAMA_CFLAGS="-I/usr/local/X11R6/include"
fi
if [ -e "/usr/local/include/X11/X11" ]; then
XINERAMA_CFLAGS="-I/usr/local/include/X11"
fi
if [ -e "/usr/local/include/X11R6/X11" ]; then
XINERAMA_CFLAGS="-I/usr/local/include/X11R6"
fi
if [ -e "/usr/X11/include/X11" ]; then
XINERAMA_CFLAGS="-I/usr/X11/include"
fi
if [ -e "/usr/X11R6/include/X11" ]; then
XINERAMA_CFLAGS="-I/usr/X11R6/include"
fi
if [ -e "/usr/local/X11/lib" ]; then
XINERAMA_LIBS="${XINERAMA_LIBS} -L/usr/local/X11/lib"
fi
if [ -e "/usr/local/X11R6/lib" ]; then
XINERAMA_LIBS="${XINERAMA_LIBS} -L/usr/local/X11R6/lib"
fi
if [ -e "/usr/X11/lib" ]; then
XINERAMA_LIBS="${XINERAMA_LIBS} -L/usr/X11/lib"
fi
if [ -e "/usr/X11R6/lib" ]; then
XINERAMA_LIBS="${XINERAMA_LIBS} -L/usr/X11R6/lib"
fi
fi
XINERAMA_LIBS="${XINERAMA_LIBS} -lXinerama"
fi
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[])
{
Display *disp;
int event_base = 0, error_base = 0;
int rv = 1;
disp = XOpenDisplay(NULL);
if (XineramaQueryExtension(disp, &event_base, &error_base)) {
rv = 0;
}
XCloseDisplay(disp);
return (rv);
}
EOT
echo >>config.log
echo '# C: HAVE_XINERAMA' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} ${XINERAMA_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} ${XINERAMA_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${X11_CFLAGS} ${XINERAMA_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${X11_LIBS} ${XINERAMA_LIBS} 1>/dev/null 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_XINERAMA=yes
bb_o=$bb_incdir/have_xinerama.h
echo '#ifndef HAVE_XINERAMA' >$bb_o
echo "#define HAVE_XINERAMA \"$HAVE_XINERAMA\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_XINERAMA=no
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_XINERAMA}" = "yes" ]; then
XINERAMA_PC="xinerama"
else
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
fi
# END xinerama
if [ "${HAVE_XINERAMA}" != 'yes' ]
then
if [ "${with_xinerama}" = 'yes' ]
then
echo "*"
echo "* --with-xinerama was requested, but the "
echo "* Xinerama extension was not found."
echo "*"
exit 1
fi
HAVE_XINERAMA="no"
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
fi
else
HAVE_XINERAMA="no"
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
fi
else
HAVE_X11="no"
X11_CFLAGS=""
X11_LIBS=""
HAVE_XKB="no"
HAVE_XF86MISC="no"
echo '#undef HAVE_X11' >$bb_incdir/have_x11.h
echo '#undef HAVE_XKB' >$bb_incdir/have_xkb.h
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
HAVE_XINERAMA="no"
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
fi
if [ "${with_cocoa}" != 'no' ]
then
$ECHO_N 'checking for the Cocoa framework...'
$ECHO_N '# checking for the Cocoa framework...' >>config.log
# BEGIN cocoa(0)
COCOA_CFLAGS="-DTARGET_API_MAC_CARBON -DTARGET_API_MAC_OSX -force_cpusubtype_ALL -fpascal-strings"
COCOA_LIBS="-lobjc -Wl,-framework,Cocoa -Wl,-framework,OpenGL -Wl,-framework,IOKit"
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.m
#import
int main(int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# ObjC: HAVE_COCOA' >>config.log
echo "cat << EOT >conftest$$.m" >>config.log
cat conftest$$.m>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${COCOA_CFLAGS} -x objective-c -o $testdir/conftest$$ conftest$$.m ${COCOA_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${COCOA_CFLAGS} -x objective-c -o $testdir/conftest$$ conftest$$.m ${COCOA_LIBS} 1>/dev/null 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_COCOA=yes
bb_o=$bb_incdir/have_cocoa.h
echo '#ifndef HAVE_COCOA' >$bb_o
echo "#define HAVE_COCOA \"$HAVE_COCOA\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_COCOA=no
echo '#undef HAVE_COCOA' >$bb_incdir/have_cocoa.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.m $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_COCOA}" = "no" ]; then
COCOA_CFLAGS=""
COCOA_LIBS=""
echo '#undef HAVE_COCOA' >$bb_incdir/have_cocoa.h
fi
# END cocoa
if [ "${HAVE_COCOA}" != 'yes' ]
then
if [ "${with_cocoa}" = 'yes' ]
then
echo "*"
echo "* --with-cocoa was requested, but the "
echo "* Cocoa framework was not found."
echo "*"
exit 1
fi
HAVE_COCOA="no"
COCOA_CFLAGS=""
COCOA_LIBS=""
echo '#undef HAVE_COCOA' >$bb_incdir/have_cocoa.h
fi
else
HAVE_COCOA="no"
COCOA_CFLAGS=""
COCOA_LIBS=""
echo '#undef HAVE_COCOA' >$bb_incdir/have_cocoa.h
fi
if [ "${HAVE_OPENGL}" = 'yes' ]
then
if [ "${with_glx}" != 'no' ]
then
$ECHO_N 'checking for the GLX interface...'
$ECHO_N '# checking for the GLX interface...' >>config.log
# BEGIN glx(1.4 ${prefix_glx})
GLX_CFLAGS="${OPENGL_CFLAGS} ${X11_CFLAGS}"
GLX_LIBS="${OPENGL_LIBS} ${X11_LIBS}"
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#ifdef __APPLE__
# include
# include
#else
# include
# include
#endif
int main(int argc, char *argv[]) {
Display *d;
XVisualInfo *xvi;
int glxAttrs[] = { GLX_RGBA, GLX_RED_SIZE,1, GLX_DEPTH_SIZE,1, None };
GLXContext glxCtx;
int err, ev, s;
d = XOpenDisplay(NULL);
(void)glXQueryExtension(d, &err, &ev);
s = DefaultScreen(d);
if ((xvi = glXChooseVisual(d, s, glxAttrs)) == NULL) { return (1); }
if ((glxCtx = glXCreateContext(d, xvi, 0, GL_FALSE)) == NULL) { return (1); }
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_GLX' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${GLX_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${GLX_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${GLX_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${GLX_LIBS} 1>/dev/null 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_GLX=yes
bb_o=$bb_incdir/have_glx.h
echo '#ifndef HAVE_GLX' >$bb_o
echo "#define HAVE_GLX \"$HAVE_GLX\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GLX=no
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_GLX}" = "no" ]; then
GLX_CFLAGS=""
GLX_LIBS=""
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
fi
# END glx
if [ "${HAVE_GLX}" != 'yes' ]
then
if [ "${with_glx}" = 'yes' ]
then
echo "*"
echo "* --with-glx was requested, but no"
echo "* compatible GLX library was found."
echo "*"
exit 1
fi
HAVE_GLX="no"
GLX_CFLAGS=""
GLX_LIBS=""
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
fi
else
HAVE_GLX="no"
GLX_CFLAGS=""
GLX_LIBS=""
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
fi
if [ "${with_wgl}" != 'no' ]
then
$ECHO_N 'checking for the WGL interface...'
$ECHO_N '# checking for the WGL interface...' >>config.log
# BEGIN wgl(0)
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main(int argc, char *argv[]) {
HWND hwnd;
HDC hdc;
HGLRC hglrc;
hwnd = CreateWindowEx(0, "a", "a", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
CW_USEDEFAULT, 0,0, NULL, NULL, GetModuleHandle(NULL), NULL);
hdc = GetDC(hwnd);
hglrc = wglCreateContext(hdc);
SwapBuffers(hdc);
wglDeleteContext(hglrc);
ReleaseDC(hwnd, hdc);
DestroyWindow(hwnd);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_WGL' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} -lgdi32 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${OPENGL_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${OPENGL_LIBS} -lgdi32 1>/dev/null 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_WGL=yes
bb_o=$bb_incdir/have_wgl.h
echo '#ifndef HAVE_WGL' >$bb_o
echo "#define HAVE_WGL \"$HAVE_WGL\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_WGL=no
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_WGL}" = "yes" ]; then
OPENGL_LIBS="${OPENGL_LIBS} -lgdi32"
else
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
fi
# END wgl
if [ "${HAVE_WGL}" != 'yes' ]
then
if [ "${with_wgl}" = 'yes' ]
then
echo "*"
echo "* --with-wgl was requested, but the"
echo "* WGL test has failed."
echo "*"
exit 1
fi
HAVE_WGL="no"
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
fi
else
HAVE_WGL="no"
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
fi
else
HAVE_GLX="no"
GLX_CFLAGS=""
GLX_LIBS=""
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
HAVE_WGL="no"
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
fi
if [ "${with_freetype}" != 'no' ]
then
$ECHO_N 'checking for FreeType...'
$ECHO_N '# checking for FreeType...' >>config.log
# BEGIN freetype(7.0.1 ${prefix_freetype})
if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix freetype2 2>/dev/null`" != '' ]; then
if [ "${prefix_freetype}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FREETYPE_VERSION=`$PKGCONFIG freetype2 --modversion 2>/dev/null`
if [ "${prefix_freetype}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FREETYPE_CFLAGS=`$PKGCONFIG freetype2 --cflags 2>/dev/null`
if [ "${prefix_freetype}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FREETYPE_LIBS=`$PKGCONFIG freetype2 --libs 2>/dev/null`
else
FREETYPE_VERSION=
MK_EXEC_FOUND=No
if [ "${prefix_freetype}" != "" ]; then
if [ -x "${prefix_freetype}/bin/freetype-config" -a ! -d "${prefix_freetype}/bin/freetype-config" ]; then
FREETYPE_VERSION=`${prefix_freetype}/bin/freetype-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_freetype}/bin/freetype-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/freetype-config" -a ! -d "${path}/freetype-config" ]; then
FREETYPE_VERSION=`${path}/freetype-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config"
break
elif [ -e "${path}/freetype-config.exe" ]; then
FREETYPE_VERSION=`${path}/freetype-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
FREETYPE_CFLAGS=
MK_EXEC_FOUND=No
if [ "${prefix_freetype}" != "" ]; then
if [ -x "${prefix_freetype}/bin/freetype-config" -a ! -d "${prefix_freetype}/bin/freetype-config" ]; then
FREETYPE_CFLAGS=`${prefix_freetype}/bin/freetype-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_freetype}/bin/freetype-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/freetype-config" -a ! -d "${path}/freetype-config" ]; then
FREETYPE_CFLAGS=`${path}/freetype-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config"
break
elif [ -e "${path}/freetype-config.exe" ]; then
FREETYPE_CFLAGS=`${path}/freetype-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
FREETYPE_LIBS=
MK_EXEC_FOUND=No
if [ "${prefix_freetype}" != "" ]; then
if [ -x "${prefix_freetype}/bin/freetype-config" -a ! -d "${prefix_freetype}/bin/freetype-config" ]; then
FREETYPE_LIBS=`${prefix_freetype}/bin/freetype-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_freetype}/bin/freetype-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/freetype-config" -a ! -d "${path}/freetype-config" ]; then
FREETYPE_LIBS=`${path}/freetype-config --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config"
break
elif [ -e "${path}/freetype-config.exe" ]; then
FREETYPE_LIBS=`${path}/freetype-config.exe --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/freetype-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
fi
case "${host}" in
*-*-irix*)
if [ -e "/usr/freeware/include" ]; then
FREETYPE_CFLAGS="${FREETYPE_CFLAGS} -I/usr/freeware/include"
fi
;;
esac
if [ "${FREETYPE_VERSION}" != "" ]; then
if [ "${prefix_freetype}" != "" ]; then
echo "yes ($FREETYPE_VERSION in ${prefix_freetype})"
echo "# yes ($FREETYPE_VERSION in ${prefix_freetype})" >>config.log
else
echo "yes ($FREETYPE_VERSION)"
echo "# yes ($FREETYPE_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$FREETYPE_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$FREETYPE_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$FREETYPE_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 7 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 7 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 0 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 0 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 1 ]; 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 7.0.1 (found $FREETYPE_VERSION)"
echo "# * Minimum required version is 7.0.1 (found $FREETYPE_VERSION)" >>config.log
echo '*'
echo '# *' >>config.log
fi
else
if [ "${prefix_freetype}" != "" ]; then
echo "no (not in ${prefix_freetype})"
echo "# no (not in ${prefix_freetype})" >>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 FreeType works...'
$ECHO_N '# checking whether FreeType works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include FT_FREETYPE_H
#include FT_OUTLINE_H
int
main(int argc, char *argv[])
{
FT_Library library;
FT_Face face;
FT_Init_FreeType(&library);
FT_New_Face(library, "foo", 0, &face);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_FREETYPE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${FREETYPE_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${FREETYPE_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${FREETYPE_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${FREETYPE_LIBS} 1>/dev/null 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_FREETYPE=yes
bb_o=$bb_incdir/have_freetype.h
echo '#ifndef HAVE_FREETYPE' >$bb_o
echo "#define HAVE_FREETYPE \"$HAVE_FREETYPE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_FREETYPE=no
echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_FREETYPE}" = "no" ]; then
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h
fi
else
HAVE_FREETYPE="no"
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h
fi
if [ "${HAVE_FREETYPE}" = "yes" ]; then
FREETYPE_PC="freetype2"
fi
# END freetype
if [ "${HAVE_FREETYPE}" != 'yes' ]
then
echo "*"
echo "* The FreeType library was not found, aborting!"
echo "*"
echo "* Agar needs FreeType to display vector fonts"
echo "* (http://www.freetype.org/)."
echo "*"
echo "* If you really want to use Agar's built-in"
echo "* monospace bitmap font engine (not recommended),"
echo "* please use: ./configure --without-freetype"
echo "*"
exit 1
fi
else
HAVE_FREETYPE="no"
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h
fi
if [ "${with_fontconfig}" != 'no' ]
then
$ECHO_N 'checking for fontconfig...'
$ECHO_N '# checking for fontconfig...' >>config.log
# BEGIN fontconfig(2.6.0 ${prefix_fontconfig})
if [ "${prefix_fontconfig}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FONTCONFIG_VERSION=`$PKGCONFIG fontconfig --modversion 2>/dev/null`
if [ "${prefix_fontconfig}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FONTCONFIG_CFLAGS=`$PKGCONFIG fontconfig --cflags 2>/dev/null`
if [ "${prefix_fontconfig}" != "" ]; then
MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null`
if [ "$MK_EXEC_PKGPREFIX" != "" ]; then
if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then
echo ""
echo "# " >>config.log
echo "* "
echo "# * " >>config.log
echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX,"
echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log
echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead."
echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log
echo "* "
echo "# * " >>config.log
echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)."
echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log
echo "* "
echo "# * " >>config.log
echo "***"
echo "*** ERROR: Package prefix mismatch"
echo "*** Failed! See ./config.log for more details."
echo "***"
exit 1
fi
fi
fi
FONTCONFIG_LIBS=`$PKGCONFIG fontconfig --libs 2>/dev/null`
if [ "${FONTCONFIG_VERSION}" != "" ]; then
if [ "${prefix_fontconfig}" != "" ]; then
echo "yes ($FONTCONFIG_VERSION in ${prefix_fontconfig})"
echo "# yes ($FONTCONFIG_VERSION in ${prefix_fontconfig})" >>config.log
else
echo "yes ($FONTCONFIG_VERSION)"
echo "# yes ($FONTCONFIG_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$FONTCONFIG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$FONTCONFIG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$FONTCONFIG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\3/'`;
MK_VERSION_OK=no
if [ $MK_VERSION_MAJOR -gt 2 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MAJOR -eq 2 ]; then
if [ "$MK_VERSION_MINOR" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MINOR -gt 6 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 6 ]; 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 2.6.0 (found $FONTCONFIG_VERSION)"
echo "# * Minimum required version is 2.6.0 (found $FONTCONFIG_VERSION)" >>config.log
echo '*'
echo '# *' >>config.log
fi
else
if [ "${prefix_fontconfig}" != "" ]; then
echo "no (not in ${prefix_fontconfig})"
echo "# no (not in ${prefix_fontconfig})" >>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 fontconfig works...'
$ECHO_N '# checking whether fontconfig works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
FcPattern *pattern, *fpat;
FcResult result = FcResultMatch;
const FcChar8 name[1] = { '\0' };
FcChar8 *file;
FcMatrix *mat = NULL;
double size;
int idx;
if (!FcInit()) { return (1); }
if ((pattern = FcNameParse(name)) == NULL) { return (1); }
if (!FcConfigSubstitute(NULL, pattern, FcMatchPattern)) { return (1); }
FcDefaultSubstitute(pattern);
if ((fpat = FcFontMatch(NULL, pattern, &result)) == NULL) { return (1); }
if (FcPatternGetString(fpat, FC_FILE, 0, &file) != FcResultMatch) { return (1); }
if (FcPatternGetInteger(fpat, FC_INDEX, 0, &idx) != FcResultMatch) { return (1); }
if (FcPatternGetDouble(fpat, FC_SIZE, 0, &size) != FcResultMatch) { return (1); }
if (FcPatternGetMatrix(fpat, FC_MATRIX, 0, &mat) != FcResultMatch) { return (1); }
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_FONTCONFIG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${FONTCONFIG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${FONTCONFIG_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${FONTCONFIG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${FONTCONFIG_LIBS} 1>/dev/null 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_FONTCONFIG=yes
bb_o=$bb_incdir/have_fontconfig.h
echo '#ifndef HAVE_FONTCONFIG' >$bb_o
echo "#define HAVE_FONTCONFIG \"$HAVE_FONTCONFIG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_FONTCONFIG=no
echo '#undef HAVE_FONTCONFIG' >$bb_incdir/have_fontconfig.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_FONTCONFIG}" = "no" ]; then
FONTCONFIG_CFLAGS=""
FONTCONFIG_LIBS=""
echo '#undef HAVE_FONTCONFIG' >$bb_incdir/have_fontconfig.h
fi
else
HAVE_FONTCONFIG="no"
FONTCONFIG_CFLAGS=""
FONTCONFIG_LIBS=""
echo '#undef HAVE_FONTCONFIG' >$bb_incdir/have_fontconfig.h
fi
# END fontconfig
else
HAVE_FONTCONFIG="no"
FONTCONFIG_CFLAGS=""
FONTCONFIG_LIBS=""
echo '#undef HAVE_FONTCONFIG' >$bb_incdir/have_fontconfig.h
fi
if [ "${with_jpeg}" != 'no' ]
then
$ECHO_N 'checking for libjpeg...'
$ECHO_N '# checking for libjpeg...' >>config.log
# BEGIN jpeg(0 ${prefix_jpeg})
JPEG_CFLAGS=""
if [ "${prefix_jpeg}" != "" ]; then
if [ -e "${prefix_jpeg}/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I${prefix_jpeg}/include"
JPEG_LIBS="-L${prefix_jpeg}/lib -ljpeg"
fi
else
if [ -e "/usr/local/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/local/include"
JPEG_LIBS="-L/usr/local/lib -ljpeg"
fi
if [ -e "/usr/X11R6/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/X11R6/include"
JPEG_LIBS="-L/usr/X11R6/lib -ljpeg"
fi
if [ -e "/usr/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/include"
JPEG_LIBS="-L/usr/lib -ljpeg"
fi
if [ -e "/usr/pkg/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/usr/pkg/include"
JPEG_LIBS="-L/usr/pkg/lib -ljpeg"
fi
if [ -e "/opt/local/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/opt/local/include"
JPEG_LIBS="-L/opt/local/lib -ljpeg"
fi
if [ -e "/opt/include/jpeglib.h" ]; then
JPEG_CFLAGS="-I/opt/include"
JPEG_LIBS="-L/opt/lib -ljpeg"
fi
fi
if [ "${JPEG_LIBS}" != "" ]; then
echo 'yes'
echo '# yes' >>config.log
$ECHO_N 'checking whether libjpeg works...'
$ECHO_N '# checking whether libjpeg works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
struct jpeg_error_mgr jerr;
struct jpeg_compress_struct jcomp;
int
main(int argc, char *argv[])
{
jcomp.err = jpeg_std_error(&jerr);
jpeg_create_compress(&jcomp);
jcomp.image_width = 32;
jcomp.image_height = 32;
jcomp.input_components = 3;
jcomp.in_color_space = JCS_RGB;
jpeg_set_defaults(&jcomp);
jpeg_set_quality(&jcomp, 75, TRUE);
jpeg_destroy_compress(&jcomp);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_JPEG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${JPEG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${JPEG_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${JPEG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${JPEG_LIBS} 1>/dev/null 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_JPEG=yes
bb_o=$bb_incdir/have_jpeg.h
echo '#ifndef HAVE_JPEG' >$bb_o
echo "#define HAVE_JPEG \"$HAVE_JPEG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_JPEG=no
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_JPEG}" = "no" ]; then
JPEG_CFLAGS=""
JPEG_LIBS=""
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
fi
else
echo 'no'
echo '# no' >>config.log
HAVE_JPEG="no"
JPEG_CFLAGS=""
JPEG_LIBS=""
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
fi
if [ "${HAVE_JPEG}" = "yes" ]; then
JPEG_PC="libjpeg"
fi
# END jpeg
if [ "${HAVE_JPEG}" != 'yes' ]
then
if [ "${with_jpeg}" = 'yes' ]
then
echo "*"
echo "* --with-jpeg was requested, but libjpeg"
echo "* was not found."
echo "*"
exit 1
fi
HAVE_JPEG="no"
JPEG_CFLAGS=""
JPEG_LIBS=""
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
fi
else
HAVE_JPEG="no"
JPEG_CFLAGS=""
JPEG_LIBS=""
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
fi
if [ "${with_png}" != 'no' ]
then
$ECHO_N 'checking for libpng...'
$ECHO_N '# checking for libpng...' >>config.log
# BEGIN png(1.2.49 ${prefix_png})
PNG_VERSION=
MK_EXEC_FOUND=No
if [ "${prefix_png}" != "" ]; then
if [ -x "${prefix_png}/bin/libpng-config" -a ! -d "${prefix_png}/bin/libpng-config" ]; then
PNG_VERSION=`${prefix_png}/bin/libpng-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_png}/bin/libpng-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/libpng-config" -a ! -d "${path}/libpng-config" ]; then
PNG_VERSION=`${path}/libpng-config --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config"
break
elif [ -e "${path}/libpng-config.exe" ]; then
PNG_VERSION=`${path}/libpng-config.exe --version`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
PNG_CFLAGS=
MK_EXEC_FOUND=No
if [ "${prefix_png}" != "" ]; then
if [ -x "${prefix_png}/bin/libpng-config" -a ! -d "${prefix_png}/bin/libpng-config" ]; then
PNG_CFLAGS=`${prefix_png}/bin/libpng-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_png}/bin/libpng-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/libpng-config" -a ! -d "${path}/libpng-config" ]; then
PNG_CFLAGS=`${path}/libpng-config --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config"
break
elif [ -e "${path}/libpng-config.exe" ]; then
PNG_CFLAGS=`${path}/libpng-config.exe --cflags`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
PNG_LOPTS=
MK_EXEC_FOUND=No
if [ "${prefix_png}" != "" ]; then
if [ -x "${prefix_png}/bin/libpng-config" -a ! -d "${prefix_png}/bin/libpng-config" ]; then
PNG_LOPTS=`${prefix_png}/bin/libpng-config --L_opts`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_png}/bin/libpng-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/libpng-config" -a ! -d "${path}/libpng-config" ]; then
PNG_LOPTS=`${path}/libpng-config --L_opts`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config"
break
elif [ -e "${path}/libpng-config.exe" ]; then
PNG_LOPTS=`${path}/libpng-config.exe --L_opts`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
PNG_LIBS=
MK_EXEC_FOUND=No
if [ "${prefix_png}" != "" ]; then
if [ -x "${prefix_png}/bin/libpng-config" -a ! -d "${prefix_png}/bin/libpng-config" ]; then
PNG_LIBS=`${prefix_png}/bin/libpng-config --static --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${prefix_png}/bin/libpng-config"
fi
else
bb_save_IFS=$IFS
IFS=$PATH_SEPARATOR
for path in $PATH; do
if [ -x "${path}/libpng-config" -a ! -d "${path}/libpng-config" ]; then
PNG_LIBS=`${path}/libpng-config --static --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config"
break
elif [ -e "${path}/libpng-config.exe" ]; then
PNG_LIBS=`${path}/libpng-config.exe --static --libs`
MK_EXEC_FOUND=Yes
MK_EXEC_PATH="${path}/libpng-config.exe"
break
fi
done
IFS=$bb_save_IFS
fi
PNG_LIBS="${PNG_LOPTS} ${PNG_LIBS}"
if [ "${PNG_VERSION}" != "" ]; then
if [ "${prefix_png}" != "" ]; then
echo "yes ($PNG_VERSION in ${prefix_png})"
echo "# yes ($PNG_VERSION in ${prefix_png})" >>config.log
else
echo "yes ($PNG_VERSION)"
echo "# yes ($PNG_VERSION)" >>config.log
fi
MK_VERSION_MAJOR=`echo "$PNG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$PNG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$PNG_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 2 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 2 ]; then
if [ "$MK_VERSION_MICRO" = '' ]; then
MK_VERSION_OK=yes
else
if [ $MK_VERSION_MICRO -ge 49 ]; 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.2.49 (found $PNG_VERSION)"
echo "# * Minimum required version is 1.2.49 (found $PNG_VERSION)" >>config.log
echo '*'
echo '# *' >>config.log
fi
else
if [ "${prefix_png}" != "" ]; then
echo "no (not in ${prefix_png})"
echo "# no (not in ${prefix_png})" >>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 libpng works...'
$ECHO_N '# checking whether libpng works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
int main(int argc, char *argv[])
{
char foo[4];
if (png_sig_cmp((png_bytep)foo, 0, 3)) {
return (1);
}
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_PNG' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${PNG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${PNG_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${PNG_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${PNG_LIBS} 1>/dev/null 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_PNG=yes
bb_o=$bb_incdir/have_png.h
echo '#ifndef HAVE_PNG' >$bb_o
echo "#define HAVE_PNG \"$HAVE_PNG\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_PNG=no
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_PNG}" = "no" ]; then
HAVE_LIBPNG14="no"
PNG_CFLAGS=""
PNG_LIBS=""
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
else
MK_VERSION_MAJOR=`echo "$PNG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\1/'`;
MK_VERSION_MINOR=`echo "$PNG_VERSION" |sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\).*/\2/'`;
MK_VERSION_MICRO=`echo "$PNG_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 4 ]; then
MK_VERSION_OK=yes
elif [ $MK_VERSION_MINOR -eq 4 ]; 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}" = "yes" ]; then
HAVE_LIBPNG14="yes"
bb_o=$bb_incdir/have_libpng14.h
echo '#ifndef HAVE_LIBPNG14' >$bb_o
echo "#define HAVE_LIBPNG14 \"$HAVE_LIBPNG14\"" >>$bb_o
echo '#endif' >>$bb_o
else
HAVE_LIBPNG14="no"
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
fi
fi
else
HAVE_PNG="no"
HAVE_LIBPNG14="no"
PNG_CFLAGS=""
PNG_LIBS=""
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
fi
if [ "${HAVE_PNG}" = "yes" ]; then
PNG_PC="libpng"
fi
# END png
if [ "${HAVE_PNG}" != 'yes' ]
then
if [ "${with_png}" = 'yes' ]
then
echo "*"
echo "* --with-png was requested, but libpng"
echo "* was not found."
echo "*"
exit 1
fi
HAVE_PNG="no"
HAVE_LIBPNG14="no"
PNG_CFLAGS=""
PNG_LIBS=""
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
fi
else
HAVE_PNG="no"
HAVE_LIBPNG14="no"
PNG_CFLAGS=""
PNG_LIBS=""
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
fi
else
echo '#undef ENABLE_GUI' >$bb_incdir/enable_gui.h
ENABLE_GUI_LIBS=""
SUBDIR_gui=""
HAVE_SDL="no"
SDL_CFLAGS=""
SDL_LIBS=""
echo '#undef HAVE_SDL' >$bb_incdir/have_sdl.h
HAVE_SDL2="no"
SDL2_CFLAGS=""
SDL2_LIBS=""
echo '#undef HAVE_SDL2' >$bb_incdir/have_sdl2.h
HAVE_X11="no"
X11_CFLAGS=""
X11_LIBS=""
HAVE_XKB="no"
HAVE_XF86MISC="no"
echo '#undef HAVE_X11' >$bb_incdir/have_x11.h
echo '#undef HAVE_XKB' >$bb_incdir/have_xkb.h
echo '#undef HAVE_XF86MISC' >$bb_incdir/have_xf86misc.h
HAVE_XINERAMA="no"
XINERAMA_CFLAGS=""
XINERAMA_LIBS=""
echo '#undef HAVE_XINERAMA' >$bb_incdir/have_xinerama.h
HAVE_COCOA="no"
COCOA_CFLAGS=""
COCOA_LIBS=""
echo '#undef HAVE_COCOA' >$bb_incdir/have_cocoa.h
HAVE_OPENGL="no"
HAVE_GLEXT="no"
OPENGL_CFLAGS=""
OPENGL_LIBS=""
echo '#undef HAVE_OPENGL' >$bb_incdir/have_opengl.h
echo '#undef HAVE_GLEXT' >$bb_incdir/have_glext.h
HAVE_GLX="no"
GLX_CFLAGS=""
GLX_LIBS=""
echo '#undef HAVE_GLX' >$bb_incdir/have_glx.h
HAVE_WGL="no"
echo '#undef HAVE_WGL' >$bb_incdir/have_wgl.h
HAVE_FREETYPE="no"
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h
HAVE_FONTCONFIG="no"
FONTCONFIG_CFLAGS=""
FONTCONFIG_LIBS=""
echo '#undef HAVE_FONTCONFIG' >$bb_incdir/have_fontconfig.h
HAVE_JPEG="no"
JPEG_CFLAGS=""
JPEG_LIBS=""
echo '#undef HAVE_JPEG' >$bb_incdir/have_jpeg.h
HAVE_PNG="no"
HAVE_LIBPNG14="no"
PNG_CFLAGS=""
PNG_LIBS=""
echo '#undef HAVE_PNG' >$bb_incdir/have_png.h
echo '#undef HAVE_LIBPNG14' >$bb_incdir/have_libpng14.h
fi
if [ "${enable_micro}" = 'yes' ]
then
ENABLE_MICRO="yes"
bb_o=$bb_incdir/enable_micro.h
echo '#ifndef ENABLE_MICRO' >$bb_o
echo "#define ENABLE_MICRO \"$ENABLE_MICRO\"" >>$bb_o
echo '#endif' >>$bb_o
ENABLE_MICRO_LIBS="-L../micro -lag_micro_gui"
SUBDIR_micro="micro"
else
echo '#undef ENABLE_MICRO' >$bb_incdir/enable_micro.h
ENABLE_MICRO_LIBS=""
SUBDIR_micro=""
fi
if [ "${enable_net}" != 'no' ]
then
SUBDIR_net="net"
$ECHO_N 'checking for getaddrinfo()...'
$ECHO_N '# checking for getaddrinfo()...' >>config.log
# BEGIN getaddrinfo
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
struct addrinfo hints, *res0;
const char *s;
int rv;
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
rv = getaddrinfo("hostname", "port", &hints, &res0);
s = gai_strerror(rv);
freeaddrinfo(res0);
return (s != NULL);
}
EOT
echo >>config.log
echo '# C: HAVE_GETADDRINFO' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_GETADDRINFO=yes
bb_o=$bb_incdir/have_getaddrinfo.h
echo '#ifndef HAVE_GETADDRINFO' >$bb_o
echo "#define HAVE_GETADDRINFO \"$HAVE_GETADDRINFO\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_GETADDRINFO=no
echo '#undef HAVE_GETADDRINFO' >$bb_incdir/have_getaddrinfo.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END getaddrinfo
$ECHO_N 'checking for the SIOCGIFCONF interface...'
$ECHO_N '# checking for the SIOCGIFCONF interface...' >>config.log
# BEGIN siocgifconf
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
#include
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
char buf[4096];
struct ifconf conf;
struct ifreq *ifr;
int sock;
if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
return (1);
}
conf.ifc_len = sizeof(buf);
conf.ifc_buf = (caddr_t)buf;
if (ioctl(sock, SIOCGIFCONF, &conf) < 0) {
return (1);
}
#if !defined(_SIZEOF_ADDR_IFREQ)
#define _SIZEOF_ADDR_IFREQ sizeof
#endif
for (ifr = (struct ifreq *)buf;
(char *)ifr < &buf[conf.ifc_len];
ifr = (struct ifreq *)((char *)ifr + _SIZEOF_ADDR_IFREQ(*ifr))) {
if (ifr->ifr_addr.sa_family == AF_INET)
return (1);
}
close(sock);
return (0);
}
EOT
echo >>config.log
echo '# C: HAVE_SIOCGIFCONF' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SIOCGIFCONF=yes
bb_o=$bb_incdir/have_siocgifconf.h
echo '#ifndef HAVE_SIOCGIFCONF' >$bb_o
echo "#define HAVE_SIOCGIFCONF \"$HAVE_SIOCGIFCONF\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SIOCGIFCONF=no
echo '#undef HAVE_SIOCGIFCONF' >$bb_incdir/have_siocgifconf.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
# END siocgifconf
$ECHO_N 'checking for setsockopt()...'
$ECHO_N '# checking for setsockopt()...' >>config.log
# BEGIN sockopts
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct timeval tv;
socklen_t tvLen = sizeof(tv);
tv.tv_sec = 1; tv.tv_usec = 0;
rv = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, tvLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SETSOCKOPT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SETSOCKOPT=yes
bb_o=$bb_incdir/have_setsockopt.h
echo '#ifndef HAVE_SETSOCKOPT' >$bb_o
echo "#define HAVE_SETSOCKOPT \"$HAVE_SETSOCKOPT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SETSOCKOPT=no
echo '#undef HAVE_SETSOCKOPT' >$bb_incdir/have_setsockopt.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_SETSOCKOPT}" = "yes" ]; then
$ECHO_N 'checking for SO_OOBINLINE...'
$ECHO_N '# checking for SO_OOBINLINE...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_OOBINLINE, &val, valLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_OOBINLINE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_OOBINLINE=yes
bb_o=$bb_incdir/have_so_oobinline.h
echo '#ifndef HAVE_SO_OOBINLINE' >$bb_o
echo "#define HAVE_SO_OOBINLINE \"$HAVE_SO_OOBINLINE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_OOBINLINE=no
echo '#undef HAVE_SO_OOBINLINE' >$bb_incdir/have_so_oobinline.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for SO_REUSEPORT...'
$ECHO_N '# checking for SO_REUSEPORT...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &val, valLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_REUSEPORT' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_REUSEPORT=yes
bb_o=$bb_incdir/have_so_reuseport.h
echo '#ifndef HAVE_SO_REUSEPORT' >$bb_o
echo "#define HAVE_SO_REUSEPORT \"$HAVE_SO_REUSEPORT\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_REUSEPORT=no
echo '#undef HAVE_SO_REUSEPORT' >$bb_incdir/have_so_reuseport.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for SO_TIMESTAMP...'
$ECHO_N '# checking for SO_TIMESTAMP...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, &val, valLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_TIMESTAMP' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_TIMESTAMP=yes
bb_o=$bb_incdir/have_so_timestamp.h
echo '#ifndef HAVE_SO_TIMESTAMP' >$bb_o
echo "#define HAVE_SO_TIMESTAMP \"$HAVE_SO_TIMESTAMP\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_TIMESTAMP=no
echo '#undef HAVE_SO_TIMESTAMP' >$bb_incdir/have_so_timestamp.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for SO_NOSIGPIPE...'
$ECHO_N '# checking for SO_NOSIGPIPE...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, val = 1, rv;
socklen_t valLen = sizeof(val);
rv = setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, &val, valLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_NOSIGPIPE' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_NOSIGPIPE=yes
bb_o=$bb_incdir/have_so_nosigpipe.h
echo '#ifndef HAVE_SO_NOSIGPIPE' >$bb_o
echo "#define HAVE_SO_NOSIGPIPE \"$HAVE_SO_NOSIGPIPE\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_NOSIGPIPE=no
echo '#undef HAVE_SO_NOSIGPIPE' >$bb_incdir/have_so_nosigpipe.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for SO_LINGER...'
$ECHO_N '# checking for SO_LINGER...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct linger ling;
socklen_t lingLen = sizeof(ling);
ling.l_onoff = 1; ling.l_linger = 1;
rv = setsockopt(fd, SOL_SOCKET, SO_LINGER, &ling, lingLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_LINGER' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_LINGER=yes
bb_o=$bb_incdir/have_so_linger.h
echo '#ifndef HAVE_SO_LINGER' >$bb_o
echo "#define HAVE_SO_LINGER \"$HAVE_SO_LINGER\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_LINGER=no
echo '#undef HAVE_SO_LINGER' >$bb_incdir/have_so_linger.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for SO_ACCEPTFILTER...'
$ECHO_N '# checking for SO_ACCEPTFILTER...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int
main(int argc, char *argv[])
{
int fd = 0, rv;
struct accept_filter_arg afa;
socklen_t afaLen = sizeof(afa);
afa.af_name[0] = 'A';
afa.af_arg[0] = 'A';
rv = setsockopt(fd, SOL_SOCKET, SO_ACCEPTFILTER, &afa, afaLen);
return (rv != 0);
}
EOT
echo >>config.log
echo '# C: HAVE_SO_ACCEPTFILTER' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SO_ACCEPTFILTER=yes
bb_o=$bb_incdir/have_so_acceptfilter.h
echo '#ifndef HAVE_SO_ACCEPTFILTER' >$bb_o
echo "#define HAVE_SO_ACCEPTFILTER \"$HAVE_SO_ACCEPTFILTER\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SO_ACCEPTFILTER=no
echo '#undef HAVE_SO_ACCEPTFILTER' >$bb_incdir/have_so_acceptfilter.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
else
HAVE_SETSOCKOPT="no"
HAVE_SO_OOBINLINE="no"
HAVE_SO_REUSEPORT="no"
HAVE_SO_TIMESTAMP="no"
HAVE_SO_NOSIGPIPE="no"
HAVE_SO_LINGER="no"
HAVE_SO_ACCEPTFILTER="no"
echo '#undef HAVE_SETSOCKOPT' >$bb_incdir/have_setsockopt.h
echo '#undef HAVE_SO_OOBINLINE' >$bb_incdir/have_so_oobinline.h
echo '#undef HAVE_SO_REUSEPORT' >$bb_incdir/have_so_reuseport.h
echo '#undef HAVE_SO_TIMESTAMP' >$bb_incdir/have_so_timestamp.h
echo '#undef HAVE_SO_NOSIGPIPE' >$bb_incdir/have_so_nosigpipe.h
echo '#undef HAVE_SO_LINGER' >$bb_incdir/have_so_linger.h
echo '#undef HAVE_SO_ACCEPTFILTER' >$bb_incdir/have_so_acceptfilter.h
fi
# END sockopts
$ECHO_N 'checking for WinSock...'
$ECHO_N '# checking for WinSock...' >>config.log
# BEGIN winsock
echo 'not checking'
echo '# not checking' >>config.log
HAVE_WINSOCK1="no"
HAVE_WINSOCK2="no"
echo '#undef HAVE_WINSOCK1' >$bb_incdir/have_winsock1.h
echo '#undef HAVE_WINSOCK2' >$bb_incdir/have_winsock2.h
# END winsock
HAVE_NETWORK="yes"
AG_NETWORK="yes"
bb_o=$bb_incdir/ag_network.h
echo '#ifndef AG_NETWORK' >$bb_o
echo "#define AG_NETWORK \"$AG_NETWORK\"" >>$bb_o
echo '#endif' >>$bb_o
else
SUBDIR_net=""
HAVE_GETADDRINFO="no"
echo '#undef HAVE_GETADDRINFO' >$bb_incdir/have_getaddrinfo.h
HAVE_SIOCGIFCONF="no"
echo '#undef HAVE_SIOCGIFCONF' >$bb_incdir/have_siocgifconf.h
HAVE_SETSOCKOPT="no"
HAVE_SO_OOBINLINE="no"
HAVE_SO_REUSEPORT="no"
HAVE_SO_TIMESTAMP="no"
HAVE_SO_NOSIGPIPE="no"
HAVE_SO_LINGER="no"
HAVE_SO_ACCEPTFILTER="no"
echo '#undef HAVE_SETSOCKOPT' >$bb_incdir/have_setsockopt.h
echo '#undef HAVE_SO_OOBINLINE' >$bb_incdir/have_so_oobinline.h
echo '#undef HAVE_SO_REUSEPORT' >$bb_incdir/have_so_reuseport.h
echo '#undef HAVE_SO_TIMESTAMP' >$bb_incdir/have_so_timestamp.h
echo '#undef HAVE_SO_NOSIGPIPE' >$bb_incdir/have_so_nosigpipe.h
echo '#undef HAVE_SO_LINGER' >$bb_incdir/have_so_linger.h
echo '#undef HAVE_SO_ACCEPTFILTER' >$bb_incdir/have_so_acceptfilter.h
HAVE_WINSOCK1="no"
HAVE_WINSOCK2="no"
echo '#undef HAVE_WINSOCK1' >$bb_incdir/have_winsock1.h
echo '#undef HAVE_WINSOCK2' >$bb_incdir/have_winsock2.h
HAVE_NETWORK="no"
echo '#undef AG_NETWORK' >$bb_incdir/ag_network.h
fi
if [ "${enable_web}" = 'yes' ]
then
$ECHO_N 'checking for zlib...'
$ECHO_N '# checking for zlib...' >>config.log
# BEGIN zlib(0 ${prefix_z})
ZLIB_CFLAGS=""
ZLIB_LIBS=""
if [ "${prefix_z}" != "" ]; then
ZLIB_CFLAGS="-I${prefix_z}/include"
ZLIB_LIBS="-L${prefix_z}/lib -lz"
else
if [ -f "/usr/local/include/zlib.h" ]; then
ZLIB_CFLAGS="-I/usr/local/include"
ZLIB_LIBS="-L/usr/local/lib -lz"
fi
if [ -f "/usr/include/zlib.h" ]; then
ZLIB_CFLAGS="-I/usr/include"
ZLIB_LIBS="-L/usr/lib -lz"
fi
fi
if [ "${ZLIB_LIBS}" != "" ]; then
echo 'ok'
echo '# ok' >>config.log
$ECHO_N 'checking whether zlib works...'
$ECHO_N '# checking whether zlib works...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
#include
#include
int main(int argc, char *argv[])
{
z_stream strm;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
return deflateInit(&strm, 0);
}
EOT
echo >>config.log
echo '# C: HAVE_ZLIB' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS ${ZLIB_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${ZLIB_LIBS} 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS ${ZLIB_CFLAGS} -o $testdir/conftest$$ conftest$$.c ${ZLIB_LIBS} 1>/dev/null 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_ZLIB=yes
bb_o=$bb_incdir/have_zlib.h
echo '#ifndef HAVE_ZLIB' >$bb_o
echo "#define HAVE_ZLIB \"$HAVE_ZLIB\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_ZLIB=no
echo '#undef HAVE_ZLIB' >$bb_incdir/have_zlib.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
if [ "${HAVE_ZLIB}" = "no" ]; then
ZLIB_CFLAGS=""
ZLIB_LIBS=""
echo '#undef HAVE_ZLIB' >$bb_incdir/have_zlib.h
fi
else
echo 'no'
echo '# no' >>config.log
HAVE_ZLIB="no"
ZLIB_CFLAGS=""
ZLIB_LIBS=""
echo '#undef HAVE_ZLIB' >$bb_incdir/have_zlib.h
fi
# END zlib
$ECHO_N 'checking for (HAVE_SYS_UIO_H)...'
$ECHO_N '# checking for (HAVE_SYS_UIO_H)...' >>config.log
MK_COMPILE_STATUS=OK
cat << EOT >conftest$$.c
#include
int main (int argc, char *argv[]) { return (0); }
EOT
echo >>config.log
echo '# C: HAVE_SYS_UIO_H' >>config.log
echo "cat << EOT >conftest$$.c" >>config.log
cat conftest$$.c>>config.log
echo EOT >>config.log
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 2>>config.log">>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest$$ conftest$$.c 1>/dev/null 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_SYS_UIO_H=yes
bb_o=$bb_incdir/have_sys_uio_h.h
echo '#ifndef HAVE_SYS_UIO_H' >$bb_o
echo "#define HAVE_SYS_UIO_H \"$HAVE_SYS_UIO_H\"" >>$bb_o
echo '#endif' >>$bb_o
else
echo 'no'
echo '# no' >>config.log
HAVE_SYS_UIO_H=no
echo '#undef HAVE_SYS_UIO_H' >$bb_incdir/have_sys_uio_h.h
fi
if [ "${keep_conftest}" != "yes" ]; then
rm -f conftest$$.c $testdir/conftest$$$EXECSUFFIX
fi
$ECHO_N 'checking for (HAVE_SYS_PARAM_H)...'
$ECHO_N '# checking for