VirtualBox

source: kBuild/trunk/src/grep/m4/pthread-thread.m4

Last change on this file was 3529, checked in by bird, 3 years ago

Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.

  • Property svn:eol-style set to LF
File size: 2.2 KB
Line 
1# pthread-thread.m4 serial 2
2dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7AC_DEFUN([gl_PTHREAD_THREAD],
8[
9 AC_REQUIRE([gl_PTHREAD_H])
10 AC_REQUIRE([AC_CANONICAL_HOST])
11
12 if { case "$host_os" in mingw*) true;; *) false;; esac; } \
13 && test $gl_threads_api = windows; then
14 dnl Choose function names that don't conflict with the mingw-w64 winpthreads
15 dnl library.
16 REPLACE_PTHREAD_CREATE=1
17 REPLACE_PTHREAD_ATTR_INIT=1
18 REPLACE_PTHREAD_ATTR_GETDETACHSTATE=1
19 REPLACE_PTHREAD_ATTR_SETDETACHSTATE=1
20 REPLACE_PTHREAD_ATTR_DESTROY=1
21 REPLACE_PTHREAD_SELF=1
22 REPLACE_PTHREAD_EQUAL=1
23 REPLACE_PTHREAD_DETACH=1
24 REPLACE_PTHREAD_JOIN=1
25 REPLACE_PTHREAD_EXIT=1
26 else
27 if test $HAVE_PTHREAD_H = 0; then
28 HAVE_PTHREAD_CREATE=0
29 HAVE_PTHREAD_ATTR_INIT=0
30 HAVE_PTHREAD_ATTR_GETDETACHSTATE=0
31 HAVE_PTHREAD_ATTR_SETDETACHSTATE=0
32 HAVE_PTHREAD_ATTR_DESTROY=0
33 HAVE_PTHREAD_SELF=0
34 HAVE_PTHREAD_EQUAL=0
35 HAVE_PTHREAD_DETACH=0
36 HAVE_PTHREAD_JOIN=0
37 HAVE_PTHREAD_EXIT=0
38 else
39 dnl On HP-UX 11.11, pthread_create() and pthread_attr_init() are only
40 dnl defined as inline functions.
41 AC_CACHE_CHECK([whether pthread_create exists as a global function],
42 [gl_cv_func_pthread_create],
43 [saved_LIBS="$LIBS"
44 LIBS="$LIBS $LIBPMULTITHREAD"
45 AC_LINK_IFELSE(
46 [AC_LANG_SOURCE(
47 [[extern
48 #ifdef __cplusplus
49 "C"
50 #endif
51 int pthread_create (void);
52 int main ()
53 {
54 return pthread_create ();
55 }
56 ]])],
57 [gl_cv_func_pthread_create=yes],
58 [gl_cv_func_pthread_create=no])
59 LIBS="$saved_LIBS"
60 ])
61 if test $gl_cv_func_pthread_create = no; then
62 REPLACE_PTHREAD_CREATE=1
63 REPLACE_PTHREAD_ATTR_INIT=1
64 AC_DEFINE([PTHREAD_CREATE_IS_INLINE], [1],
65 [Define if pthread_create is an inline function.])
66 fi
67 fi
68 fi
69])
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette