From ba5cc5b1000ddbd7a50635ac9a9c4e7d090de3fc Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sat, 14 Jan 2006 08:59:42 +0000 Subject: [PATCH] add a check for c99 %a format support - so all those people with mysterious errors will know why and who to contact for fixes (not us!) SVN revision: 19763 --- legacy/eet/configure.in | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/legacy/eet/configure.in b/legacy/eet/configure.in index dc67c7104a..f1ba9c2f87 100644 --- a/legacy/eet/configure.in +++ b/legacy/eet/configure.in @@ -55,17 +55,39 @@ dnl Check whether the null pointer is zero on this arch AC_MSG_CHECKING([value of the null pointer]) AC_TRY_RUN([ #include -int main () { -void *foo = NULL; -int bar = (int) foo; - -return (int) foo;} -], AC_MSG_RESULT([\o/]), [ - AC_MSG_RESULT([o_O]) +int main (int argc, char **argv) { + void *foo = NULL; + int bar = (int)foo; + return (int)foo; +} +], AC_MSG_RESULT([yes]), [ + AC_MSG_RESULT([no]) AC_MSG_WARN([Your system is a bit too funny, eet might not work properly]) ], AC_MSG_WARN([Cannot check when cross-compiling -- assuming null is okay]) ) +AC_MSG_CHECKING([OS libc C99 '%a' support]) +AC_TRY_RUN([ +#include +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]) +) + if test "x${bindir}" = 'x${exec_prefix}/bin'; then if test "x${exec_prefix}" = "xNONE"; then if test "x${prefix}" = "xNONE"; then