+2007-10-10 Ludovic Courtès <ludo@gnu.org>
+
+ * configure.in (SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT):
+ New substituted variable.
+ Use `-Werror' when using GCC and checking for
+ `PTHREAD_ONCE_INIT'. Add check for braces around
+ `PTHREAD_MUTEX_INITIALIZER'.
+ * NEWS: Mention build fix for IRIX.
+
2007-10-02 Ludovic Courtès <ludo@gnu.org>
* NEWS: Mention `(ice-9 slib)' fix and threading fix.
, with_threads=yes)
AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT, 0)
+AC_SUBST(SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER, 0)
case "$with_threads" in
"yes" | "pthread" | "pthreads" | "pthread-threads" | "")
# On past versions of Solaris, believe 8 through 10 at least, you
# had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
- # This is contrary to posix:
+ # This is contrary to POSIX:
# http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
# Check here if this style is required.
#
# glibc (2.3.6 at least) works both with or without braces, so the
# test checks whether it works without.
#
+
+ if test "$GCC" = "yes"; then
+ # Since GCC only issues a warning for missing braces, so we need
+ # `-Werror' to catch it.
+ CFLAGS="-Werror -Wmissing-braces $CFLAGS"
+ fi
+
AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
guile_cv_need_braces_on_pthread_once_init,
- [AC_TRY_COMPILE([#include <pthread.h>],
- [pthread_once_t foo = PTHREAD_ONCE_INIT;],
+ [AC_COMPILE_IFELSE([#include <pthread.h>
+ pthread_once_t foo = PTHREAD_ONCE_INIT;],
[guile_cv_need_braces_on_pthread_once_init=no],
[guile_cv_need_braces_on_pthread_once_init=yes])])
if test "$guile_cv_need_braces_on_pthread_once_init" = yes; then
SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT=1
fi
+ # Same problem with `PTHREAD_MUTEX_INITIALIZER', e.g., on IRIX
+ # 6.5.30m with GCC 3.3.
+ AC_CACHE_CHECK([whether PTHREAD_MUTEX_INITIALIZER needs braces],
+ guile_cv_need_braces_on_pthread_mutex_initializer,
+ [AC_COMPILE_IFELSE([#include <pthread.h>
+ pthread_mutex_t foo = PTHREAD_MUTEX_INITIALIZER;],
+ [guile_cv_need_braces_on_pthread_mutex_initializer=no],
+ [guile_cv_need_braces_on_pthread_mutex_initializer=yes])])
+ if test "$guile_cv_need_braces_on_pthread_mutex_initializer" = yes; then
+ SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER=1
+ fi
+
CFLAGS="$old_CFLAGS"
# On Solaris, sched_yield lives in -lrt.
+2007-10-10 Ludovic Courtès <ludo@gnu.org>
+
+ * pthread-threads.h (SCM_I_PTHREAD_MUTEX_INITIALIZER): Check
+ `SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER'.
+ * gen-scmconfig.h.in
+ (SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER): New.
+ * gen-scmconfig.c (main): Define
+ `SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER'.
+
2007-10-04 Ludovic Courtès <ludo@gnu.org>
* i18n.c (scm_make_locale)[!USE_GNU_LOCALE_API]: Don't call
pf ("#define SCM_NEED_BRACES_ON_PTHREAD_ONCE_INIT %d /* 0 or 1 */\n",
SCM_I_GSC_NEED_BRACES_ON_PTHREAD_ONCE_INIT);
+ pf ("/* Define to 1 if need braces around PTHREAD_MUTEX_INITIALIZER\n"
+ " (for IRIX with GCC) */\n");
+ pf ("#define SCM_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER %d /* 0 or 1 */\n",
+ SCM_I_GSC_NEED_BRACES_ON_PTHREAD_MUTEX_INITIALIZER);
+
#if USE_DLL_IMPORT
pf ("\n");
pf ("/* Define some additional CPP macros on Win32 platforms. */\n");