threadlibs.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # include "gc_config_macros.h"
  2. # include "private/gcconfig.h"
  3. # include <stdio.h>
  4. int main()
  5. {
  6. # if defined(GC_USE_LD_WRAP)
  7. printf("-Wl,--wrap -Wl,dlopen "
  8. "-Wl,--wrap -Wl,pthread_create -Wl,--wrap -Wl,pthread_join "
  9. "-Wl,--wrap -Wl,pthread_detach "
  10. "-Wl,--wrap -Wl,pthread_sigmask -Wl,--wrap -Wl,sleep\n");
  11. # endif
  12. # if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
  13. || defined(GC_SOLARIS_PTHREADS) \
  14. || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
  15. || defined(GC_GNU_THREADS)
  16. printf("-lpthread\n");
  17. # endif
  18. # if defined(GC_FREEBSD_THREADS)
  19. # if (__FREEBSD_version >= 500000)
  20. printf("-lpthread\n");
  21. # else
  22. printf("-pthread\n");
  23. # endif
  24. # endif
  25. # if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
  26. printf("-lpthread -lrt\n");
  27. # endif
  28. # if defined(GC_SOLARIS_THREADS) && !defined(GC_SOLARIS_PTHREADS)
  29. printf("-lthread -ldl\n");
  30. # endif
  31. # if defined(GC_WIN32_THREADS) && defined(CYGWIN32)
  32. printf("-lpthread\n");
  33. # endif
  34. # if defined(GC_OSF1_THREADS)
  35. printf("-pthread -lrt"); /* DOB: must be -pthread, not -lpthread */
  36. # endif
  37. /* You need GCC 3.0.3 to build this one! */
  38. /* DG/UX native gcc doesnt know what "-pthread" is */
  39. # if defined(GC_DGUX386_THREADS)
  40. printf("-ldl -pthread\n");
  41. # endif
  42. return 0;
  43. }