diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-15 21:59:31 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-09-15 21:59:31 +0300 |
commit | 468723c2f65e6506cb413efbfb223cde790dba1e (patch) | |
tree | dc8afcd6071fa334f7680eccfb34b41e72033da4 /m4/ax_pthread.m4 | |
parent | e9096b7c8dfec379c95b171edf83d895ef777635 (diff) | |
download | libmicrohttpd-468723c2f65e6506cb413efbfb223cde790dba1e.tar.gz libmicrohttpd-468723c2f65e6506cb413efbfb223cde790dba1e.zip |
ax_pthread.m4: updated to the latest version
Diffstat (limited to 'm4/ax_pthread.m4')
-rw-r--r-- | m4/ax_pthread.m4 | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4 index 2ef79838..9f35d139 100644 --- a/m4/ax_pthread.m4 +++ b/m4/ax_pthread.m4 | |||
@@ -14,20 +14,24 @@ | |||
14 | # flags that are needed. (The user can also force certain compiler | 14 | # flags that are needed. (The user can also force certain compiler |
15 | # flags/libs to be tested by setting these environment variables.) | 15 | # flags/libs to be tested by setting these environment variables.) |
16 | # | 16 | # |
17 | # Also sets PTHREAD_CC to any special C compiler that is needed for | 17 | # Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is |
18 | # multi-threaded programs (defaults to the value of CC otherwise). (This | 18 | # needed for multi-threaded programs (defaults to the value of CC |
19 | # is necessary on AIX to use the special cc_r compiler alias.) | 19 | # respectively CXX otherwise). (This is necessary on e.g. AIX to use the |
20 | # special cc_r/CC_r compiler alias.) | ||
20 | # | 21 | # |
21 | # NOTE: You are assumed to not only compile your program with these flags, | 22 | # NOTE: You are assumed to not only compile your program with these flags, |
22 | # but also to link with them as well. For example, you might link with | 23 | # but also to link with them as well. For example, you might link with |
23 | # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS | 24 | # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS |
25 | # $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS | ||
24 | # | 26 | # |
25 | # If you are only building threaded programs, you may wish to use these | 27 | # If you are only building threaded programs, you may wish to use these |
26 | # variables in your default LIBS, CFLAGS, and CC: | 28 | # variables in your default LIBS, CFLAGS, and CC: |
27 | # | 29 | # |
28 | # LIBS="$PTHREAD_LIBS $LIBS" | 30 | # LIBS="$PTHREAD_LIBS $LIBS" |
29 | # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | 31 | # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
32 | # CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" | ||
30 | # CC="$PTHREAD_CC" | 33 | # CC="$PTHREAD_CC" |
34 | # CXX="$PTHREAD_CXX" | ||
31 | # | 35 | # |
32 | # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant | 36 | # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant |
33 | # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to | 37 | # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to |
@@ -83,8 +87,7 @@ | |||
83 | # modified version of the Autoconf Macro, you may extend this special | 87 | # modified version of the Autoconf Macro, you may extend this special |
84 | # exception to the GPL to apply to your modified version as well. | 88 | # exception to the GPL to apply to your modified version as well. |
85 | 89 | ||
86 | # locally patched for autoconf 2.70 compatibility | 90 | #serial 31 |
87 | #serial 27 | ||
88 | 91 | ||
89 | AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) | 92 | AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) |
90 | AC_DEFUN([AX_PTHREAD], [ | 93 | AC_DEFUN([AX_PTHREAD], [ |
@@ -106,6 +109,7 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then | |||
106 | ax_pthread_save_CFLAGS="$CFLAGS" | 109 | ax_pthread_save_CFLAGS="$CFLAGS" |
107 | ax_pthread_save_LIBS="$LIBS" | 110 | ax_pthread_save_LIBS="$LIBS" |
108 | AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) | 111 | AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) |
112 | AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) | ||
109 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | 113 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" |
110 | LIBS="$PTHREAD_LIBS $LIBS" | 114 | LIBS="$PTHREAD_LIBS $LIBS" |
111 | AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) | 115 | AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) |
@@ -483,18 +487,28 @@ if test "x$ax_pthread_ok" = "xyes"; then | |||
483 | [#handle absolute path differently from PATH based program lookup | 487 | [#handle absolute path differently from PATH based program lookup |
484 | AS_CASE(["x$CC"], | 488 | AS_CASE(["x$CC"], |
485 | [x/*], | 489 | [x/*], |
486 | [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], | 490 | [ |
487 | [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) | 491 | AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) |
492 | AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) | ||
493 | ], | ||
494 | [ | ||
495 | AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) | ||
496 | AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) | ||
497 | ] | ||
498 | ) | ||
499 | ]) | ||
488 | ;; | 500 | ;; |
489 | esac | 501 | esac |
490 | fi | 502 | fi |
491 | fi | 503 | fi |
492 | 504 | ||
493 | test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" | 505 | test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" |
506 | test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" | ||
494 | 507 | ||
495 | AC_SUBST([PTHREAD_LIBS]) | 508 | AC_SUBST([PTHREAD_LIBS]) |
496 | AC_SUBST([PTHREAD_CFLAGS]) | 509 | AC_SUBST([PTHREAD_CFLAGS]) |
497 | AC_SUBST([PTHREAD_CC]) | 510 | AC_SUBST([PTHREAD_CC]) |
511 | AC_SUBST([PTHREAD_CXX]) | ||
498 | 512 | ||
499 | # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: | 513 | # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: |
500 | if test "x$ax_pthread_ok" = "xyes"; then | 514 | if test "x$ax_pthread_ok" = "xyes"; then |