GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
+CFLAGS="$CFLAGS -g"
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
unset ac_cv_prog_cc_g
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
+CFLAGS="$CFLAGS -g"
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
+ CXXFLAGS="$CXXFLAGS -g -O2"
else
- CXXFLAGS="-g"
+ CXXFLAGS="$CXXFLAGS -g"
fi
else
if test "$GXX" = yes; then
unset ac_cv_prog_cc_g
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
+CFLAGS="$CFLAGS -g"
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
if test "${ac_cv_prog_cc_g+set}" = set; then
fi
fi
+echo "$as_me:$LINENO: checking whether the compiler supports variadic macros" >&5
+echo $ECHO_N "checking whether the compiler supports variadic macros... $ECHO_C" >&6
+if test "${wx_cv_have_variadic_macros+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stdio.h>
+ #define test(fmt, ...) printf(fmt, __VA_ARGS__)
+
+int
+main ()
+{
+
+ test("%s %d %p", "test", 1, 0);
+
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ wx_cv_have_variadic_macros=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+wx_cv_have_variadic_macros=no
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+fi
+echo "$as_me:$LINENO: result: $wx_cv_have_variadic_macros" >&5
+echo "${ECHO_T}$wx_cv_have_variadic_macros" >&6
+
+if test $wx_cv_have_variadic_macros = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_VARIADIC_MACROS 1
+_ACEOF
+
+fi
+
# Check whether --enable-largefile or --disable-largefile was given.
if test "${enable_largefile+set}" = set; then
enableval="$enable_largefile"
else
if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
+ { { echo "$as_me:$LINENO: error: internal error: not reached in cross-compile" >&5
+echo "$as_me: error: internal error: not reached in cross-compile" >&2;}
{ (exit 1); exit 1; }; }
else
cat >conftest.$ac_ext <<_ACEOF
fi
fi
+dnl Check if variadic macros (C99 feature) are supported:
+AC_CACHE_CHECK(
+ [whether the compiler supports variadic macros],
+ [wx_cv_have_variadic_macros],
+ [
+ AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM(
+ [
+ #include <stdio.h>
+ #define test(fmt, ...) printf(fmt, __VA_ARGS__)
+ ],
+ [
+ test("%s %d %p", "test", 1, 0);
+ ]
+ ),
+ [wx_cv_have_variadic_macros=yes],
+ [wx_cv_have_variadic_macros=no]
+ )
+ ]
+)
+
+if test $wx_cv_have_variadic_macros = "yes"; then
+ AC_DEFINE(HAVE_VARIADIC_MACROS)
+fi
+
dnl check for large file support
AC_SYS_LARGEFILE
#else //!debug || !wxUSE_LOG
// these functions do nothing in release builds
+ #define wxVLogDebug(fmt, valist)
+ #define wxVLogTrace(mask, fmt, valist)
+
+ #ifdef HAVE_VARIADIC_MACROS
+ // unlike the inline functions below, this completely removes the
+ // wxLogXXX calls from the object file:
+ #define wxLogDebug(fmt, ...)
+ #define wxLogTrace(mask, fmt, ...)
+ #else // !HAVE_VARIADIC_MACROS
// note that leaving out "fmt" in the vararg functions provokes a warning
// from SGI CC: "the last argument of the varargs function is unnamed"
- inline void wxVLogDebug(const wxChar *, va_list) { }
inline void wxLogDebug(const wxChar *fmt, ...) { wxUnusedVar(fmt); }
- inline void wxVLogTrace(wxTraceMask, const wxChar *, va_list) { }
inline void wxLogTrace(wxTraceMask, const wxChar *fmt, ...) { wxUnusedVar(fmt); }
- inline void wxVLogTrace(const wxChar *, const wxChar *, va_list) { }
inline void wxLogTrace(const wxChar *, const wxChar *fmt, ...) { wxUnusedVar(fmt); }
+ #endif // HAVE_VARIADIC_MACROS/!HAVE_VARIADIC_MACROS
#endif // debug/!debug
// wxLogFatalError helper: show the (fatal) error to the user in a safe way,
#define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode())
#else //!debug
- inline void wxLogApiError(const wxChar *, long) { }
- inline void wxLogLastError(const wxChar *) { }
+ #define wxLogApiError(api, err)
+ #define wxLogLastError(api)
#endif //debug/!debug
// wxCocoa has additiional trace masks