2002-12-02 15:39:26 -08:00
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(configure.in)
2004-02-16 23:11:28 -08:00
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
2006-05-19 02:27:33 -07:00
AM_INIT_AUTOMAKE(eet, 0.9.10.027)
2002-12-02 15:39:26 -08:00
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
2005-11-03 19:22:22 -08:00
AC_FUNC_ALLOCA
2002-12-02 15:39:26 -08:00
2004-05-13 17:28:47 -07:00
AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
2004-05-12 20:38:32 -07:00
2004-07-14 09:37:29 -07:00
AC_CHECK_HEADERS(netinet/in.h)
2004-10-12 09:15:54 -07:00
case "$host_os" in
mingw|mingw32)
winsock_libs="-lwsock32"
;;
esac
AC_SUBST(winsock_libs)
AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file]))
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_CHECK_LIB(fnmatch, fnmatch, res=yes, res=no)
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch])
else
fnmatch_libs="-lfnmatch"
fi
fi
AC_SUBST(fnmatch_libs)
2004-01-17 07:11:55 -08:00
dnl These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
AC_DEFINE(__USE_GNU, , [Enable GNU extensions])
2004-07-14 09:37:29 -07:00
AC_CHECK_FUNCS(fmemopen open_memstream realpath)
2003-02-02 17:07:58 -08:00
2005-05-26 08:33:26 -07:00
dnl Check whether the null pointer is zero on this arch
AC_MSG_CHECKING([value of the null pointer])
AC_TRY_RUN([
#include <stdlib.h>
2006-01-14 00:59:42 -08:00
int main (int argc, char **argv) {
void *foo = NULL;
int bar = (int)foo;
return (int)foo;
}
], AC_MSG_RESULT([yes]), [
AC_MSG_RESULT([no])
2005-05-26 08:33:26 -07:00
AC_MSG_WARN([Your system is a bit too funny, eet might not work properly])
2005-06-10 02:40:23 -07:00
], AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay])
)
2005-05-26 08:33:26 -07:00
2006-01-14 00:59:42 -08:00
AC_MSG_CHECKING([OS libc C99 '%a' support])
AC_TRY_RUN([
#include <stdio.h>
int main(int argc, char **argv) {
char buf[4096];
float ival = 0.1234, oval = 0.0;
snprintf(buf, sizeof(buf), "%a", (double)ival);
sscanf(buf, "%a", &oval);
if (ival != oval) return -1;
return 0;
}
], AC_MSG_RESULT([yes]), [
AC_MSG_RESULT([no])
AC_MSG_ERROR([Unsupported Operating System!
Your OS does not support C99's '%a' string format. Eet cannot function without
it. Please contact your OS vendor to get updates for C99 '%a' floating point
format read/write support or change operating systems for one with support
for an already very old standard. (Linux is known to support this, as is
Solaris 10)])
], AC_MSG_WARN([Cannot check when cross-compiling -- assuming C99 '%a' support is OK])
)
2005-01-04 21:05:30 -08:00
if test "x${bindir}" = 'x${exec_prefix}/bin'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
2002-12-02 15:39:26 -08:00
else
2005-01-04 21:05:30 -08:00
if test "x${prefix}" = "xNONE"; then
bindir="${ac_default_prefix}/bin";
else
bindir="${prefix}/bin";
fi
2002-12-02 15:39:26 -08:00
fi
fi
2005-01-04 21:05:30 -08:00
if test "x${libdir}" = 'x${exec_prefix}/lib'; then
if test "x${exec_prefix}" = "xNONE"; then
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
2002-12-02 15:39:26 -08:00
else
2005-01-04 21:05:30 -08:00
if test "x${prefix}" = "xNONE"; then
libdir="${ac_default_prefix}/lib";
else
libdir="${prefix}/lib";
fi
2002-12-02 15:39:26 -08:00
fi
fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${bindir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", [Installation directory for user executables])
2002-12-02 15:39:26 -08:00
else
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", [Installation directory for user executables])
2002-12-02 15:39:26 -08:00
fi
else
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", [Installation directory for user executables])
2002-12-02 15:39:26 -08:00
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${libdir}" = 'xNONE'; then
if test "x${prefix}" = "xNONE"; then
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", [Installation directory for libraries] )
2002-12-02 15:39:26 -08:00
else
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", [Installation directory for libraries])
2002-12-02 15:39:26 -08:00
fi
else
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", [Installation directory for libraries])
2002-12-02 15:39:26 -08:00
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
2004-01-14 12:29:55 -08:00
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [Source code directory])
2002-12-02 15:39:26 -08:00
2005-09-29 18:37:16 -07:00
#dnl Documentation
#AM_CHECK_DOXYGEN()
2005-09-27 15:10:09 -07:00
2002-12-02 15:39:26 -08:00
AC_OUTPUT([
2002-12-02 16:26:34 -08:00
Makefile
2003-05-08 00:59:58 -07:00
eet.pc
2005-09-27 15:10:09 -07:00
eet.c
2002-12-02 16:26:34 -08:00
src/Makefile
src/lib/Makefile
src/bin/Makefile
eet-config
2005-03-02 18:29:18 -08:00
README
2005-03-02 17:34:03 -08:00
eet.spec
eet.oe
eet-native.oe
eet.bb
eetXnative.bb
2006-03-09 09:25:25 -08:00
debian/changelog
2002-12-02 16:26:34 -08:00
],[
chmod +x eet-config
2002-12-02 15:39:26 -08:00
])
2005-09-27 15:10:09 -07:00
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
2005-09-29 18:37:16 -07:00
#echo " Build documentation..: $BUILD_DOCS"
#echo
2005-09-27 15:10:09 -07:00
echo " Compilation..........: make"
echo
echo " Installation.........: make install"
echo
echo " prefix.........: $prefix"
echo " binaries.......: $bindir"
echo " libraries......: $libdir"
echo " headers........: $includedir"
2005-09-29 18:37:16 -07:00
#echo " documentation..: $datadir/$PACKAGE/doc"
2005-09-27 15:10:09 -07:00
echo