configure: Remove obsolete and deprecated constructs.
These were uncovered when trying to run `bootstrap.sh` with Autoconf 2.71: * AC_CONFIG_HEADER() is deprecated in favor of AC_CONFIG_HEADERS(). * AC_HEADER_TIME is obsolete. * $as_echo is deprecated in favor of AS_ECHO() which requires an update to ax_pthread.m4. Note that the generated artifacts in this commit are from Autoconf 2.69. Resolves #139
This commit is contained in:
parent
f7e1f1fbbd
commit
21d3c4ae58
|
@ -1,5 +1,5 @@
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
#
|
#
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
|
@ -14,20 +14,24 @@
|
||||||
# flags that are needed. (The user can also force certain compiler
|
# flags that are needed. (The user can also force certain compiler
|
||||||
# flags/libs to be tested by setting these environment variables.)
|
# flags/libs to be tested by setting these environment variables.)
|
||||||
#
|
#
|
||||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
|
||||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
# needed for multi-threaded programs (defaults to the value of CC
|
||||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
|
||||||
|
# special cc_r/CC_r compiler alias.)
|
||||||
#
|
#
|
||||||
# NOTE: You are assumed to not only compile your program with these flags,
|
# NOTE: You are assumed to not only compile your program with these flags,
|
||||||
# but also to link with them as well. For example, you might link with
|
# but also to link with them as well. For example, you might link with
|
||||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||||
|
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||||
#
|
#
|
||||||
# If you are only building threaded programs, you may wish to use these
|
# If you are only building threaded programs, you may wish to use these
|
||||||
# variables in your default LIBS, CFLAGS, and CC:
|
# variables in your default LIBS, CFLAGS, and CC:
|
||||||
#
|
#
|
||||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
|
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||||
# CC="$PTHREAD_CC"
|
# CC="$PTHREAD_CC"
|
||||||
|
# CXX="$PTHREAD_CXX"
|
||||||
#
|
#
|
||||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||||
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
||||||
|
@ -55,6 +59,7 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||||
|
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify it
|
# This program is free software: you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by the
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
@ -67,7 +72,7 @@
|
||||||
# Public License for more details.
|
# Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||||
# gives unlimited permission to copy, distribute and modify the configure
|
# gives unlimited permission to copy, distribute and modify the configure
|
||||||
|
@ -82,7 +87,7 @@
|
||||||
# modified version of the Autoconf Macro, you may extend this special
|
# modified version of the Autoconf Macro, you may extend this special
|
||||||
# exception to the GPL to apply to your modified version as well.
|
# exception to the GPL to apply to your modified version as well.
|
||||||
|
|
||||||
#serial 23
|
#serial 31
|
||||||
|
|
||||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||||
AC_DEFUN([AX_PTHREAD], [
|
AC_DEFUN([AX_PTHREAD], [
|
||||||
|
@ -104,6 +109,7 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
ax_pthread_save_LIBS="$LIBS"
|
ax_pthread_save_LIBS="$LIBS"
|
||||||
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
||||||
|
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
|
||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
LIBS="$PTHREAD_LIBS $LIBS"
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
||||||
|
@ -123,10 +129,12 @@ fi
|
||||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||||
# libraries is broken (non-POSIX).
|
# libraries is broken (non-POSIX).
|
||||||
|
|
||||||
# Create a list of thread flags to try. Items starting with a "-" are
|
# Create a list of thread flags to try. Items with a "," contain both
|
||||||
# C compiler flags, and other items are library names, except for "none"
|
# C compiler flags (before ",") and linker flags (after ","). Other items
|
||||||
# which indicates that we try without any flags at all, and "pthread-config"
|
# starting with a "-" are C compiler flags, and remaining items are
|
||||||
# which is a program returning the flags for the Pth emulation library.
|
# library names, except for "none" which indicates that we try without
|
||||||
|
# any flags at all, and "pthread-config" which is a program returning
|
||||||
|
# the flags for the Pth emulation library.
|
||||||
|
|
||||||
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||||
|
|
||||||
|
@ -194,14 +202,47 @@ case $host_os in
|
||||||
# that too in a future libc.) So we'll check first for the
|
# that too in a future libc.) So we'll check first for the
|
||||||
# standard Solaris way of linking pthreads (-mt -lpthread).
|
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||||
|
|
||||||
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
|
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Are we compiling with Clang?
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([whether $CC is Clang],
|
||||||
|
[ax_cv_PTHREAD_CLANG],
|
||||||
|
[ax_cv_PTHREAD_CLANG=no
|
||||||
|
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||||
|
if test "x$GCC" = "xyes"; then
|
||||||
|
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||||
|
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||||
|
# if defined(__clang__) && defined(__llvm__)
|
||||||
|
AX_PTHREAD_CC_IS_CLANG
|
||||||
|
# endif
|
||||||
|
],
|
||||||
|
[ax_cv_PTHREAD_CLANG=yes])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||||
|
|
||||||
|
|
||||||
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||||
|
|
||||||
|
# Note that for GCC and Clang -pthread generally implies -lpthread,
|
||||||
|
# except when -nostdlib is passed.
|
||||||
|
# This is problematic using libtool to build C++ shared libraries with pthread:
|
||||||
|
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
|
||||||
|
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
|
||||||
|
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
|
||||||
|
# To solve this, first try -pthread together with -lpthread for GCC
|
||||||
|
|
||||||
AS_IF([test "x$GCC" = "xyes"],
|
AS_IF([test "x$GCC" = "xyes"],
|
||||||
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
|
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
|
||||||
|
|
||||||
|
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
|
||||||
|
|
||||||
|
AS_IF([test "x$ax_pthread_clang" = "xyes"],
|
||||||
|
[ax_pthread_flags="-pthread,-lpthread -pthread"])
|
||||||
|
|
||||||
|
|
||||||
# The presence of a feature test macro requesting re-entrant function
|
# The presence of a feature test macro requesting re-entrant function
|
||||||
# definitions is, on some systems, a strong hint that pthreads support is
|
# definitions is, on some systems, a strong hint that pthreads support is
|
||||||
|
@ -224,101 +265,6 @@ AS_IF([test "x$ax_pthread_check_macro" = "x--"],
|
||||||
[ax_pthread_check_cond=0],
|
[ax_pthread_check_cond=0],
|
||||||
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
||||||
|
|
||||||
# Are we compiling with Clang?
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([whether $CC is Clang],
|
|
||||||
[ax_cv_PTHREAD_CLANG],
|
|
||||||
[ax_cv_PTHREAD_CLANG=no
|
|
||||||
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
|
||||||
if test "x$GCC" = "xyes"; then
|
|
||||||
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
|
||||||
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
|
||||||
# if defined(__clang__) && defined(__llvm__)
|
|
||||||
AX_PTHREAD_CC_IS_CLANG
|
|
||||||
# endif
|
|
||||||
],
|
|
||||||
[ax_cv_PTHREAD_CLANG=yes])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
|
||||||
|
|
||||||
ax_pthread_clang_warning=no
|
|
||||||
|
|
||||||
# Clang needs special handling, because older versions handle the -pthread
|
|
||||||
# option in a rather... idiosyncratic way
|
|
||||||
|
|
||||||
if test "x$ax_pthread_clang" = "xyes"; then
|
|
||||||
|
|
||||||
# Clang takes -pthread; it has never supported any other flag
|
|
||||||
|
|
||||||
# (Note 1: This will need to be revisited if a system that Clang
|
|
||||||
# supports has POSIX threads in a separate library. This tends not
|
|
||||||
# to be the way of modern systems, but it's conceivable.)
|
|
||||||
|
|
||||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
|
||||||
# to get POSIX threads support; the API is always present and
|
|
||||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
|
||||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
|
||||||
# ignore this macro, third-party headers might not.)
|
|
||||||
|
|
||||||
PTHREAD_CFLAGS="-pthread"
|
|
||||||
PTHREAD_LIBS=
|
|
||||||
|
|
||||||
ax_pthread_ok=yes
|
|
||||||
|
|
||||||
# However, older versions of Clang make a point of warning the user
|
|
||||||
# that, in an invocation where only linking and no compilation is
|
|
||||||
# taking place, the -pthread option has no effect ("argument unused
|
|
||||||
# during compilation"). They expect -pthread to be passed in only
|
|
||||||
# when source code is being compiled.
|
|
||||||
#
|
|
||||||
# Problem is, this is at odds with the way Automake and most other
|
|
||||||
# C build frameworks function, which is that the same flags used in
|
|
||||||
# compilation (CFLAGS) are also used in linking. Many systems
|
|
||||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
|
||||||
# support, and in fact it is often not straightforward to specify a
|
|
||||||
# flag that is used only in the compilation phase and not in
|
|
||||||
# linking. Such a scenario is extremely rare in practice.
|
|
||||||
#
|
|
||||||
# Even though use of the -pthread flag in linking would only print
|
|
||||||
# a warning, this can be a nuisance for well-run software projects
|
|
||||||
# that build with -Werror. So if the active version of Clang has
|
|
||||||
# this misfeature, we search for an option to squash it.
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
|
||||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
|
||||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
|
||||||
# Create an alternate version of $ac_link that compiles and
|
|
||||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
|
||||||
# (.c -> exe), because the warning occurs only in the second
|
|
||||||
# step
|
|
||||||
ax_pthread_save_ac_link="$ac_link"
|
|
||||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
|
||||||
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
|
|
||||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
|
||||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
|
||||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
|
||||||
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
|
||||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
|
||||||
ac_link="$ax_pthread_save_ac_link"
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
|
||||||
[ac_link="$ax_pthread_2step_ac_link"
|
|
||||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
|
||||||
[break])
|
|
||||||
])
|
|
||||||
done
|
|
||||||
ac_link="$ax_pthread_save_ac_link"
|
|
||||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
|
||||||
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
|
||||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
|
||||||
])
|
|
||||||
|
|
||||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
|
||||||
no | unknown) ;;
|
|
||||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
fi # $ax_pthread_clang = yes
|
|
||||||
|
|
||||||
if test "x$ax_pthread_ok" = "xno"; then
|
if test "x$ax_pthread_ok" = "xno"; then
|
||||||
for ax_pthread_try_flag in $ax_pthread_flags; do
|
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
|
@ -328,10 +274,10 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-mt,pthread)
|
*,*)
|
||||||
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
|
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
|
||||||
PTHREAD_CFLAGS="-mt"
|
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
|
||||||
PTHREAD_LIBS="-lpthread"
|
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
|
@ -371,7 +317,13 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
# if $ax_pthread_check_cond
|
# if $ax_pthread_check_cond
|
||||||
# error "$ax_pthread_check_macro must be defined"
|
# error "$ax_pthread_check_macro must be defined"
|
||||||
# endif
|
# endif
|
||||||
static void routine(void *a) { a = 0; }
|
static void *some_global = NULL;
|
||||||
|
static void routine(void *a)
|
||||||
|
{
|
||||||
|
/* To avoid any unused-parameter or
|
||||||
|
unused-but-set-parameter warning. */
|
||||||
|
some_global = a;
|
||||||
|
}
|
||||||
static void *start_routine(void *a) { return a; }],
|
static void *start_routine(void *a) { return a; }],
|
||||||
[pthread_t th; pthread_attr_t attr;
|
[pthread_t th; pthread_attr_t attr;
|
||||||
pthread_create(&th, 0, start_routine, 0);
|
pthread_create(&th, 0, start_routine, 0);
|
||||||
|
@ -393,6 +345,80 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Clang needs special handling, because older versions handle the -pthread
|
||||||
|
# option in a rather... idiosyncratic way
|
||||||
|
|
||||||
|
if test "x$ax_pthread_clang" = "xyes"; then
|
||||||
|
|
||||||
|
# Clang takes -pthread; it has never supported any other flag
|
||||||
|
|
||||||
|
# (Note 1: This will need to be revisited if a system that Clang
|
||||||
|
# supports has POSIX threads in a separate library. This tends not
|
||||||
|
# to be the way of modern systems, but it's conceivable.)
|
||||||
|
|
||||||
|
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||||
|
# to get POSIX threads support; the API is always present and
|
||||||
|
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||||
|
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||||
|
# ignore this macro, third-party headers might not.)
|
||||||
|
|
||||||
|
# However, older versions of Clang make a point of warning the user
|
||||||
|
# that, in an invocation where only linking and no compilation is
|
||||||
|
# taking place, the -pthread option has no effect ("argument unused
|
||||||
|
# during compilation"). They expect -pthread to be passed in only
|
||||||
|
# when source code is being compiled.
|
||||||
|
#
|
||||||
|
# Problem is, this is at odds with the way Automake and most other
|
||||||
|
# C build frameworks function, which is that the same flags used in
|
||||||
|
# compilation (CFLAGS) are also used in linking. Many systems
|
||||||
|
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||||
|
# support, and in fact it is often not straightforward to specify a
|
||||||
|
# flag that is used only in the compilation phase and not in
|
||||||
|
# linking. Such a scenario is extremely rare in practice.
|
||||||
|
#
|
||||||
|
# Even though use of the -pthread flag in linking would only print
|
||||||
|
# a warning, this can be a nuisance for well-run software projects
|
||||||
|
# that build with -Werror. So if the active version of Clang has
|
||||||
|
# this misfeature, we search for an option to squash it.
|
||||||
|
|
||||||
|
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||||
|
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||||
|
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||||
|
# Create an alternate version of $ac_link that compiles and
|
||||||
|
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||||
|
# (.c -> exe), because the warning occurs only in the second
|
||||||
|
# step
|
||||||
|
ax_pthread_save_ac_link="$ac_link"
|
||||||
|
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||||
|
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
|
||||||
|
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||||
|
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||||
|
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||||
|
[ac_link="$ax_pthread_2step_ac_link"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||||
|
[break])
|
||||||
|
])
|
||||||
|
done
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||||
|
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||||
|
])
|
||||||
|
|
||||||
|
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||||
|
no | unknown) ;;
|
||||||
|
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi # $ax_pthread_clang = yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Various other checks:
|
# Various other checks:
|
||||||
if test "x$ax_pthread_ok" = "xyes"; then
|
if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
@ -438,7 +464,8 @@ if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||||
[ax_cv_PTHREAD_PRIO_INHERIT],
|
[ax_cv_PTHREAD_PRIO_INHERIT],
|
||||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
[[int i = PTHREAD_PRIO_INHERIT;
|
||||||
|
return i;]])],
|
||||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||||
])
|
])
|
||||||
|
@ -460,18 +487,28 @@ if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
[#handle absolute path differently from PATH based program lookup
|
[#handle absolute path differently from PATH based program lookup
|
||||||
AS_CASE(["x$CC"],
|
AS_CASE(["x$CC"],
|
||||||
[x/*],
|
[x/*],
|
||||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
[
|
||||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
|
||||||
|
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
|
||||||
|
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
])
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||||
|
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||||
|
|
||||||
AC_SUBST([PTHREAD_LIBS])
|
AC_SUBST([PTHREAD_LIBS])
|
||||||
AC_SUBST([PTHREAD_CFLAGS])
|
AC_SUBST([PTHREAD_CFLAGS])
|
||||||
AC_SUBST([PTHREAD_CC])
|
AC_SUBST([PTHREAD_CC])
|
||||||
|
AC_SUBST([PTHREAD_CXX])
|
||||||
|
|
||||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||||
if test "x$ax_pthread_ok" = "xyes"; then
|
if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
|
|
|
@ -1200,6 +1200,7 @@ NOISY_BUILD
|
||||||
PBX_NO_BINARY_MODULES
|
PBX_NO_BINARY_MODULES
|
||||||
PTHREAD_CFLAGS
|
PTHREAD_CFLAGS
|
||||||
PTHREAD_LIBS
|
PTHREAD_LIBS
|
||||||
|
PTHREAD_CXX
|
||||||
PTHREAD_CC
|
PTHREAD_CC
|
||||||
ax_pthread_config
|
ax_pthread_config
|
||||||
MD5
|
MD5
|
||||||
|
@ -8324,6 +8325,9 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||||
ax_pthread_save_LIBS="$LIBS"
|
ax_pthread_save_LIBS="$LIBS"
|
||||||
if test "x$PTHREAD_CC" != "x"; then :
|
if test "x$PTHREAD_CC" != "x"; then :
|
||||||
CC="$PTHREAD_CC"
|
CC="$PTHREAD_CC"
|
||||||
|
fi
|
||||||
|
if test "x$PTHREAD_CXX" != "x"; then :
|
||||||
|
CXX="$PTHREAD_CXX"
|
||||||
fi
|
fi
|
||||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||||
LIBS="$PTHREAD_LIBS $LIBS"
|
LIBS="$PTHREAD_LIBS $LIBS"
|
||||||
|
@ -8368,10 +8372,12 @@ fi
|
||||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||||
# libraries is broken (non-POSIX).
|
# libraries is broken (non-POSIX).
|
||||||
|
|
||||||
# Create a list of thread flags to try. Items starting with a "-" are
|
# Create a list of thread flags to try. Items with a "," contain both
|
||||||
# C compiler flags, and other items are library names, except for "none"
|
# C compiler flags (before ",") and linker flags (after ","). Other items
|
||||||
# which indicates that we try without any flags at all, and "pthread-config"
|
# starting with a "-" are C compiler flags, and remaining items are
|
||||||
# which is a program returning the flags for the Pth emulation library.
|
# library names, except for "none" which indicates that we try without
|
||||||
|
# any flags at all, and "pthread-config" which is a program returning
|
||||||
|
# the flags for the Pth emulation library.
|
||||||
|
|
||||||
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||||
|
|
||||||
|
@ -8447,39 +8453,10 @@ rm -f conftest*
|
||||||
# that too in a future libc.) So we'll check first for the
|
# that too in a future libc.) So we'll check first for the
|
||||||
# standard Solaris way of linking pthreads (-mt -lpthread).
|
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||||
|
|
||||||
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
|
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
|
||||||
|
|
||||||
if test "x$GCC" = "xyes"; then :
|
|
||||||
ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# The presence of a feature test macro requesting re-entrant function
|
|
||||||
# definitions is, on some systems, a strong hint that pthreads support is
|
|
||||||
# correctly enabled
|
|
||||||
|
|
||||||
case $host_os in
|
|
||||||
darwin* | hpux* | linux* | osf* | solaris*)
|
|
||||||
ax_pthread_check_macro="_REENTRANT"
|
|
||||||
;;
|
|
||||||
|
|
||||||
aix*)
|
|
||||||
ax_pthread_check_macro="_THREAD_SAFE"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
ax_pthread_check_macro="--"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
if test "x$ax_pthread_check_macro" = "x--"; then :
|
|
||||||
ax_pthread_check_cond=0
|
|
||||||
else
|
|
||||||
ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Are we compiling with Clang?
|
# Are we compiling with Clang?
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
|
||||||
|
@ -8511,107 +8488,51 @@ fi
|
||||||
$as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
|
$as_echo "$ax_cv_PTHREAD_CLANG" >&6; }
|
||||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||||
|
|
||||||
ax_pthread_clang_warning=no
|
|
||||||
|
|
||||||
# Clang needs special handling, because older versions handle the -pthread
|
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||||
# option in a rather... idiosyncratic way
|
|
||||||
|
|
||||||
if test "x$ax_pthread_clang" = "xyes"; then
|
# Note that for GCC and Clang -pthread generally implies -lpthread,
|
||||||
|
# except when -nostdlib is passed.
|
||||||
|
# This is problematic using libtool to build C++ shared libraries with pthread:
|
||||||
|
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
|
||||||
|
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
|
||||||
|
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
|
||||||
|
# To solve this, first try -pthread together with -lpthread for GCC
|
||||||
|
|
||||||
# Clang takes -pthread; it has never supported any other flag
|
if test "x$GCC" = "xyes"; then :
|
||||||
|
ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"
|
||||||
|
fi
|
||||||
|
|
||||||
# (Note 1: This will need to be revisited if a system that Clang
|
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
|
||||||
# supports has POSIX threads in a separate library. This tends not
|
|
||||||
# to be the way of modern systems, but it's conceivable.)
|
|
||||||
|
|
||||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
if test "x$ax_pthread_clang" = "xyes"; then :
|
||||||
# to get POSIX threads support; the API is always present and
|
ax_pthread_flags="-pthread,-lpthread -pthread"
|
||||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
fi
|
||||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
|
||||||
# ignore this macro, third-party headers might not.)
|
|
||||||
|
|
||||||
PTHREAD_CFLAGS="-pthread"
|
|
||||||
PTHREAD_LIBS=
|
|
||||||
|
|
||||||
ax_pthread_ok=yes
|
# The presence of a feature test macro requesting re-entrant function
|
||||||
|
# definitions is, on some systems, a strong hint that pthreads support is
|
||||||
|
# correctly enabled
|
||||||
|
|
||||||
# However, older versions of Clang make a point of warning the user
|
case $host_os in
|
||||||
# that, in an invocation where only linking and no compilation is
|
darwin* | hpux* | linux* | osf* | solaris*)
|
||||||
# taking place, the -pthread option has no effect ("argument unused
|
ax_pthread_check_macro="_REENTRANT"
|
||||||
# during compilation"). They expect -pthread to be passed in only
|
;;
|
||||||
# when source code is being compiled.
|
|
||||||
#
|
|
||||||
# Problem is, this is at odds with the way Automake and most other
|
|
||||||
# C build frameworks function, which is that the same flags used in
|
|
||||||
# compilation (CFLAGS) are also used in linking. Many systems
|
|
||||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
|
||||||
# support, and in fact it is often not straightforward to specify a
|
|
||||||
# flag that is used only in the compilation phase and not in
|
|
||||||
# linking. Such a scenario is extremely rare in practice.
|
|
||||||
#
|
|
||||||
# Even though use of the -pthread flag in linking would only print
|
|
||||||
# a warning, this can be a nuisance for well-run software projects
|
|
||||||
# that build with -Werror. So if the active version of Clang has
|
|
||||||
# this misfeature, we search for an option to squash it.
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
|
aix*)
|
||||||
$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
|
ax_pthread_check_macro="_THREAD_SAFE"
|
||||||
if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
|
;;
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
|
*)
|
||||||
|
ax_pthread_check_macro="--"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if test "x$ax_pthread_check_macro" = "x--"; then :
|
||||||
|
ax_pthread_check_cond=0
|
||||||
else
|
else
|
||||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
|
||||||
# Create an alternate version of $ac_link that compiles and
|
|
||||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
|
||||||
# (.c -> exe), because the warning occurs only in the second
|
|
||||||
# step
|
|
||||||
ax_pthread_save_ac_link="$ac_link"
|
|
||||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
|
||||||
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
|
|
||||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
|
||||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
|
||||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
|
||||||
if test "x$ax_pthread_try" = "xunknown"; then :
|
|
||||||
break
|
|
||||||
fi
|
fi
|
||||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
|
||||||
ac_link="$ax_pthread_save_ac_link"
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
int main(void){return 0;}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_link "$LINENO"; then :
|
|
||||||
ac_link="$ax_pthread_2step_ac_link"
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
int main(void){return 0;}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_link "$LINENO"; then :
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
done
|
|
||||||
ac_link="$ax_pthread_save_ac_link"
|
|
||||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
|
||||||
if test "x$ax_pthread_try" = "x"; then :
|
|
||||||
ax_pthread_try=no
|
|
||||||
fi
|
|
||||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
|
||||||
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
|
|
||||||
$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
|
|
||||||
|
|
||||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
|
||||||
no | unknown) ;;
|
|
||||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
fi # $ax_pthread_clang = yes
|
|
||||||
|
|
||||||
if test "x$ax_pthread_ok" = "xno"; then
|
if test "x$ax_pthread_ok" = "xno"; then
|
||||||
for ax_pthread_try_flag in $ax_pthread_flags; do
|
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
|
@ -8622,11 +8543,11 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||||
$as_echo_n "checking whether pthreads work without any flags... " >&6; }
|
$as_echo_n "checking whether pthreads work without any flags... " >&6; }
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-mt,pthread)
|
*,*)
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5
|
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
|
||||||
$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; }
|
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
|
||||||
PTHREAD_CFLAGS="-mt"
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5
|
||||||
PTHREAD_LIBS="-lpthread"
|
$as_echo_n "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; }
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
|
@ -8709,7 +8630,13 @@ $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; }
|
||||||
# if $ax_pthread_check_cond
|
# if $ax_pthread_check_cond
|
||||||
# error "$ax_pthread_check_macro must be defined"
|
# error "$ax_pthread_check_macro must be defined"
|
||||||
# endif
|
# endif
|
||||||
static void routine(void *a) { a = 0; }
|
static void *some_global = NULL;
|
||||||
|
static void routine(void *a)
|
||||||
|
{
|
||||||
|
/* To avoid any unused-parameter or
|
||||||
|
unused-but-set-parameter warning. */
|
||||||
|
some_global = a;
|
||||||
|
}
|
||||||
static void *start_routine(void *a) { return a; }
|
static void *start_routine(void *a) { return a; }
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
|
@ -8744,6 +8671,104 @@ fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Clang needs special handling, because older versions handle the -pthread
|
||||||
|
# option in a rather... idiosyncratic way
|
||||||
|
|
||||||
|
if test "x$ax_pthread_clang" = "xyes"; then
|
||||||
|
|
||||||
|
# Clang takes -pthread; it has never supported any other flag
|
||||||
|
|
||||||
|
# (Note 1: This will need to be revisited if a system that Clang
|
||||||
|
# supports has POSIX threads in a separate library. This tends not
|
||||||
|
# to be the way of modern systems, but it's conceivable.)
|
||||||
|
|
||||||
|
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||||
|
# to get POSIX threads support; the API is always present and
|
||||||
|
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||||
|
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||||
|
# ignore this macro, third-party headers might not.)
|
||||||
|
|
||||||
|
# However, older versions of Clang make a point of warning the user
|
||||||
|
# that, in an invocation where only linking and no compilation is
|
||||||
|
# taking place, the -pthread option has no effect ("argument unused
|
||||||
|
# during compilation"). They expect -pthread to be passed in only
|
||||||
|
# when source code is being compiled.
|
||||||
|
#
|
||||||
|
# Problem is, this is at odds with the way Automake and most other
|
||||||
|
# C build frameworks function, which is that the same flags used in
|
||||||
|
# compilation (CFLAGS) are also used in linking. Many systems
|
||||||
|
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||||
|
# support, and in fact it is often not straightforward to specify a
|
||||||
|
# flag that is used only in the compilation phase and not in
|
||||||
|
# linking. Such a scenario is extremely rare in practice.
|
||||||
|
#
|
||||||
|
# Even though use of the -pthread flag in linking would only print
|
||||||
|
# a warning, this can be a nuisance for well-run software projects
|
||||||
|
# that build with -Werror. So if the active version of Clang has
|
||||||
|
# this misfeature, we search for an option to squash it.
|
||||||
|
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5
|
||||||
|
$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
|
||||||
|
if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||||
|
# Create an alternate version of $ac_link that compiles and
|
||||||
|
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||||
|
# (.c -> exe), because the warning occurs only in the second
|
||||||
|
# step
|
||||||
|
ax_pthread_save_ac_link="$ac_link"
|
||||||
|
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||||
|
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
|
||||||
|
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||||
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||||
|
if test "x$ax_pthread_try" = "xunknown"; then :
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
int main(void){return 0;}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_link="$ax_pthread_2step_ac_link"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
int main(void){return 0;}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
done
|
||||||
|
ac_link="$ax_pthread_save_ac_link"
|
||||||
|
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||||
|
if test "x$ax_pthread_try" = "x"; then :
|
||||||
|
ax_pthread_try=no
|
||||||
|
fi
|
||||||
|
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||||
|
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
|
||||||
|
$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
|
||||||
|
|
||||||
|
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||||
|
no | unknown) ;;
|
||||||
|
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi # $ax_pthread_clang = yes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Various other checks:
|
# Various other checks:
|
||||||
if test "x$ax_pthread_ok" = "xyes"; then
|
if test "x$ax_pthread_ok" = "xyes"; then
|
||||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||||
|
@ -8825,6 +8850,7 @@ int
|
||||||
main ()
|
main ()
|
||||||
{
|
{
|
||||||
int i = PTHREAD_PRIO_INHERIT;
|
int i = PTHREAD_PRIO_INHERIT;
|
||||||
|
return i;
|
||||||
;
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -8861,11 +8887,19 @@ fi
|
||||||
#handle absolute path differently from PATH based program lookup
|
#handle absolute path differently from PATH based program lookup
|
||||||
case "x$CC" in #(
|
case "x$CC" in #(
|
||||||
x/*) :
|
x/*) :
|
||||||
if as_fn_executable_p ${CC}_r; then :
|
|
||||||
|
if as_fn_executable_p ${CC}_r; then :
|
||||||
PTHREAD_CC="${CC}_r"
|
PTHREAD_CC="${CC}_r"
|
||||||
fi ;; #(
|
fi
|
||||||
|
if test "x${CXX}" != "x"; then :
|
||||||
|
if as_fn_executable_p ${CXX}_r; then :
|
||||||
|
PTHREAD_CXX="${CXX}_r"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;; #(
|
||||||
*) :
|
*) :
|
||||||
for ac_prog in ${CC}_r
|
|
||||||
|
for ac_prog in ${CC}_r
|
||||||
do
|
do
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
set dummy $ac_prog; ac_word=$2
|
set dummy $ac_prog; ac_word=$2
|
||||||
|
@ -8907,8 +8941,56 @@ fi
|
||||||
test -n "$PTHREAD_CC" && break
|
test -n "$PTHREAD_CC" && break
|
||||||
done
|
done
|
||||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||||
;;
|
|
||||||
esac ;; #(
|
if test "x${CXX}" != "x"; then :
|
||||||
|
for ac_prog in ${CXX}_r
|
||||||
|
do
|
||||||
|
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||||
|
set dummy $ac_prog; ac_word=$2
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||||
|
$as_echo_n "checking for $ac_word... " >&6; }
|
||||||
|
if ${ac_cv_prog_PTHREAD_CXX+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
if test -n "$PTHREAD_CXX"; then
|
||||||
|
ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test.
|
||||||
|
else
|
||||||
|
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||||
|
for as_dir in $PATH
|
||||||
|
do
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
test -z "$as_dir" && as_dir=.
|
||||||
|
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||||
|
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||||
|
ac_cv_prog_PTHREAD_CXX="$ac_prog"
|
||||||
|
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
IFS=$as_save_IFS
|
||||||
|
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX
|
||||||
|
if test -n "$PTHREAD_CXX"; then
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5
|
||||||
|
$as_echo "$PTHREAD_CXX" >&6; }
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
|
$as_echo "no" >&6; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
test -n "$PTHREAD_CXX" && break
|
||||||
|
done
|
||||||
|
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;; #(
|
||||||
*) :
|
*) :
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -8918,6 +9000,8 @@ esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||||
|
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -15789,41 +15873,6 @@ cat >>confdefs.h <<_ACEOF
|
||||||
_ACEOF
|
_ACEOF
|
||||||
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
|
|
||||||
$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
|
|
||||||
if ${ac_cv_header_time+:} false; then :
|
|
||||||
$as_echo_n "(cached) " >&6
|
|
||||||
else
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main ()
|
|
||||||
{
|
|
||||||
if ((struct tm *) 0)
|
|
||||||
return 0;
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_compile "$LINENO"; then :
|
|
||||||
ac_cv_header_time=yes
|
|
||||||
else
|
|
||||||
ac_cv_header_time=no
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
|
|
||||||
$as_echo "$ac_cv_header_time" >&6; }
|
|
||||||
if test $ac_cv_header_time = yes; then
|
|
||||||
|
|
||||||
$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5
|
||||||
|
|
|
@ -24,7 +24,7 @@ AC_SUBST(CONFIG_CFLAGS)
|
||||||
AC_SUBST(CONFIG_LDFLAGS)
|
AC_SUBST(CONFIG_LDFLAGS)
|
||||||
|
|
||||||
# specify output header file
|
# specify output header file
|
||||||
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
|
AC_CONFIG_HEADERS([include/asterisk/autoconfig.h])
|
||||||
|
|
||||||
# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
|
# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
|
||||||
# other macro that uses the C compiler, or the default order will be used.
|
# other macro that uses the C compiler, or the default order will be used.
|
||||||
|
@ -809,7 +809,6 @@ AC_CHECK_MEMBERS([struct stat.st_blksize])
|
||||||
AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
|
AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
|
||||||
#include <sys/socket.h> ])
|
#include <sys/socket.h> ])
|
||||||
AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
|
AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
|
||||||
AC_HEADER_TIME
|
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
AC_C_VOLATILE
|
AC_C_VOLATILE
|
||||||
AC_CHECK_TYPES([ptrdiff_t])
|
AC_CHECK_TYPES([ptrdiff_t])
|
||||||
|
|
|
@ -1407,9 +1407,6 @@
|
||||||
/* Define to 1 if you have the ANSI C header files. */
|
/* Define to 1 if you have the ANSI C header files. */
|
||||||
#undef STDC_HEADERS
|
#undef STDC_HEADERS
|
||||||
|
|
||||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#undef TIME_WITH_SYS_TIME
|
|
||||||
|
|
||||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||||
#undef TM_IN_SYS_TIME
|
#undef TM_IN_SYS_TIME
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ AC_INIT(menuselect, MENUSELECT_VERSION, www.asterisk.org)
|
||||||
AC_CONFIG_SRCDIR([menuselect.c])
|
AC_CONFIG_SRCDIR([menuselect.c])
|
||||||
|
|
||||||
# specify output header file
|
# specify output header file
|
||||||
AC_CONFIG_HEADER(autoconfig.h)
|
AC_CONFIG_HEADERS([autoconfig.h])
|
||||||
|
|
||||||
AC_COPYRIGHT("Menuselect")
|
AC_COPYRIGHT("Menuselect")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue