chiark / gitweb /
added --without-threadlocal to disable thread-local keyword for MinGW compilation
authorstevenj <stevenj@alum.mit.edu>
Thu, 15 Jul 2010 20:44:05 +0000 (16:44 -0400)
committerstevenj <stevenj@alum.mit.edu>
Thu, 15 Jul 2010 20:44:05 +0000 (16:44 -0400)
darcs-hash:20100715204405-c8de0-f21292dda1bd153f87aa9d772ddca945a2231a0e.gz

BUILD-MINGW.sh
m4/ax_c_threadlocal.m4

index 09ec11c2379b15df6540869ebdf9c804670ddc33..11712eaf44adca119b60900a63fec78d94b446f5 100755 (executable)
@@ -3,7 +3,7 @@ set -e
 
 rm -rf mingw
 
-./configure --prefix=`pwd`/mingw --host=i586-mingw32msvc --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile && make -j4 && make install
+./configure --prefix=`pwd`/mingw --host=i586-mingw32msvc --enable-shared --disable-static --without-matlab --without-octave --without-python --without-guile --without-threadlocal && make -j4 && make install
 
 cd mingw/bin
 for dll in *.dll; do
index 59c0c8995e81e0bd6f756d8e3393bb4aff49d9d1..0fdb30e55662e3f9695aedeec74bc78344247157 100644 (file)
@@ -18,20 +18,28 @@ dnl @version 2010-05-28
 dnl @license GPLWithACException
 dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
 AC_DEFUN([AX_C_THREADLOCAL],
-[AC_CACHE_CHECK([for C thread-local keyword], acx_cv_c_threadlocal,
-[acx_cv_c_threadlocal=unsupported
- AC_LANG_SAVE
- AC_LANG_C
- for acx_kw in __thread "__declspec(thread)"; do
-   AC_TRY_COMPILE([], [static $acx_kw int x = 0;], 
-                      [acx_cv_c_threadlocal=$acx_kw; break])
- done
- AC_LANG_RESTORE
+[AC_ARG_WITH(threadlocal,
+  [AC_HELP_STRING([--without-threadlocal], [no thread-local storage keyword])],
+  with_ax_c_threadlocal=$withval, with_ax_c_threadlocal=yes)
+ AC_CACHE_CHECK([for C thread-local keyword], ax_cv_c_threadlocal,
+[if test "x$with_ax_c_threadlocal" = xno; then
+   ax_cv_c_threadlocal=disabled
+ else
+   ax_cv_c_threadlocal=unsupported
+   AC_LANG_SAVE
+   AC_LANG_C
+   for ax_kw in __thread "__declspec(thread)"; do
+     AC_TRY_COMPILE([], [static $ax_kw int x = 0;], 
+                        [ax_cv_c_threadlocal=$ax_kw; break])
+   done
+   AC_LANG_RESTORE
+ fi
 ])
- acx_kw="$acx_cv_c_threadlocal"
- if test "$acx_kw" = unsupported; then acx_kw=""; fi
- AC_DEFINE_UNQUOTED(THREADLOCAL, $acx_kw, [Define to C thread-local keyword, or to nothing if this is not supported in your compiler.])
- if test "$acx_cv_c_threadlocal" = unsupported; then
+ ax_kw="$ax_cv_c_threadlocal"
+ if test "x$ax_kw" = xunsupported; then ax_kw=""; fi
+ if test "x$ax_kw" = xdisabled; then ax_kw=""; fi
+ AC_DEFINE_UNQUOTED(THREADLOCAL, $ax_kw, [Define to C thread-local keyword, or to nothing if this is not supported in your compiler.])
+ if test "$ax_cv_c_threadlocal" = unsupported; then
    m4_default([$2],:)
  else
    m4_default([$1],:)