Debian Codegraph @

tools/threadlibs.c

raw
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
18 #ifdef HAVE_CONFIG_H
19 # include "config.h"
20 #endif
21
22 # include "private/gcconfig.h"
23
24 # include <stdio.h>
25
26 int main(void)
27 {
28 # if defined(GC_USE_LD_WRAP)
29 printf("-Wl,--wrap -Wl,dlopen "
30 "-Wl,--wrap -Wl,pthread_create -Wl,--wrap -Wl,pthread_join "
31 "-Wl,--wrap -Wl,pthread_detach -Wl,--wrap -Wl,pthread_sigmask "
32 "-Wl,--wrap -Wl,pthread_exit -Wl,--wrap -Wl,pthread_cancel\n");
33 # endif
34 # if (defined(GC_LINUX_THREADS) && !defined(HOST_ANDROID)) \
35 || defined(GC_IRIX_THREADS) || defined(GC_DARWIN_THREADS) \
36 || defined(GC_AIX_THREADS) || (defined(HURD) && defined(GC_THREADS))
37 # ifdef GC_USE_DLOPEN_WRAP
38 printf("-ldl ");
39 # endif
40 printf("-lpthread\n");
41 # endif
42 # if defined(GC_OPENBSD_THREADS)
43 printf("-pthread\n");
44 # endif
45 # if defined(GC_FREEBSD_THREADS)
46 # ifdef GC_USE_DLOPEN_WRAP
47 printf("-ldl ");
48 # endif
49 # if (__FREEBSD_version < 500000)
50 printf("-pthread\n");
51 # else /* __FREEBSD__ || __DragonFly__ */
52 printf("-lpthread\n");
53 # endif
54 # endif
55 # if defined(GC_HPUX_THREADS) || defined(GC_NETBSD_THREADS)
56 printf("-lpthread -lrt\n");
57 # endif
58 # if defined(GC_OSF1_THREADS)
59 printf("-pthread -lrt\n"); /* DOB: must be -pthread, not -lpthread */
60 # endif
61 # if defined(GC_SOLARIS_THREADS)
62 printf("-lthread -lposix4\n");
63 /* Is this right for recent versions? */
64 # endif
65 # if defined(GC_WIN32_THREADS) && defined(CYGWIN32)
66 printf("-lpthread\n");
67 # endif
68 # if defined(GC_WIN32_PTHREADS)
69 # ifdef PTW32_STATIC_LIB
70 /* assume suffix s for static version of the pthreads-win32 library */
71 printf("-lpthreadGC2s -lws2_32\n");
72 # else
73 printf("-lpthreadGC2\n");
74 # endif
75 # endif
76 /* You need GCC 3.0.3 to build this one! */
77 /* DG/UX native gcc doesn't know what "-pthread" is */
78 # if defined(GC_DGUX386_THREADS)
79 printf("-ldl -pthread\n");
80 # endif
81 return 0;
82 }