Commit df807089 authored by Peter W. Draper's avatar Peter W. Draper
Browse files

Update ACX_MPI and ACX_PTHREAD macros to latest versions

These are now AX_


Former-commit-id: 8cad87bc27c45d1695b38f1a8db248333f1bb97f
parent 035a27f7
...@@ -50,9 +50,9 @@ AC_ARG_ENABLE([mpi], ...@@ -50,9 +50,9 @@ AC_ARG_ENABLE([mpi],
[AS_HELP_STRING([--enable-mpi],[compile with functionality for distributed-memory parallelim using MPI @<:@default=yes@:>@])], [AS_HELP_STRING([--enable-mpi],[compile with functionality for distributed-memory parallelim using MPI @<:@default=yes@:>@])],
[if test "x$enable_mpi" != "xno" [if test "x$enable_mpi" != "xno"
then then
ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ]) AX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])
fi], fi],
[ACX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])]) [AX_MPI([ CC="$MPICC" AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.]) ])])
AM_CONDITIONAL([HAVEMPI],[test -n "$MPICC"]) AM_CONDITIONAL([HAVEMPI],[test -n "$MPICC"])
# Need C99 and inline support. # Need C99 and inline support.
...@@ -119,7 +119,7 @@ AC_HEADER_STDC ...@@ -119,7 +119,7 @@ AC_HEADER_STDC
AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!)) AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))
# Check for pthreads. # Check for pthreads.
ACX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC" LDFLAGS="$PTHREAD_LIBS $LIBS"], CC="$PTHREAD_CC" LDFLAGS="$PTHREAD_LIBS $LIBS"],
AC_MSG_ERROR([Could not find a working version of AC_MSG_ERROR([Could not find a working version of
the pthread library. Make sure you have the library and header files installed the pthread library. Make sure you have the library and header files installed
......
# =========================================================================== # ===========================================================================
# http://autoconf-archive.cryp.to/acx_mpi.html # http://www.gnu.org/software/autoconf-archive/ax_mpi.html
# =========================================================================== # ===========================================================================
# #
# SYNOPSIS # SYNOPSIS
# #
# ACX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # AX_MPI([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
# #
# DESCRIPTION # DESCRIPTION
# #
...@@ -19,17 +19,13 @@ ...@@ -19,17 +19,13 @@
# are needed for linking MPI (e.g. -lmpi or -lfmpi, if a special # are needed for linking MPI (e.g. -lmpi or -lfmpi, if a special
# MPICC/MPICXX/MPIF77/MPIFC was not found). # MPICC/MPICXX/MPIF77/MPIFC was not found).
# #
# If you want to compile everything with MPI, you should set: # Note that this macro should be used only if you just have a few source
# # files that need to be compiled using MPI. In particular, you should
# CC="MPICC" #OR# CXX="MPICXX" #OR# F77="MPIF77" #OR# FC="MPIFC" # neither overwrite CC/CXX/F77/FC with the values of
# LIBS="$MPILIBS $LIBS" # MPICC/MPICXX/MPIF77/MPIFC, nor assume that you can use the same flags
# # etc. as the standard compilers. If you want to compile a whole program
# NOTE: The above assumes that you will use $CC (or whatever) for linking # using the MPI compiler commands, use one of the macros
# as well as for compiling. (This is the default for automake and most # AX_PROG_{CC,CXX,FC}_MPI.
# Makefiles.)
#
# The user can force a particular library/compiler by setting the
# MPICC/MPICXX/MPIF77/MPIFC and/or MPILIBS environment variables.
# #
# ACTION-IF-FOUND is a list of shell commands to run if an MPI library is # ACTION-IF-FOUND is a list of shell commands to run if an MPI library is
# found, and ACTION-IF-NOT-FOUND is a list of commands to run if it is not # found, and ACTION-IF-NOT-FOUND is a list of commands to run if it is not
...@@ -67,14 +63,17 @@ ...@@ -67,14 +63,17 @@
# 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.
AC_DEFUN([ACX_MPI], [ #serial 8
AU_ALIAS([ACX_MPI], [AX_MPI])
AC_DEFUN([AX_MPI], [
AC_PREREQ(2.50) dnl for AC_LANG_CASE AC_PREREQ(2.50) dnl for AC_LANG_CASE
AC_LANG_CASE([C], [ AC_LANG_CASE([C], [
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
AC_ARG_VAR(MPICC,[MPI C compiler command]) AC_ARG_VAR(MPICC,[MPI C compiler command])
AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC) AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC)
acx_mpi_save_CC="$CC" ax_mpi_save_CC="$CC"
CC="$MPICC" CC="$MPICC"
AC_SUBST(MPICC) AC_SUBST(MPICC)
], ],
...@@ -82,7 +81,7 @@ AC_LANG_CASE([C], [ ...@@ -82,7 +81,7 @@ AC_LANG_CASE([C], [
AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_CXX])
AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) AC_ARG_VAR(MPICXX,[MPI C++ compiler command])
AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX) AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX)
acx_mpi_save_CXX="$CXX" ax_mpi_save_CXX="$CXX"
CXX="$MPICXX" CXX="$MPICXX"
AC_SUBST(MPICXX) AC_SUBST(MPICXX)
], ],
...@@ -90,7 +89,7 @@ AC_LANG_CASE([C], [ ...@@ -90,7 +89,7 @@ AC_LANG_CASE([C], [
AC_REQUIRE([AC_PROG_F77]) AC_REQUIRE([AC_PROG_F77])
AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command]) AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command])
AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77) AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77)
acx_mpi_save_F77="$F77" ax_mpi_save_F77="$F77"
F77="$MPIF77" F77="$MPIF77"
AC_SUBST(MPIF77) AC_SUBST(MPIF77)
], ],
...@@ -98,7 +97,7 @@ AC_LANG_CASE([C], [ ...@@ -98,7 +97,7 @@ AC_LANG_CASE([C], [
AC_REQUIRE([AC_PROG_FC]) AC_REQUIRE([AC_PROG_FC])
AC_ARG_VAR(MPIFC,[MPI Fortran compiler command]) AC_ARG_VAR(MPIFC,[MPI Fortran compiler command])
AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC) AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC)
acx_mpi_save_FC="$FC" ax_mpi_save_FC="$FC"
FC="$MPIFC" FC="$MPIFC"
AC_SUBST(MPIFC) AC_SUBST(MPIFC)
]) ])
...@@ -159,10 +158,10 @@ fi], ...@@ -159,10 +158,10 @@ fi],
AC_MSG_RESULT(no)]) AC_MSG_RESULT(no)])
fi]) fi])
AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], AC_LANG_CASE([C], [CC="$ax_mpi_save_CC"],
[C++], [CXX="$acx_mpi_save_CXX"], [C++], [CXX="$ax_mpi_save_CXX"],
[Fortran 77], [F77="$acx_mpi_save_F77"], [Fortran 77], [F77="$ax_mpi_save_F77"],
[Fortran], [FC="$acx_mpi_save_FC"]) [Fortran], [FC="$ax_mpi_save_FC"])
AC_SUBST(MPILIBS) AC_SUBST(MPILIBS)
...@@ -174,4 +173,4 @@ else ...@@ -174,4 +173,4 @@ else
ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1])
: :
fi fi
])dnl ACX_MPI ])dnl AX_MPI
# =========================================================================== # ===========================================================================
# http://autoconf-archive.cryp.to/acx_pthread.html # http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# =========================================================================== # ===========================================================================
# #
# SYNOPSIS # SYNOPSIS
# #
# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
# #
# DESCRIPTION # DESCRIPTION
# #
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
# #
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library # ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action # is not found. If ACTION-IF-FOUND is not specified, the default action
...@@ -45,9 +49,12 @@ ...@@ -45,9 +49,12 @@
# Alejandro Forero Cuervo to the autoconf macro repository. We are also # Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users. # grateful for the helpful feedback of numerous users.
# #
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE # LICENSE
# #
# 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>
# #
# 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
...@@ -75,11 +82,13 @@ ...@@ -75,11 +82,13 @@
# 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.
AC_DEFUN([ACX_PTHREAD], [ #serial 21
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE AC_LANG_PUSH([C])
AC_LANG_C ax_pthread_ok=no
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h # We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent). # requires special compiler flags (e.g. on True64 or Sequent).
...@@ -94,9 +103,9 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then ...@@ -94,9 +103,9 @@ if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_LIBS="$LIBS" save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
AC_MSG_RESULT($acx_pthread_ok) AC_MSG_RESULT([$ax_pthread_ok])
if test x"$acx_pthread_ok" = xno; then if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS="" PTHREAD_LIBS=""
PTHREAD_CFLAGS="" PTHREAD_CFLAGS=""
fi fi
...@@ -114,7 +123,7 @@ fi ...@@ -114,7 +123,7 @@ fi
# which indicates that we try without any flags at all, and "pthread-config" # 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. # which is a program returning the flags for the Pth emulation library.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the # The ordering *is* (sometimes) important. Some notes on the
# individual items follow: # individual items follow:
...@@ -136,8 +145,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m ...@@ -136,8 +145,8 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m
# --thread-safe: KAI C++ # --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library) # pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in case ${host_os} in
*solaris*) solaris*)
# On Solaris (at least, for some versions), libc contains stubbed # On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based # (non-functional) versions of the pthreads routines, so link-based
...@@ -147,12 +156,30 @@ case "${host_cpu}-${host_os}" in ...@@ -147,12 +156,30 @@ case "${host_cpu}-${host_os}" in
# who knows whether they'll stub that too in a future libc.) So, # who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first: # we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;; ;;
esac esac
if test x"$acx_pthread_ok" = xno; then # Clang doesn't consider unrecognized options an error unless we specify
for flag in $acx_pthread_flags; do # -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
CFLAGS="$save_CFLAGS"
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in case $flag in
none) none)
...@@ -165,8 +192,8 @@ for flag in $acx_pthread_flags; do ...@@ -165,8 +192,8 @@ for flag in $acx_pthread_flags; do
;; ;;
pthread-config) pthread-config)
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
if test x"$acx_pthread_config" = xno; then continue; fi if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;; ;;
...@@ -180,7 +207,7 @@ for flag in $acx_pthread_flags; do ...@@ -180,7 +207,7 @@ for flag in $acx_pthread_flags; do
save_LIBS="$LIBS" save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h, # Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we # since some functions may be macros. (On the Sequent, we
...@@ -191,17 +218,23 @@ for flag in $acx_pthread_flags; do ...@@ -191,17 +218,23 @@ for flag in $acx_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread # pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub. # functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles. # We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>], AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
[pthread_t th; pthread_join(th, 0); static void routine(void *a) { a = 0; }
pthread_attr_init(0); pthread_cleanup_push(0, 0); static void *start_routine(void *a) { return a; }],
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [pthread_t th; pthread_attr_t attr;
[acx_pthread_ok=yes]) pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS" LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok) AC_MSG_RESULT([$ax_pthread_ok])
if test "x$acx_pthread_ok" = xyes; then if test "x$ax_pthread_ok" = xyes; then
break; break;
fi fi
...@@ -211,7 +244,7 @@ done ...@@ -211,7 +244,7 @@ done
fi fi
# Various other checks: # Various other checks:
if test "x$acx_pthread_ok" = xyes; then if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS" save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"
...@@ -221,51 +254,79 @@ if test "x$acx_pthread_ok" = xyes; then ...@@ -221,51 +254,79 @@ if test "x$acx_pthread_ok" = xyes; then
AC_MSG_CHECKING([for joinable pthread attribute]) AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[attr_name=$attr; break]) [int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done done
AC_MSG_RESULT($attr_name) AC_MSG_RESULT([$attr_name])
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
[Define to necessary symbol if this constant [Define to necessary symbol if this constant
uses a non-standard name on your system.]) uses a non-standard name on your system.])
fi fi
AC_MSG_CHECKING([if more special flags are required for pthreads]) AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no flag=no
case "${host_cpu}-${host_os}" in case ${host_os} in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
# TODO: What about Clang on Solaris?
flag="-mt -D_REENTRANT"
fi
;;
esac esac
AC_MSG_RESULT(${flag}) AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
LIBS="$save_LIBS" LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS" CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r # More AIX lossage: compile with *_r variant
if test x"$GCC" != xyes; then if test "x$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) case $host_os in
else aix*)
PTHREAD_CC=$CC AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi fi
else
PTHREAD_CC="$CC"
fi fi
AC_SUBST(PTHREAD_LIBS) test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC) AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then if test x"$ax_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
: :
else else
acx_pthread_ok=no ax_pthread_ok=no
$2 $2
fi fi
AC_LANG_RESTORE AC_LANG_POP
])dnl ACX_PTHREAD ])dnl AX_PTHREAD
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment