building_from_bzr=no
fi
-AC_PROG_CC
-AC_PROG_CC_C99
AC_PROG_CXX
ACX_USE_SYSTEM_EXTENSIONS
AC_PROG_CPP
AM_PROG_CC_C_O
+FORCE_MAC_GCC42
+dnl Once we can use a modern autoconf, we can use this
+dnl AC_PROG_CC_C99
+
AC_C_BIGENDIAN
AC_C_CONST
AC_HEADER_TIME
AC_TYPE_SIZE_T
-AC_TYPE_SSIZE_T
AC_FUNC_MALLOC
AC_FUNC_REALLOC
# First check for gcc and g++
if test "$GCC" = "yes"
then
+
+ dnl Once we can use a modern autoconf, we can replace the std=gnu99 here
+ dnl with using AC_CC_STD_C99 above
+ CC="${CC} -std=gnu99"
+
CFLAGS="-ggdb3 ${CFLAGS}"
CXXFLAGS="-ggdb3 ${CXXFLAGS}"
fi
if test "x$SUNCC" = "xyes"
then
+ dnl Once we can use a modern autoconf, we can replace the -xc99=all here
+ dnl with using AC_CC_STD_C99 above
+ CC="${CC} -xc99=all"
+
CFLAGS="-g -mt ${CFLAGS}"
CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${CXXFLAGS}"
--- /dev/null
+AC_DEFUN([FORCE_MAC_GCC42],
+ [AS_IF([test "$GCC" = "yes"],[
+ dnl If you're on a Mac, and you didn't ask for a specific compiler
+ dnl You're gonna get 4.2.
+ AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[
+ AS_IF([test -f /usr/bin/gcc-4.2],
+ [
+ CPP="/usr/bin/gcc-4.2 -E"
+ CC=/usr/bin/gcc-4.2
+ CXX=/usr/bin/g++-4.2
+ ])
+ ])
+ ])
+])
+
+AC_DEFUN([CHECK_GCC_VERSION],[
+ AC_REQUIRE([FORCE_MAC_GCC42])
+ AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1))
+# error GCC is Too Old!
+#endif
+ ]])],
+ [ac_cv_gcc_recent=yes],
+ [ac_cv_gcc_recent=no])])
+ AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"],
+ AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required on OSX. You may need to install a version of XCode >= 3.1.2]))
+ AS_IF([test "$drizzle_cv_gcc_recent" = "no"],
+ AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required]))
+])