Lines Matching +full:gcc +full:- +full:g
2 # https://www.gnu.org/software/autoconf-archive/ax_pthread.html
7 # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
18 # multi-threaded programs (defaults to the value of CC otherwise). (This
32 # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
34 # that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
40 # ACTION-IF-FOUND is a list of shell commands to run if a threads library
41 # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
42 # is not found. If ACTION-IF-FOUND is not specified, the default action
52 # Updated for Autoconf 2.68 by Daniel Richard G.
56 # Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
57 # Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
96 # requires special compiler flags (e.g. on Tru64 or Sequent).
123 # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
124 # libraries is broken (non-POSIX).
126 # Create a list of thread flags to try. Items starting with a "-" are
128 # which indicates that we try without any flags at all, and "pthread-config"
131 ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pth…
136 # pthreads: AIX (must check this before -lpthread)
137 # none: in case threads are in libc; should be tried before -Kthread and
139 # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
140 # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
141 # (Note: HP C rejects this with "bad form for `-t' option")
142 # -pthreads: Solaris/gcc (Note: HP C also rejects)
143 # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
145 # -D_REENTRANT too), HP C (must be checked before -lpthread, which
146 # is present but should not be used directly; and before -mthreads,
147 # because the compiler interprets this as "-mt" + "-hreads")
148 # -mthreads: Mingw32/gcc, Lynx/gcc
150 # --thread-safe: KAI C++
151 # pthread-config: use pthread-config program (for GNU Pth library)
157 # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
158 # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
160 ax_pthread_flags="-kthread lthread $ax_pthread_flags"
165 # From the cc(1) man page: "[-mt] Sets various -D flags to enable
166 # multi-threading and also sets -lpthread."
168 ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
173 # IBM z/OS requires a feature-test macro to be defined in order to
184 …[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])…
190 # (non-functional) versions of the pthreads routines, so link-based
195 # standard Solaris way of linking pthreads (-mt -lpthread).
197 ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
201 # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
203 AS_IF([test "x$GCC" = "xyes"],
204 [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
206 # The presence of a feature test macro requesting re-entrant function
220 ax_pthread_check_macro="--"
223 AS_IF([test "x$ax_pthread_check_macro" = "x--"],
232 # Note that Autoconf sets GCC=yes for Clang as well as GCC
233 if test "x$GCC" = "xyes"; then
235 [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
247 # Clang needs special handling, because older versions handle the -pthread
252 # Clang takes -pthread; it has never supported any other flag
258 # (Note 2: On some systems, notably Darwin, -pthread is not needed
261 # -pthread does define _REENTRANT, and while the Darwin headers
262 # ignore this macro, third-party headers might not.)
264 PTHREAD_CFLAGS="-pthread"
271 # taking place, the -pthread option has no effect ("argument unused
272 # during compilation"). They expect -pthread to be passed in only
283 # Even though use of the -pthread flag in linking would only print
284 # a warning, this can be a nuisance for well-run software projects
285 # that build with -Werror. So if the active version of Clang has
288 …E_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
292 # links in two steps (.c -> .o, .o -> exe) instead of one
293 # (.c -> exe), because the warning occurs only in the second
296 ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
300 … for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
302 … CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
331 -mt,pthread)
332 AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
333 PTHREAD_CFLAGS="-mt"
334 PTHREAD_LIBS="-lpthread"
337 -*)
342 pthread-config)
343 AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
345 PTHREAD_CFLAGS="`pthread-config --cflags`"
346 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
350 AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
351 PTHREAD_LIBS="-l$ax_pthread_try_flag"
362 # need a special flag -Kthread to make this header compile.)
363 # We check for pthread_join because it is in -lpthread on IRIX
365 # due to DEC craziness with -lpthreads. We check for
367 # functions on Solaris that doesn't have a non-functional libc stub.
420 uses a non-standard name on your system.])
429 ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
455 if test "x$GCC" != "xyes"; then
470 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
476 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: