threadlibs.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 1994 by Xerox Corporation. All rights reserved.
  3. * Copyright (c) 1996 by Silicon Graphics. All rights reserved.
  4. * Copyright (c) 1998 by Fergus Henderson. All rights reserved.
  5. * Copyright (c) 2000-2010 by Hewlett-Packard Development Company.
  6. * All rights reserved.
  7. *
  8. * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
  9. * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
  10. *
  11. * Permission is hereby granted to use or copy this program
  12. * for any purpose, provided the above notices are retained on all copies.
  13. * Permission to modify the code and to distribute modified code is granted,
  14. * provided the above notices are retained, and a notice that the code was
  15. * modified is included with the above copyright notice.
  16. */
  17. # include "private/gc_priv.h"
  18. # include <stdio.h>
  19. int main(void)
  20. {
  21. # if defined(GC_USE_LD_WRAP)
  22. printf("-Wl,--wrap -Wl,dlopen "
  23. "-Wl,--wrap -Wl,pthread_create -Wl,--wrap -Wl,pthread_join "
  24. "-Wl,--wrap -Wl,pthread_detach -Wl,--wrap -Wl,pthread_sigmask "
  25. "-Wl,--wrap -Wl,pthread_exit -Wl,--wrap -Wl,pthread_cancel\n");
  26. # endif
  27. # if (defined(GC_LINUX_THREADS) && !defined(HOST_ANDROID)) \
  28. || defined(GC_IRIX_THREADS) || defined(GC_DARWIN_THREADS) \
  29. || defined(GC_AIX_THREADS) || (defined(HURD) && defined(GC_THREADS))
  30. # ifdef GC_USE_DLOPEN_WRAP
  31. printf("-ldl ");
  32. # endif
  33. printf("-lpthread\n");
  34. # endif
  35. # if defined(GC_OPENBSD_THREADS)
  36. printf("-pthread\n");
  37. # endif
  38. # if defined(GC_FREEBSD_THREADS)
  39. # ifdef GC_USE_DLOPEN_WRAP
  40. printf("-ldl ");
  41. # endif
  42. # if (__FREEBSD_version < 500000)
  43. printf("-pthread\n");
  44. # else /* __FREEBSD__ || __DragonFly__ */
  45. printf("-lpthread\n");
  46. # endif
  47. # endif
  48. # if defined(GC_NETBSD_THREADS)
  49. printf("-lpthread -lrt\n");
  50. # endif
  51. # if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS)
  52. printf("-lpthread -lrt\n");
  53. # endif
  54. # if defined(GC_SOLARIS_THREADS)
  55. printf("-lthread -lposix4\n");
  56. /* Is this right for recent versions? */
  57. # endif
  58. # if defined(GC_WIN32_THREADS) && defined(CYGWIN32)
  59. printf("-lpthread\n");
  60. # endif
  61. # if defined(GC_WIN32_PTHREADS)
  62. # ifdef PTW32_STATIC_LIB
  63. /* assume suffix s for static version of the win32 pthread library */
  64. printf("-lpthreadGC2s -lws2_32\n");
  65. # else
  66. printf("-lpthreadGC2\n");
  67. # endif
  68. # endif
  69. # if defined(GC_OSF1_THREADS)
  70. printf("-pthread -lrt\n"); /* DOB: must be -pthread, not -lpthread */
  71. # endif
  72. /* You need GCC 3.0.3 to build this one! */
  73. /* DG/UX native gcc doesn't know what "-pthread" is */
  74. # if defined(GC_DGUX386_THREADS)
  75. printf("-ldl -pthread\n");
  76. # endif
  77. return 0;
  78. }