Results 1 to 6 of 6

Thread: detect thread support

  1. #1

    Default configure: detect thread support on 0.9

    find the right pthread flag, detecting the thread-local storage support is pretty tricky to get right, so copied the tls.m4 macro file from gcc4+ cvs, and added the HAVE_TLS defs where needed.

    added the .patch extension to tls.m4 file so i can attach it
    Attached Files Attached Files

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I am having trouble trying to get this to work. "HAVE_TLS" is not defined

    Would if be sufficient to add something like
    " CLANLIB_CHECK_LIB(tls, [`cat $srcdir/Setup/Tests/tls.cpp`], clanCore, [ *** Cannot find tls], [-pthread]) "
    ?

    where Setup/Tests/tls.cpp tries compile pthread

    Also clanlib will not work without thread_local_storage - so why have a #ifdef for it ?

    /me is confused

  3. #3

    Default

    Quote Originally Posted by rombust View Post
    I am having trouble trying to get this to work. "HAVE_TLS" is not defined
    make sure you rename tls.m4.patch to tls.m4 and copy it to root folder same place where configure.ac is located as HAVE_TLS is defined in there.

    i used sinclude(tls.m4) in acinclude.m4, sinclude definition makes it silently ignore fatal errors, which may not be the best way of doing things. so one could use include instead

    Quote Originally Posted by rombust View Post
    Would if be sufficient to add something like
    " CLANLIB_CHECK_LIB(tls, [`cat $srcdir/Setup/Tests/tls.cpp`], clanCore, [ *** Cannot find tls], [-pthread]) "
    ?
    where Setup/Tests/tls.cpp tries compile pthread
    simple compile test would give wrong results, we have to assure binutils/compiler and libc supports TLS, the tls.m4 file contains good comments what needs to be tested.

    Quote Originally Posted by rombust View Post
    Also clanlib will not work without thread_local_storage - so why have a #ifdef for it ?
    __APPLE__ does not have TLS, so instead of ifdef this and that, HAVE_TLS is better way to detect this.

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    I have applied a modified version of your patch.

    I hope that it is still okay

    The tls.m4 did not work on my machine, but the updated tls.m4 from gcc v4.3.3 does work.

    Thanks

  5. #5

    Default

    noticed i forgot to replace one ifdef, else it looks just fine.
    Attached Files Attached Files

  6. #6
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Patch applied, Many thanks

Similar Threads

  1. Dictionary Additions Thread
    By Seth in forum Dungeon Scroll for PC and iPhone
    Replies: 39
    Last Post: 04-29-2016, 09:43 AM
  2. How to detect when the editor is opening?
    By Uhfgood in forum Novashell Game Creation System
    Replies: 1
    Last Post: 07-07-2008, 11:55 PM
  3. Box2D Support
    By Siris in forum Novashell Game Creation System
    Replies: 7
    Last Post: 06-09-2008, 03:43 AM
  4. Unofficial Novashell Scripting API Documentation Thread
    By Ian in forum Novashell Game Creation System
    Replies: 5
    Last Post: 01-08-2007, 07:54 AM
  5. Support
    By in forum Dink Smallwood HD
    Replies: 0
    Last Post: 07-08-2004, 05:37 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •