<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 17, 2009, at 10:33 PM, Eric Christopher wrote:</div><br><blockquote type="cite"><div>a) the idea of testing host configuration (which may not work) for something target specific seems a bit problematic.<br></div></blockquote><div><br></div><div>I don't really have a better idea.</div><div><br></div><blockquote type="cite"><div>c)<br><br> AC_RUN_IFELSE(AC_LANG_SOURCE([[int main() {<br>+                 volatile unsigned long val = 1;<br>+                 __sync_synchronize();<br>+                 if (__sync_val_compare_and_swap(&val, 1, 0) != 1 ||<br>+                     val != 0)<br>+                   return 1;<br>+                 return 0; }]]),<br><br>Do you care if it runs or if it links? I'd have thought the latter, but it's up to you.<br></div></blockquote><div><br></div><div>Probably just links, I guess.</div><br><blockquote type="cite"><div>d)<br><br>+                AC_DEFINE(ENABLE_THREADS, [0])<br><br>You can do this using something like:<br><br>AC_DEFINE(ENABLE_THREADS, 0,<br>        Define if gcc atomic builtins work on your system.)<br></div></blockquote><div><br></div><div>What does this achieve?</div><br><blockquote type="cite"><div>e) ENABLE_THREADS seems like a really bad name :)<br></div></blockquote><div><br></div><div>I didn't choose it.  It's already part of LLVM's configure.ac.</div><br><blockquote type="cite"><div>f) It seems like you want to do a configure time flag? I'm not positive though. If you did then something like this may work better:<br><br>AC_ARG_ENABLE(enable-gcc-atomics,<br>[  --enable-gcc-atomics   gcc atomic functions],,<br>enable_gcc_atomics=no)<br><br>(or yes, depending on what you want it to default to) and then something like:<br><br>if test x$enable_gcc_atomics = xyes ; then<br>  AC_DEFINE(ENABLE_THREADS, 1,<br>        Define if gcc atomic builtins work on your system.)<br>fi<br></div></blockquote><div><br></div><div>There's already a --enable-threads configure thread, that defaults to true.</div><br><blockquote type="cite"><div>g)<br><br>+                AC_SUBST(ENABLE_THREADS, [0])<br><br>You probably don't mean to SUBST and DEFINE this. Is it for the environment or the compiled C/C++ files?<br></div></blockquote><div><br></div><div>I'm somewhat confused on this one myself.  Early parts of the configure.ac use AC_SUBST, but there <i>is</i> a #define for it in config.h, which doesn't get changed if I just use AC_SUBST, hence whey I added the AC_DEFINE.  Perhaps it's a bug in the rest of configure.ac?</div><div><br></div><blockquote type="cite"><div>Sorry to seemingly pick it apart so much, but you did ask :)<br></div></blockquote><br></div><div>Much appreciated!</div><div><br></div><div>--Owen</div><br></body></html>