New upstream version 1.10.1
proycon
6 years ago
0 | 2017-11-06 Ko van der Sloot <K.vanderSloot@let.ru.nl> | |
1 | ||
2 | * NEWS, configure.ac, src/Makefile.am: release 1.10.1: Bumping .so | |
3 | version to 7.0 | |
4 | ||
5 | 2017-10-17 Ko van der Sloot <K.vanderSloot@let.ru.nl> | |
6 | ||
7 | * NEWS: some news | |
8 | ||
0 | 9 | 2017-10-16 Ko van der Sloot <K.vanderSloot@let.ru.nl> |
1 | 10 | |
2 | 11 | * include/libfolia/folia_document.h, src/folia_document.cxx, |
0 | 1.10.1 2017-11-06 | |
1 | Minor fix | |
2 | * bumped the .so version to 7.0 | |
3 | ||
0 | 4 | 1.10 2017-10-17 |
1 | 5 | Major Release, implementing FoLiA spec 1.5 |
2 | 6 | * added text checking for all 1.5 documents and up |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for libfolia 1.10. | |
2 | # Generated by GNU Autoconf 2.69 for libfolia 1.10.1. | |
3 | 3 | # |
4 | 4 | # Report bugs to <lamasoftware@science.ru.nl>. |
5 | 5 | # |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='libfolia' |
591 | 591 | PACKAGE_TARNAME='libfolia' |
592 | PACKAGE_VERSION='1.10' | |
593 | PACKAGE_STRING='libfolia 1.10' | |
592 | PACKAGE_VERSION='1.10.1' | |
593 | PACKAGE_STRING='libfolia 1.10.1' | |
594 | 594 | PACKAGE_BUGREPORT='lamasoftware@science.ru.nl' |
595 | 595 | PACKAGE_URL='' |
596 | 596 | |
1357 | 1357 | # Omit some internal or obsolete options to make the list less imposing. |
1358 | 1358 | # This message is too long to be a string in the A/UX 3.1 sh. |
1359 | 1359 | cat <<_ACEOF |
1360 | \`configure' configures libfolia 1.10 to adapt to many kinds of systems. | |
1360 | \`configure' configures libfolia 1.10.1 to adapt to many kinds of systems. | |
1361 | 1361 | |
1362 | 1362 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1363 | 1363 | |
1428 | 1428 | |
1429 | 1429 | if test -n "$ac_init_help"; then |
1430 | 1430 | case $ac_init_help in |
1431 | short | recursive ) echo "Configuration of libfolia 1.10:";; | |
1431 | short | recursive ) echo "Configuration of libfolia 1.10.1:";; | |
1432 | 1432 | esac |
1433 | 1433 | cat <<\_ACEOF |
1434 | 1434 | |
1555 | 1555 | test -n "$ac_init_help" && exit $ac_status |
1556 | 1556 | if $ac_init_version; then |
1557 | 1557 | cat <<\_ACEOF |
1558 | libfolia configure 1.10 | |
1558 | libfolia configure 1.10.1 | |
1559 | 1559 | generated by GNU Autoconf 2.69 |
1560 | 1560 | |
1561 | 1561 | Copyright (C) 2012 Free Software Foundation, Inc. |
2075 | 2075 | This file contains any messages produced by compilers while |
2076 | 2076 | running configure, to aid debugging if configure makes a mistake. |
2077 | 2077 | |
2078 | It was created by libfolia $as_me 1.10, which was | |
2078 | It was created by libfolia $as_me 1.10.1, which was | |
2079 | 2079 | generated by GNU Autoconf 2.69. Invocation command line was |
2080 | 2080 | |
2081 | 2081 | $ $0 $@ |
2938 | 2938 | |
2939 | 2939 | # Define the identity of the package. |
2940 | 2940 | PACKAGE='libfolia' |
2941 | VERSION='1.10' | |
2941 | VERSION='1.10.1' | |
2942 | 2942 | |
2943 | 2943 | |
2944 | 2944 | cat >>confdefs.h <<_ACEOF |
16076 | 16076 | |
16077 | 16077 | ax_pthread_ok=no |
16078 | 16078 | |
16079 | # hack for Clang analyzer | |
16080 | SUBST="cc-analyzer" | |
16081 | if test "${CC#*$SUBST}" != $CC; then | |
16082 | OLDCC=${CC} | |
16083 | CC=clang | |
16084 | fi | |
16085 | ||
16086 | 16079 | # We used to check for pthread.h first, but this fails if pthread.h |
16087 | 16080 | # requires special compiler flags (e.g. on Tru64 or Sequent). |
16088 | 16081 | # It gets checked for in the link test anyway. |
16091 | 16084 | # etcetera environment variables, and if threads linking works using |
16092 | 16085 | # them: |
16093 | 16086 | if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then |
16094 | ax_pthread_save_CC="$CC" | |
16095 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16096 | ax_pthread_save_LIBS="$LIBS" | |
16097 | if test "x$PTHREAD_CC" != "x"; then : | |
16087 | ax_pthread_save_CC="$CC" | |
16088 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16089 | ax_pthread_save_LIBS="$LIBS" | |
16090 | if test "x$PTHREAD_CC" != "x"; then : | |
16098 | 16091 | CC="$PTHREAD_CC" |
16099 | 16092 | fi |
16100 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16101 | LIBS="$PTHREAD_LIBS $LIBS" | |
16102 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 | |
16093 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16094 | LIBS="$PTHREAD_LIBS $LIBS" | |
16095 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 | |
16103 | 16096 | $as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } |
16104 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16097 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16105 | 16098 | /* end confdefs.h. */ |
16106 | 16099 | |
16107 | 16100 | /* Override any GCC internal prototype to avoid an error. |
16124 | 16117 | fi |
16125 | 16118 | rm -f core conftest.err conftest.$ac_objext \ |
16126 | 16119 | conftest$ac_exeext conftest.$ac_ext |
16127 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 | |
16120 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 | |
16128 | 16121 | $as_echo "$ax_pthread_ok" >&6; } |
16129 | if test "x$ax_pthread_ok" = "xno"; then | |
16130 | PTHREAD_LIBS="" | |
16131 | PTHREAD_CFLAGS="" | |
16132 | fi | |
16133 | CC="$ax_pthread_save_CC" | |
16134 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16135 | LIBS="$ax_pthread_save_LIBS" | |
16122 | if test "x$ax_pthread_ok" = "xno"; then | |
16123 | PTHREAD_LIBS="" | |
16124 | PTHREAD_CFLAGS="" | |
16125 | fi | |
16126 | CC="$ax_pthread_save_CC" | |
16127 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16128 | LIBS="$ax_pthread_save_LIBS" | |
16136 | 16129 | fi |
16137 | 16130 | |
16138 | 16131 | # We must check for the threads library under a number of different |
16169 | 16162 | |
16170 | 16163 | case $host_os in |
16171 | 16164 | |
16172 | freebsd*) | |
16173 | ||
16174 | # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) | |
16175 | # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) | |
16176 | ||
16177 | ax_pthread_flags="-kthread lthread $ax_pthread_flags" | |
16178 | ;; | |
16179 | ||
16180 | hpux*) | |
16181 | ||
16182 | # From the cc(1) man page: "[-mt] Sets various -D flags to enable | |
16183 | # multi-threading and also sets -lpthread." | |
16184 | ||
16185 | ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" | |
16186 | ;; | |
16187 | ||
16188 | openedition*) | |
16189 | ||
16190 | # IBM z/OS requires a feature-test macro to be defined in order to | |
16191 | # enable POSIX threads at all, so give the user a hint if this is | |
16192 | # not set. (We don't define these ourselves, as they can affect | |
16193 | # other portions of the system API in unpredictable ways.) | |
16194 | ||
16195 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16165 | freebsd*) | |
16166 | ||
16167 | # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) | |
16168 | # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) | |
16169 | ||
16170 | ax_pthread_flags="-kthread lthread $ax_pthread_flags" | |
16171 | ;; | |
16172 | ||
16173 | hpux*) | |
16174 | ||
16175 | # From the cc(1) man page: "[-mt] Sets various -D flags to enable | |
16176 | # multi-threading and also sets -lpthread." | |
16177 | ||
16178 | ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" | |
16179 | ;; | |
16180 | ||
16181 | openedition*) | |
16182 | ||
16183 | # IBM z/OS requires a feature-test macro to be defined in order to | |
16184 | # enable POSIX threads at all, so give the user a hint if this is | |
16185 | # not set. (We don't define these ourselves, as they can affect | |
16186 | # other portions of the system API in unpredictable ways.) | |
16187 | ||
16188 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16196 | 16189 | /* end confdefs.h. */ |
16197 | 16190 | |
16198 | # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) | |
16199 | AX_PTHREAD_ZOS_MISSING | |
16200 | # endif | |
16191 | # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) | |
16192 | AX_PTHREAD_ZOS_MISSING | |
16193 | # endif | |
16201 | 16194 | |
16202 | 16195 | _ACEOF |
16203 | 16196 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
16207 | 16200 | fi |
16208 | 16201 | rm -f conftest* |
16209 | 16202 | |
16210 | ;; | |
16211 | ||
16212 | solaris*) | |
16213 | ||
16214 | # On Solaris (at least, for some versions), libc contains stubbed | |
16215 | # (non-functional) versions of the pthreads routines, so link-based | |
16216 | # tests will erroneously succeed. (N.B.: The stubs are missing | |
16217 | # pthread_cleanup_push, or rather a function called by this macro, | |
16218 | # so we could check for that, but who knows whether they'll stub | |
16219 | # that too in a future libc.) So we'll check first for the | |
16220 | # standard Solaris way of linking pthreads (-mt -lpthread). | |
16221 | ||
16222 | ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" | |
16223 | ;; | |
16203 | ;; | |
16204 | ||
16205 | solaris*) | |
16206 | ||
16207 | # On Solaris (at least, for some versions), libc contains stubbed | |
16208 | # (non-functional) versions of the pthreads routines, so link-based | |
16209 | # tests will erroneously succeed. (N.B.: The stubs are missing | |
16210 | # pthread_cleanup_push, or rather a function called by this macro, | |
16211 | # so we could check for that, but who knows whether they'll stub | |
16212 | # that too in a future libc.) So we'll check first for the | |
16213 | # standard Solaris way of linking pthreads (-mt -lpthread). | |
16214 | ||
16215 | ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" | |
16216 | ;; | |
16224 | 16217 | esac |
16225 | 16218 | |
16226 | 16219 | # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) |
16234 | 16227 | # correctly enabled |
16235 | 16228 | |
16236 | 16229 | case $host_os in |
16237 | darwin* | hpux* | linux* | osf* | solaris*) | |
16238 | ax_pthread_check_macro="_REENTRANT" | |
16239 | ;; | |
16240 | ||
16241 | aix* | freebsd*) | |
16242 | ax_pthread_check_macro="_THREAD_SAFE" | |
16243 | ;; | |
16244 | ||
16245 | *) | |
16246 | ax_pthread_check_macro="--" | |
16247 | ;; | |
16230 | darwin* | hpux* | linux* | osf* | solaris*) | |
16231 | ax_pthread_check_macro="_REENTRANT" | |
16232 | ;; | |
16233 | ||
16234 | aix*) | |
16235 | ax_pthread_check_macro="_THREAD_SAFE" | |
16236 | ;; | |
16237 | ||
16238 | *) | |
16239 | ax_pthread_check_macro="--" | |
16240 | ;; | |
16248 | 16241 | esac |
16249 | 16242 | if test "x$ax_pthread_check_macro" = "x--"; then : |
16250 | 16243 | ax_pthread_check_cond=0 |
16251 | 16244 | else |
16252 | 16245 | ax_pthread_check_cond="!defined($ax_pthread_check_macro)" |
16253 | 16246 | fi |
16247 | ||
16248 | # Are we compiling with Clang? | |
16254 | 16249 | |
16255 | 16250 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 |
16256 | 16251 | $as_echo_n "checking whether $CC is Clang... " >&6; } |
16260 | 16255 | ax_cv_PTHREAD_CLANG=no |
16261 | 16256 | # Note that Autoconf sets GCC=yes for Clang as well as GCC |
16262 | 16257 | if test "x$GCC" = "xyes"; then |
16263 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16258 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16264 | 16259 | /* end confdefs.h. */ |
16265 | 16260 | /* Note: Clang 2.7 lacks __clang_[a-z]+__ */ |
16266 | # if defined(__clang__) && defined(__llvm__) | |
16267 | AX_PTHREAD_CC_IS_CLANG | |
16268 | # endif | |
16261 | # if defined(__clang__) && defined(__llvm__) | |
16262 | AX_PTHREAD_CC_IS_CLANG | |
16263 | # endif | |
16269 | 16264 | |
16270 | 16265 | _ACEOF |
16271 | 16266 | if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | |
16288 | 16283 | |
16289 | 16284 | if test "x$ax_pthread_clang" = "xyes"; then |
16290 | 16285 | |
16291 | # Clang takes -pthread; it has never supported any other flag | |
16292 | ||
16293 | # (Note 1: This will need to be revisited if a system that Clang | |
16294 | # supports has POSIX threads in a separate library. This tends not | |
16295 | # to be the way of modern systems, but it's conceivable.) | |
16296 | ||
16297 | # (Note 2: On some systems, notably Darwin, -pthread is not needed | |
16298 | # to get POSIX threads support; the API is always present and | |
16299 | # active. We could reasonably leave PTHREAD_CFLAGS empty. But | |
16300 | # -pthread does define _REENTRANT, and while the Darwin headers | |
16301 | # ignore this macro, third-party headers might not.) | |
16302 | ||
16303 | PTHREAD_CFLAGS="-pthread" | |
16304 | PTHREAD_LIBS= | |
16305 | ||
16306 | ax_pthread_ok=yes | |
16307 | ||
16308 | # However, older versions of Clang make a point of warning the user | |
16309 | # that, in an invocation where only linking and no compilation is | |
16310 | # taking place, the -pthread option has no effect ("argument unused | |
16311 | # during compilation"). They expect -pthread to be passed in only | |
16312 | # when source code is being compiled. | |
16313 | # | |
16314 | # Problem is, this is at odds with the way Automake and most other | |
16315 | # C build frameworks function, which is that the same flags used in | |
16316 | # compilation (CFLAGS) are also used in linking. Many systems | |
16317 | # supported by AX_PTHREAD require exactly this for POSIX threads | |
16318 | # support, and in fact it is often not straightforward to specify a | |
16319 | # flag that is used only in the compilation phase and not in | |
16320 | # linking. Such a scenario is extremely rare in practice. | |
16321 | # | |
16322 | # Even though use of the -pthread flag in linking would only print | |
16323 | # a warning, this can be a nuisance for well-run software projects | |
16324 | # that build with -Werror. So if the active version of Clang has | |
16325 | # this misfeature, we search for an option to squash it. | |
16326 | ||
16327 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 | |
16286 | # Clang takes -pthread; it has never supported any other flag | |
16287 | ||
16288 | # (Note 1: This will need to be revisited if a system that Clang | |
16289 | # supports has POSIX threads in a separate library. This tends not | |
16290 | # to be the way of modern systems, but it's conceivable.) | |
16291 | ||
16292 | # (Note 2: On some systems, notably Darwin, -pthread is not needed | |
16293 | # to get POSIX threads support; the API is always present and | |
16294 | # active. We could reasonably leave PTHREAD_CFLAGS empty. But | |
16295 | # -pthread does define _REENTRANT, and while the Darwin headers | |
16296 | # ignore this macro, third-party headers might not.) | |
16297 | ||
16298 | PTHREAD_CFLAGS="-pthread" | |
16299 | PTHREAD_LIBS= | |
16300 | ||
16301 | ax_pthread_ok=yes | |
16302 | ||
16303 | # However, older versions of Clang make a point of warning the user | |
16304 | # that, in an invocation where only linking and no compilation is | |
16305 | # taking place, the -pthread option has no effect ("argument unused | |
16306 | # during compilation"). They expect -pthread to be passed in only | |
16307 | # when source code is being compiled. | |
16308 | # | |
16309 | # Problem is, this is at odds with the way Automake and most other | |
16310 | # C build frameworks function, which is that the same flags used in | |
16311 | # compilation (CFLAGS) are also used in linking. Many systems | |
16312 | # supported by AX_PTHREAD require exactly this for POSIX threads | |
16313 | # support, and in fact it is often not straightforward to specify a | |
16314 | # flag that is used only in the compilation phase and not in | |
16315 | # linking. Such a scenario is extremely rare in practice. | |
16316 | # | |
16317 | # Even though use of the -pthread flag in linking would only print | |
16318 | # a warning, this can be a nuisance for well-run software projects | |
16319 | # that build with -Werror. So if the active version of Clang has | |
16320 | # this misfeature, we search for an option to squash it. | |
16321 | ||
16322 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 | |
16328 | 16323 | $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } |
16329 | 16324 | if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : |
16330 | 16325 | $as_echo_n "(cached) " >&6 |
16331 | 16326 | else |
16332 | 16327 | ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown |
16333 | # Create an alternate version of $ac_link that compiles and | |
16334 | # links in two steps (.c -> .o, .o -> exe) instead of one | |
16335 | # (.c -> exe), because the warning occurs only in the second | |
16336 | # step | |
16337 | ax_pthread_save_ac_link="$ac_link" | |
16338 | ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' | |
16339 | ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` | |
16340 | ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" | |
16341 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16342 | for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do | |
16343 | if test "x$ax_pthread_try" = "xunknown"; then : | |
16328 | # Create an alternate version of $ac_link that compiles and | |
16329 | # links in two steps (.c -> .o, .o -> exe) instead of one | |
16330 | # (.c -> exe), because the warning occurs only in the second | |
16331 | # step | |
16332 | ax_pthread_save_ac_link="$ac_link" | |
16333 | ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' | |
16334 | ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` | |
16335 | ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" | |
16336 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16337 | for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do | |
16338 | if test "x$ax_pthread_try" = "xunknown"; then : | |
16344 | 16339 | break |
16345 | 16340 | fi |
16346 | CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" | |
16347 | ac_link="$ax_pthread_save_ac_link" | |
16348 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16341 | CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" | |
16342 | ac_link="$ax_pthread_save_ac_link" | |
16343 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16349 | 16344 | /* end confdefs.h. */ |
16350 | 16345 | int main(void){return 0;} |
16351 | 16346 | _ACEOF |
16352 | 16347 | if ac_fn_c_try_link "$LINENO"; then : |
16353 | 16348 | ac_link="$ax_pthread_2step_ac_link" |
16354 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16349 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16355 | 16350 | /* end confdefs.h. */ |
16356 | 16351 | int main(void){return 0;} |
16357 | 16352 | _ACEOF |
16364 | 16359 | fi |
16365 | 16360 | rm -f core conftest.err conftest.$ac_objext \ |
16366 | 16361 | conftest$ac_exeext conftest.$ac_ext |
16367 | done | |
16368 | ac_link="$ax_pthread_save_ac_link" | |
16369 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16370 | if test "x$ax_pthread_try" = "x"; then : | |
16362 | done | |
16363 | ac_link="$ax_pthread_save_ac_link" | |
16364 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16365 | if test "x$ax_pthread_try" = "x"; then : | |
16371 | 16366 | ax_pthread_try=no |
16372 | 16367 | fi |
16373 | ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" | |
16368 | ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" | |
16374 | 16369 | |
16375 | 16370 | fi |
16376 | 16371 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 |
16377 | 16372 | $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } |
16378 | 16373 | |
16379 | case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in | |
16380 | no | unknown) ;; | |
16381 | *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; | |
16382 | esac | |
16374 | case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in | |
16375 | no | unknown) ;; | |
16376 | *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; | |
16377 | esac | |
16383 | 16378 | |
16384 | 16379 | fi # $ax_pthread_clang = yes |
16385 | 16380 | |
16386 | 16381 | if test "x$ax_pthread_ok" = "xno"; then |
16387 | 16382 | for ax_pthread_try_flag in $ax_pthread_flags; do |
16388 | 16383 | |
16389 | case $ax_pthread_try_flag in | |
16390 | none) | |
16391 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 | |
16384 | case $ax_pthread_try_flag in | |
16385 | none) | |
16386 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 | |
16392 | 16387 | $as_echo_n "checking whether pthreads work without any flags... " >&6; } |
16393 | ;; | |
16394 | ||
16395 | -mt,pthread) | |
16396 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 | |
16388 | ;; | |
16389 | ||
16390 | -mt,pthread) | |
16391 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 | |
16397 | 16392 | $as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } |
16398 | PTHREAD_CFLAGS="-mt" | |
16399 | PTHREAD_LIBS="-lpthread" | |
16400 | ;; | |
16401 | ||
16402 | -*) | |
16403 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 | |
16393 | PTHREAD_CFLAGS="-mt" | |
16394 | PTHREAD_LIBS="-lpthread" | |
16395 | ;; | |
16396 | ||
16397 | -*) | |
16398 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 | |
16404 | 16399 | $as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } |
16405 | PTHREAD_CFLAGS="$ax_pthread_try_flag" | |
16406 | ;; | |
16407 | ||
16408 | pthread-config) | |
16409 | # Extract the first word of "pthread-config", so it can be a program name with args. | |
16400 | PTHREAD_CFLAGS="$ax_pthread_try_flag" | |
16401 | ;; | |
16402 | ||
16403 | pthread-config) | |
16404 | # Extract the first word of "pthread-config", so it can be a program name with args. | |
16410 | 16405 | set dummy pthread-config; ac_word=$2 |
16411 | 16406 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
16412 | 16407 | $as_echo_n "checking for $ac_word... " >&6; } |
16444 | 16439 | fi |
16445 | 16440 | |
16446 | 16441 | |
16447 | if test "x$ax_pthread_config" = "xno"; then : | |
16442 | if test "x$ax_pthread_config" = "xno"; then : | |
16448 | 16443 | continue |
16449 | 16444 | fi |
16450 | PTHREAD_CFLAGS="`pthread-config --cflags`" | |
16451 | PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" | |
16452 | ;; | |
16453 | ||
16454 | *) | |
16455 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 | |
16445 | PTHREAD_CFLAGS="`pthread-config --cflags`" | |
16446 | PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" | |
16447 | ;; | |
16448 | ||
16449 | *) | |
16450 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 | |
16456 | 16451 | $as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } |
16457 | PTHREAD_LIBS="-l$ax_pthread_try_flag" | |
16458 | ;; | |
16459 | esac | |
16460 | ||
16461 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16462 | ax_pthread_save_LIBS="$LIBS" | |
16463 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16464 | LIBS="$PTHREAD_LIBS $LIBS" | |
16465 | ||
16466 | # Check for various functions. We must include pthread.h, | |
16467 | # since some functions may be macros. (On the Sequent, we | |
16468 | # need a special flag -Kthread to make this header compile.) | |
16469 | # We check for pthread_join because it is in -lpthread on IRIX | |
16470 | # while pthread_create is in libc. We check for pthread_attr_init | |
16471 | # due to DEC craziness with -lpthreads. We check for | |
16472 | # pthread_cleanup_push because it is one of the few pthread | |
16473 | # functions on Solaris that doesn't have a non-functional libc stub. | |
16474 | # We try pthread_create on general principles. | |
16475 | ||
16476 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16452 | PTHREAD_LIBS="-l$ax_pthread_try_flag" | |
16453 | ;; | |
16454 | esac | |
16455 | ||
16456 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16457 | ax_pthread_save_LIBS="$LIBS" | |
16458 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16459 | LIBS="$PTHREAD_LIBS $LIBS" | |
16460 | ||
16461 | # Check for various functions. We must include pthread.h, | |
16462 | # since some functions may be macros. (On the Sequent, we | |
16463 | # need a special flag -Kthread to make this header compile.) | |
16464 | # We check for pthread_join because it is in -lpthread on IRIX | |
16465 | # while pthread_create is in libc. We check for pthread_attr_init | |
16466 | # due to DEC craziness with -lpthreads. We check for | |
16467 | # pthread_cleanup_push because it is one of the few pthread | |
16468 | # functions on Solaris that doesn't have a non-functional libc stub. | |
16469 | # We try pthread_create on general principles. | |
16470 | ||
16471 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16477 | 16472 | /* end confdefs.h. */ |
16478 | 16473 | #include <pthread.h> |
16479 | # if $ax_pthread_check_cond | |
16480 | # error "$ax_pthread_check_macro must be defined" | |
16481 | # endif | |
16482 | static void routine(void *a) { a = 0; } | |
16483 | static void *start_routine(void *a) { return a; } | |
16474 | # if $ax_pthread_check_cond | |
16475 | # error "$ax_pthread_check_macro must be defined" | |
16476 | # endif | |
16477 | static void routine(void *a) { a = 0; } | |
16478 | static void *start_routine(void *a) { return a; } | |
16484 | 16479 | int |
16485 | 16480 | main () |
16486 | 16481 | { |
16487 | 16482 | pthread_t th; pthread_attr_t attr; |
16488 | pthread_create(&th, 0, start_routine, 0); | |
16489 | pthread_join(th, 0); | |
16490 | pthread_attr_init(&attr); | |
16491 | pthread_cleanup_push(routine, 0); | |
16492 | pthread_cleanup_pop(0) /* ; */ | |
16483 | pthread_create(&th, 0, start_routine, 0); | |
16484 | pthread_join(th, 0); | |
16485 | pthread_attr_init(&attr); | |
16486 | pthread_cleanup_push(routine, 0); | |
16487 | pthread_cleanup_pop(0) /* ; */ | |
16493 | 16488 | ; |
16494 | 16489 | return 0; |
16495 | 16490 | } |
16500 | 16495 | rm -f core conftest.err conftest.$ac_objext \ |
16501 | 16496 | conftest$ac_exeext conftest.$ac_ext |
16502 | 16497 | |
16503 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16504 | LIBS="$ax_pthread_save_LIBS" | |
16505 | ||
16506 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 | |
16498 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16499 | LIBS="$ax_pthread_save_LIBS" | |
16500 | ||
16501 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 | |
16507 | 16502 | $as_echo "$ax_pthread_ok" >&6; } |
16508 | if test "x$ax_pthread_ok" = "xyes"; then : | |
16503 | if test "x$ax_pthread_ok" = "xyes"; then : | |
16509 | 16504 | break |
16510 | 16505 | fi |
16511 | 16506 | |
16512 | PTHREAD_LIBS="" | |
16513 | PTHREAD_CFLAGS="" | |
16507 | PTHREAD_LIBS="" | |
16508 | PTHREAD_CFLAGS="" | |
16514 | 16509 | done |
16515 | 16510 | fi |
16516 | 16511 | |
16517 | 16512 | # Various other checks: |
16518 | 16513 | if test "x$ax_pthread_ok" = "xyes"; then |
16519 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16520 | ax_pthread_save_LIBS="$LIBS" | |
16521 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16522 | LIBS="$PTHREAD_LIBS $LIBS" | |
16523 | ||
16524 | # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. | |
16525 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 | |
16514 | ax_pthread_save_CFLAGS="$CFLAGS" | |
16515 | ax_pthread_save_LIBS="$LIBS" | |
16516 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
16517 | LIBS="$PTHREAD_LIBS $LIBS" | |
16518 | ||
16519 | # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. | |
16520 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 | |
16526 | 16521 | $as_echo_n "checking for joinable pthread attribute... " >&6; } |
16527 | 16522 | if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : |
16528 | 16523 | $as_echo_n "(cached) " >&6 |
16529 | 16524 | else |
16530 | 16525 | ax_cv_PTHREAD_JOINABLE_ATTR=unknown |
16531 | for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do | |
16532 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16526 | for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do | |
16527 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
16533 | 16528 | /* end confdefs.h. */ |
16534 | 16529 | #include <pthread.h> |
16535 | 16530 | int |
16545 | 16540 | fi |
16546 | 16541 | rm -f core conftest.err conftest.$ac_objext \ |
16547 | 16542 | conftest$ac_exeext conftest.$ac_ext |
16548 | done | |
16543 | done | |
16549 | 16544 | |
16550 | 16545 | fi |
16551 | 16546 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 |
16552 | 16547 | $as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } |
16553 | if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ | |
16554 | test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ | |
16555 | test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : | |
16548 | if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ | |
16549 | test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ | |
16550 | test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : | |
16556 | 16551 | |
16557 | 16552 | cat >>confdefs.h <<_ACEOF |
16558 | 16553 | #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR |
16559 | 16554 | _ACEOF |
16560 | 16555 | |
16561 | ax_pthread_joinable_attr_defined=yes | |
16562 | ||
16563 | fi | |
16564 | ||
16565 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 | |
16556 | ax_pthread_joinable_attr_defined=yes | |
16557 | ||
16558 | fi | |
16559 | ||
16560 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 | |
16566 | 16561 | $as_echo_n "checking whether more special flags are required for pthreads... " >&6; } |
16567 | 16562 | if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : |
16568 | 16563 | $as_echo_n "(cached) " >&6 |
16569 | 16564 | else |
16570 | 16565 | ax_cv_PTHREAD_SPECIAL_FLAGS=no |
16571 | case $host_os in | |
16572 | solaris*) | |
16573 | ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" | |
16574 | ;; | |
16575 | esac | |
16566 | case $host_os in | |
16567 | solaris*) | |
16568 | ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" | |
16569 | ;; | |
16570 | esac | |
16576 | 16571 | |
16577 | 16572 | fi |
16578 | 16573 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 |
16579 | 16574 | $as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } |
16580 | if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ | |
16581 | test "x$ax_pthread_special_flags_added" != "xyes"; then : | |
16575 | if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ | |
16576 | test "x$ax_pthread_special_flags_added" != "xyes"; then : | |
16582 | 16577 | PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" |
16583 | ax_pthread_special_flags_added=yes | |
16584 | fi | |
16585 | ||
16586 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 | |
16578 | ax_pthread_special_flags_added=yes | |
16579 | fi | |
16580 | ||
16581 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 | |
16587 | 16582 | $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } |
16588 | 16583 | if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : |
16589 | 16584 | $as_echo_n "(cached) " >&6 |
16610 | 16605 | fi |
16611 | 16606 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 |
16612 | 16607 | $as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } |
16613 | if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ | |
16614 | test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : | |
16608 | if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ | |
16609 | test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : | |
16615 | 16610 | |
16616 | 16611 | $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h |
16617 | 16612 | |
16618 | ax_pthread_prio_inherit_defined=yes | |
16619 | ||
16620 | fi | |
16621 | ||
16622 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16623 | LIBS="$ax_pthread_save_LIBS" | |
16624 | ||
16625 | # More AIX lossage: compile with *_r variant | |
16626 | if test "x$GCC" != "xyes"; then | |
16627 | case $host_os in | |
16628 | aix*) | |
16629 | case "x/$CC" in #( | |
16613 | ax_pthread_prio_inherit_defined=yes | |
16614 | ||
16615 | fi | |
16616 | ||
16617 | CFLAGS="$ax_pthread_save_CFLAGS" | |
16618 | LIBS="$ax_pthread_save_LIBS" | |
16619 | ||
16620 | # More AIX lossage: compile with *_r variant | |
16621 | if test "x$GCC" != "xyes"; then | |
16622 | case $host_os in | |
16623 | aix*) | |
16624 | case "x/$CC" in #( | |
16630 | 16625 | x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : |
16631 | 16626 | #handle absolute path differently from PATH based program lookup |
16632 | case "x$CC" in #( | |
16627 | case "x$CC" in #( | |
16633 | 16628 | x/*) : |
16634 | 16629 | if as_fn_executable_p ${CC}_r; then : |
16635 | 16630 | PTHREAD_CC="${CC}_r" |
16682 | 16677 | *) : |
16683 | 16678 | ;; |
16684 | 16679 | esac |
16685 | ;; | |
16686 | esac | |
16687 | fi | |
16680 | ;; | |
16681 | esac | |
16682 | fi | |
16688 | 16683 | fi |
16689 | 16684 | |
16690 | 16685 | test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" |
16698 | 16693 | |
16699 | 16694 | $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h |
16700 | 16695 | |
16701 | : | |
16702 | else | |
16703 | ax_pthread_ok=no | |
16704 | as_fn_error $? "We need pthread support!" "$LINENO" 5 | |
16705 | fi | |
16706 | ||
16707 | # undo hack for Clang analyzer | |
16708 | if test "${OLDCC#*$SUBST}" != ${OLDCC}; then | |
16709 | CC=${OLDCC} | |
16710 | fi | |
16711 | ||
16696 | : | |
16697 | else | |
16698 | ax_pthread_ok=no | |
16699 | as_fn_error $? "We need pthread support!" "$LINENO" 5 | |
16700 | fi | |
16712 | 16701 | ac_ext=cpp |
16713 | 16702 | ac_cpp='$CXXCPP $CPPFLAGS' |
16714 | 16703 | ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' |
17798 | 17787 | # report actual input values of CONFIG_FILES etc. instead of their |
17799 | 17788 | # values after options handling. |
17800 | 17789 | ac_log=" |
17801 | This file was extended by libfolia $as_me 1.10, which was | |
17790 | This file was extended by libfolia $as_me 1.10.1, which was | |
17802 | 17791 | generated by GNU Autoconf 2.69. Invocation command line was |
17803 | 17792 | |
17804 | 17793 | CONFIG_FILES = $CONFIG_FILES |
17864 | 17853 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
17865 | 17854 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
17866 | 17855 | ac_cs_version="\\ |
17867 | libfolia config.status 1.10 | |
17856 | libfolia config.status 1.10.1 | |
17868 | 17857 | configured by $0, generated by GNU Autoconf 2.69, |
17869 | 17858 | with options \\"\$ac_cs_config\\" |
17870 | 17859 |
1 | 1 | # Process this file with autoconf to produce a configure script. |
2 | 2 | |
3 | 3 | AC_PREREQ(2.59) |
4 | AC_INIT([libfolia], [1.10], [lamasoftware@science.ru.nl]) | |
4 | AC_INIT([libfolia], [1.10.1], [lamasoftware@science.ru.nl]) | |
5 | 5 | AM_INIT_AUTOMAKE([foreign]) |
6 | 6 | AC_CONFIG_SRCDIR([configure.ac]) |
7 | 7 | AC_CONFIG_MACRO_DIR([m4]) |
0 | 0 | # =========================================================================== |
1 | # http://www.gnu.org/software/autoconf-archive/ax_pthread.html | |
1 | # https://www.gnu.org/software/autoconf-archive/ax_pthread.html | |
2 | 2 | # =========================================================================== |
3 | 3 | # |
4 | 4 | # SYNOPSIS |
5 | 5 | # |
6 | 6 | # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) |
7 | # | |
8 | # Ko vd Sloot: special hacked version to survive clang's cc-analyser usage | |
9 | 7 | # |
10 | 8 | # DESCRIPTION |
11 | 9 | # |
68 | 66 | # Public License for more details. |
69 | 67 | # |
70 | 68 | # You should have received a copy of the GNU General Public License along |
71 | # with this program. If not, see <http://www.gnu.org/licenses/>. | |
69 | # with this program. If not, see <https://www.gnu.org/licenses/>. | |
72 | 70 | # |
73 | 71 | # As a special exception, the respective Autoconf Macro's copyright owner |
74 | 72 | # gives unlimited permission to copy, distribute and modify the configure |
83 | 81 | # modified version of the Autoconf Macro, you may extend this special |
84 | 82 | # exception to the GPL to apply to your modified version as well. |
85 | 83 | |
86 | #serial 222 | |
84 | #serial 24 | |
87 | 85 | |
88 | 86 | AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) |
89 | 87 | AC_DEFUN([AX_PTHREAD], [ |
93 | 91 | AC_LANG_PUSH([C]) |
94 | 92 | ax_pthread_ok=no |
95 | 93 | |
96 | # hack for Clang analyzer | |
97 | SUBST="cc-analyzer" | |
98 | if test "${CC#*$SUBST}" != $CC; then | |
99 | OLDCC=${CC} | |
100 | CC=clang | |
101 | fi | |
102 | ||
103 | 94 | # We used to check for pthread.h first, but this fails if pthread.h |
104 | 95 | # requires special compiler flags (e.g. on Tru64 or Sequent). |
105 | 96 | # It gets checked for in the link test anyway. |
108 | 99 | # etcetera environment variables, and if threads linking works using |
109 | 100 | # them: |
110 | 101 | if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then |
111 | ax_pthread_save_CC="$CC" | |
112 | ax_pthread_save_CFLAGS="$CFLAGS" | |
113 | ax_pthread_save_LIBS="$LIBS" | |
114 | AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) | |
115 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
116 | LIBS="$PTHREAD_LIBS $LIBS" | |
117 | AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) | |
118 | AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) | |
119 | AC_MSG_RESULT([$ax_pthread_ok]) | |
120 | if test "x$ax_pthread_ok" = "xno"; then | |
121 | PTHREAD_LIBS="" | |
122 | PTHREAD_CFLAGS="" | |
123 | fi | |
124 | CC="$ax_pthread_save_CC" | |
125 | CFLAGS="$ax_pthread_save_CFLAGS" | |
126 | LIBS="$ax_pthread_save_LIBS" | |
102 | ax_pthread_save_CC="$CC" | |
103 | ax_pthread_save_CFLAGS="$CFLAGS" | |
104 | ax_pthread_save_LIBS="$LIBS" | |
105 | AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) | |
106 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
107 | LIBS="$PTHREAD_LIBS $LIBS" | |
108 | AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) | |
109 | AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) | |
110 | AC_MSG_RESULT([$ax_pthread_ok]) | |
111 | if test "x$ax_pthread_ok" = "xno"; then | |
112 | PTHREAD_LIBS="" | |
113 | PTHREAD_CFLAGS="" | |
114 | fi | |
115 | CC="$ax_pthread_save_CC" | |
116 | CFLAGS="$ax_pthread_save_CFLAGS" | |
117 | LIBS="$ax_pthread_save_LIBS" | |
127 | 118 | fi |
128 | 119 | |
129 | 120 | # We must check for the threads library under a number of different |
160 | 151 | |
161 | 152 | case $host_os in |
162 | 153 | |
163 | freebsd*) | |
164 | ||
165 | # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) | |
166 | # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) | |
167 | ||
168 | ax_pthread_flags="-kthread lthread $ax_pthread_flags" | |
169 | ;; | |
170 | ||
171 | hpux*) | |
172 | ||
173 | # From the cc(1) man page: "[-mt] Sets various -D flags to enable | |
174 | # multi-threading and also sets -lpthread." | |
175 | ||
176 | ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" | |
177 | ;; | |
178 | ||
179 | openedition*) | |
180 | ||
181 | # IBM z/OS requires a feature-test macro to be defined in order to | |
182 | # enable POSIX threads at all, so give the user a hint if this is | |
183 | # not set. (We don't define these ourselves, as they can affect | |
184 | # other portions of the system API in unpredictable ways.) | |
185 | ||
186 | AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], | |
187 | [ | |
188 | # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) | |
189 | AX_PTHREAD_ZOS_MISSING | |
190 | # endif | |
191 | ], | |
192 | [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) | |
193 | ;; | |
194 | ||
195 | solaris*) | |
196 | ||
197 | # On Solaris (at least, for some versions), libc contains stubbed | |
198 | # (non-functional) versions of the pthreads routines, so link-based | |
199 | # tests will erroneously succeed. (N.B.: The stubs are missing | |
200 | # pthread_cleanup_push, or rather a function called by this macro, | |
201 | # so we could check for that, but who knows whether they'll stub | |
202 | # that too in a future libc.) So we'll check first for the | |
203 | # standard Solaris way of linking pthreads (-mt -lpthread). | |
204 | ||
205 | ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" | |
206 | ;; | |
154 | freebsd*) | |
155 | ||
156 | # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) | |
157 | # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) | |
158 | ||
159 | ax_pthread_flags="-kthread lthread $ax_pthread_flags" | |
160 | ;; | |
161 | ||
162 | hpux*) | |
163 | ||
164 | # From the cc(1) man page: "[-mt] Sets various -D flags to enable | |
165 | # multi-threading and also sets -lpthread." | |
166 | ||
167 | ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" | |
168 | ;; | |
169 | ||
170 | openedition*) | |
171 | ||
172 | # IBM z/OS requires a feature-test macro to be defined in order to | |
173 | # enable POSIX threads at all, so give the user a hint if this is | |
174 | # not set. (We don't define these ourselves, as they can affect | |
175 | # other portions of the system API in unpredictable ways.) | |
176 | ||
177 | AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], | |
178 | [ | |
179 | # if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) | |
180 | AX_PTHREAD_ZOS_MISSING | |
181 | # endif | |
182 | ], | |
183 | [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) | |
184 | ;; | |
185 | ||
186 | solaris*) | |
187 | ||
188 | # On Solaris (at least, for some versions), libc contains stubbed | |
189 | # (non-functional) versions of the pthreads routines, so link-based | |
190 | # tests will erroneously succeed. (N.B.: The stubs are missing | |
191 | # pthread_cleanup_push, or rather a function called by this macro, | |
192 | # so we could check for that, but who knows whether they'll stub | |
193 | # that too in a future libc.) So we'll check first for the | |
194 | # standard Solaris way of linking pthreads (-mt -lpthread). | |
195 | ||
196 | ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" | |
197 | ;; | |
207 | 198 | esac |
208 | 199 | |
209 | 200 | # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) |
216 | 207 | # correctly enabled |
217 | 208 | |
218 | 209 | case $host_os in |
219 | darwin* | hpux* | linux* | osf* | solaris*) | |
220 | ax_pthread_check_macro="_REENTRANT" | |
221 | ;; | |
222 | ||
223 | aix* | freebsd*) | |
224 | ax_pthread_check_macro="_THREAD_SAFE" | |
225 | ;; | |
226 | ||
227 | *) | |
228 | ax_pthread_check_macro="--" | |
229 | ;; | |
210 | darwin* | hpux* | linux* | osf* | solaris*) | |
211 | ax_pthread_check_macro="_REENTRANT" | |
212 | ;; | |
213 | ||
214 | aix*) | |
215 | ax_pthread_check_macro="_THREAD_SAFE" | |
216 | ;; | |
217 | ||
218 | *) | |
219 | ax_pthread_check_macro="--" | |
220 | ;; | |
230 | 221 | esac |
231 | 222 | AS_IF([test "x$ax_pthread_check_macro" = "x--"], |
232 | 223 | [ax_pthread_check_cond=0], |
233 | 224 | [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) |
225 | ||
226 | # Are we compiling with Clang? | |
234 | 227 | |
235 | 228 | AC_CACHE_CHECK([whether $CC is Clang], |
236 | 229 | [ax_cv_PTHREAD_CLANG], |
237 | 230 | [ax_cv_PTHREAD_CLANG=no |
238 | 231 | # Note that Autoconf sets GCC=yes for Clang as well as GCC |
239 | 232 | if test "x$GCC" = "xyes"; then |
240 | AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], | |
241 | [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ | |
242 | # if defined(__clang__) && defined(__llvm__) | |
243 | AX_PTHREAD_CC_IS_CLANG | |
244 | # endif | |
245 | ], | |
246 | [ax_cv_PTHREAD_CLANG=yes]) | |
233 | AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], | |
234 | [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ | |
235 | # if defined(__clang__) && defined(__llvm__) | |
236 | AX_PTHREAD_CC_IS_CLANG | |
237 | # endif | |
238 | ], | |
239 | [ax_cv_PTHREAD_CLANG=yes]) | |
247 | 240 | fi |
248 | 241 | ]) |
249 | 242 | ax_pthread_clang="$ax_cv_PTHREAD_CLANG" |
255 | 248 | |
256 | 249 | if test "x$ax_pthread_clang" = "xyes"; then |
257 | 250 | |
258 | # Clang takes -pthread; it has never supported any other flag | |
259 | ||
260 | # (Note 1: This will need to be revisited if a system that Clang | |
261 | # supports has POSIX threads in a separate library. This tends not | |
262 | # to be the way of modern systems, but it's conceivable.) | |
263 | ||
264 | # (Note 2: On some systems, notably Darwin, -pthread is not needed | |
265 | # to get POSIX threads support; the API is always present and | |
266 | # active. We could reasonably leave PTHREAD_CFLAGS empty. But | |
267 | # -pthread does define _REENTRANT, and while the Darwin headers | |
268 | # ignore this macro, third-party headers might not.) | |
269 | ||
270 | PTHREAD_CFLAGS="-pthread" | |
271 | PTHREAD_LIBS= | |
272 | ||
273 | ax_pthread_ok=yes | |
274 | ||
275 | # However, older versions of Clang make a point of warning the user | |
276 | # that, in an invocation where only linking and no compilation is | |
277 | # taking place, the -pthread option has no effect ("argument unused | |
278 | # during compilation"). They expect -pthread to be passed in only | |
279 | # when source code is being compiled. | |
280 | # | |
281 | # Problem is, this is at odds with the way Automake and most other | |
282 | # C build frameworks function, which is that the same flags used in | |
283 | # compilation (CFLAGS) are also used in linking. Many systems | |
284 | # supported by AX_PTHREAD require exactly this for POSIX threads | |
285 | # support, and in fact it is often not straightforward to specify a | |
286 | # flag that is used only in the compilation phase and not in | |
287 | # linking. Such a scenario is extremely rare in practice. | |
288 | # | |
289 | # Even though use of the -pthread flag in linking would only print | |
290 | # a warning, this can be a nuisance for well-run software projects | |
291 | # that build with -Werror. So if the active version of Clang has | |
292 | # this misfeature, we search for an option to squash it. | |
293 | ||
294 | AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], | |
295 | [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], | |
296 | [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown | |
297 | # Create an alternate version of $ac_link that compiles and | |
298 | # links in two steps (.c -> .o, .o -> exe) instead of one | |
299 | # (.c -> exe), because the warning occurs only in the second | |
300 | # step | |
301 | ax_pthread_save_ac_link="$ac_link" | |
302 | ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' | |
303 | ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` | |
304 | ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" | |
305 | ax_pthread_save_CFLAGS="$CFLAGS" | |
306 | for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do | |
307 | AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) | |
308 | CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" | |
309 | ac_link="$ax_pthread_save_ac_link" | |
310 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], | |
311 | [ac_link="$ax_pthread_2step_ac_link" | |
312 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], | |
313 | [break]) | |
314 | ]) | |
315 | done | |
316 | ac_link="$ax_pthread_save_ac_link" | |
317 | CFLAGS="$ax_pthread_save_CFLAGS" | |
318 | AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) | |
319 | ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" | |
320 | ]) | |
321 | ||
322 | case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in | |
323 | no | unknown) ;; | |
324 | *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; | |
325 | esac | |
251 | # Clang takes -pthread; it has never supported any other flag | |
252 | ||
253 | # (Note 1: This will need to be revisited if a system that Clang | |
254 | # supports has POSIX threads in a separate library. This tends not | |
255 | # to be the way of modern systems, but it's conceivable.) | |
256 | ||
257 | # (Note 2: On some systems, notably Darwin, -pthread is not needed | |
258 | # to get POSIX threads support; the API is always present and | |
259 | # active. We could reasonably leave PTHREAD_CFLAGS empty. But | |
260 | # -pthread does define _REENTRANT, and while the Darwin headers | |
261 | # ignore this macro, third-party headers might not.) | |
262 | ||
263 | PTHREAD_CFLAGS="-pthread" | |
264 | PTHREAD_LIBS= | |
265 | ||
266 | ax_pthread_ok=yes | |
267 | ||
268 | # However, older versions of Clang make a point of warning the user | |
269 | # that, in an invocation where only linking and no compilation is | |
270 | # taking place, the -pthread option has no effect ("argument unused | |
271 | # during compilation"). They expect -pthread to be passed in only | |
272 | # when source code is being compiled. | |
273 | # | |
274 | # Problem is, this is at odds with the way Automake and most other | |
275 | # C build frameworks function, which is that the same flags used in | |
276 | # compilation (CFLAGS) are also used in linking. Many systems | |
277 | # supported by AX_PTHREAD require exactly this for POSIX threads | |
278 | # support, and in fact it is often not straightforward to specify a | |
279 | # flag that is used only in the compilation phase and not in | |
280 | # linking. Such a scenario is extremely rare in practice. | |
281 | # | |
282 | # Even though use of the -pthread flag in linking would only print | |
283 | # a warning, this can be a nuisance for well-run software projects | |
284 | # that build with -Werror. So if the active version of Clang has | |
285 | # this misfeature, we search for an option to squash it. | |
286 | ||
287 | AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], | |
288 | [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], | |
289 | [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown | |
290 | # Create an alternate version of $ac_link that compiles and | |
291 | # links in two steps (.c -> .o, .o -> exe) instead of one | |
292 | # (.c -> exe), because the warning occurs only in the second | |
293 | # step | |
294 | ax_pthread_save_ac_link="$ac_link" | |
295 | ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' | |
296 | ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` | |
297 | ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" | |
298 | ax_pthread_save_CFLAGS="$CFLAGS" | |
299 | for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do | |
300 | AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) | |
301 | CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" | |
302 | ac_link="$ax_pthread_save_ac_link" | |
303 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], | |
304 | [ac_link="$ax_pthread_2step_ac_link" | |
305 | AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], | |
306 | [break]) | |
307 | ]) | |
308 | done | |
309 | ac_link="$ax_pthread_save_ac_link" | |
310 | CFLAGS="$ax_pthread_save_CFLAGS" | |
311 | AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) | |
312 | ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" | |
313 | ]) | |
314 | ||
315 | case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in | |
316 | no | unknown) ;; | |
317 | *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; | |
318 | esac | |
326 | 319 | |
327 | 320 | fi # $ax_pthread_clang = yes |
328 | 321 | |
329 | 322 | if test "x$ax_pthread_ok" = "xno"; then |
330 | 323 | for ax_pthread_try_flag in $ax_pthread_flags; do |
331 | 324 | |
332 | case $ax_pthread_try_flag in | |
333 | none) | |
334 | AC_MSG_CHECKING([whether pthreads work without any flags]) | |
335 | ;; | |
336 | ||
337 | -mt,pthread) | |
338 | AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) | |
339 | PTHREAD_CFLAGS="-mt" | |
340 | PTHREAD_LIBS="-lpthread" | |
341 | ;; | |
342 | ||
343 | -*) | |
344 | AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) | |
345 | PTHREAD_CFLAGS="$ax_pthread_try_flag" | |
346 | ;; | |
347 | ||
348 | pthread-config) | |
349 | AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) | |
350 | AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) | |
351 | PTHREAD_CFLAGS="`pthread-config --cflags`" | |
352 | PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" | |
353 | ;; | |
354 | ||
355 | *) | |
356 | AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) | |
357 | PTHREAD_LIBS="-l$ax_pthread_try_flag" | |
358 | ;; | |
359 | esac | |
360 | ||
361 | ax_pthread_save_CFLAGS="$CFLAGS" | |
362 | ax_pthread_save_LIBS="$LIBS" | |
363 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
364 | LIBS="$PTHREAD_LIBS $LIBS" | |
365 | ||
366 | # Check for various functions. We must include pthread.h, | |
367 | # since some functions may be macros. (On the Sequent, we | |
368 | # need a special flag -Kthread to make this header compile.) | |
369 | # We check for pthread_join because it is in -lpthread on IRIX | |
370 | # while pthread_create is in libc. We check for pthread_attr_init | |
371 | # due to DEC craziness with -lpthreads. We check for | |
372 | # pthread_cleanup_push because it is one of the few pthread | |
373 | # functions on Solaris that doesn't have a non-functional libc stub. | |
374 | # We try pthread_create on general principles. | |
375 | ||
376 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> | |
377 | # if $ax_pthread_check_cond | |
378 | # error "$ax_pthread_check_macro must be defined" | |
379 | # endif | |
380 | static void routine(void *a) { a = 0; } | |
381 | static void *start_routine(void *a) { return a; }], | |
382 | [pthread_t th; pthread_attr_t attr; | |
383 | pthread_create(&th, 0, start_routine, 0); | |
384 | pthread_join(th, 0); | |
385 | pthread_attr_init(&attr); | |
386 | pthread_cleanup_push(routine, 0); | |
387 | pthread_cleanup_pop(0) /* ; */])], | |
388 | [ax_pthread_ok=yes], | |
389 | []) | |
390 | ||
391 | CFLAGS="$ax_pthread_save_CFLAGS" | |
392 | LIBS="$ax_pthread_save_LIBS" | |
393 | ||
394 | AC_MSG_RESULT([$ax_pthread_ok]) | |
395 | AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) | |
396 | ||
397 | PTHREAD_LIBS="" | |
398 | PTHREAD_CFLAGS="" | |
325 | case $ax_pthread_try_flag in | |
326 | none) | |
327 | AC_MSG_CHECKING([whether pthreads work without any flags]) | |
328 | ;; | |
329 | ||
330 | -mt,pthread) | |
331 | AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) | |
332 | PTHREAD_CFLAGS="-mt" | |
333 | PTHREAD_LIBS="-lpthread" | |
334 | ;; | |
335 | ||
336 | -*) | |
337 | AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) | |
338 | PTHREAD_CFLAGS="$ax_pthread_try_flag" | |
339 | ;; | |
340 | ||
341 | pthread-config) | |
342 | AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) | |
343 | AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) | |
344 | PTHREAD_CFLAGS="`pthread-config --cflags`" | |
345 | PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" | |
346 | ;; | |
347 | ||
348 | *) | |
349 | AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) | |
350 | PTHREAD_LIBS="-l$ax_pthread_try_flag" | |
351 | ;; | |
352 | esac | |
353 | ||
354 | ax_pthread_save_CFLAGS="$CFLAGS" | |
355 | ax_pthread_save_LIBS="$LIBS" | |
356 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
357 | LIBS="$PTHREAD_LIBS $LIBS" | |
358 | ||
359 | # Check for various functions. We must include pthread.h, | |
360 | # since some functions may be macros. (On the Sequent, we | |
361 | # need a special flag -Kthread to make this header compile.) | |
362 | # We check for pthread_join because it is in -lpthread on IRIX | |
363 | # while pthread_create is in libc. We check for pthread_attr_init | |
364 | # due to DEC craziness with -lpthreads. We check for | |
365 | # pthread_cleanup_push because it is one of the few pthread | |
366 | # functions on Solaris that doesn't have a non-functional libc stub. | |
367 | # We try pthread_create on general principles. | |
368 | ||
369 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> | |
370 | # if $ax_pthread_check_cond | |
371 | # error "$ax_pthread_check_macro must be defined" | |
372 | # endif | |
373 | static void routine(void *a) { a = 0; } | |
374 | static void *start_routine(void *a) { return a; }], | |
375 | [pthread_t th; pthread_attr_t attr; | |
376 | pthread_create(&th, 0, start_routine, 0); | |
377 | pthread_join(th, 0); | |
378 | pthread_attr_init(&attr); | |
379 | pthread_cleanup_push(routine, 0); | |
380 | pthread_cleanup_pop(0) /* ; */])], | |
381 | [ax_pthread_ok=yes], | |
382 | []) | |
383 | ||
384 | CFLAGS="$ax_pthread_save_CFLAGS" | |
385 | LIBS="$ax_pthread_save_LIBS" | |
386 | ||
387 | AC_MSG_RESULT([$ax_pthread_ok]) | |
388 | AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) | |
389 | ||
390 | PTHREAD_LIBS="" | |
391 | PTHREAD_CFLAGS="" | |
399 | 392 | done |
400 | 393 | fi |
401 | 394 | |
402 | 395 | # Various other checks: |
403 | 396 | if test "x$ax_pthread_ok" = "xyes"; then |
404 | ax_pthread_save_CFLAGS="$CFLAGS" | |
405 | ax_pthread_save_LIBS="$LIBS" | |
406 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
407 | LIBS="$PTHREAD_LIBS $LIBS" | |
408 | ||
409 | # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. | |
410 | AC_CACHE_CHECK([for joinable pthread attribute], | |
411 | [ax_cv_PTHREAD_JOINABLE_ATTR], | |
412 | [ax_cv_PTHREAD_JOINABLE_ATTR=unknown | |
413 | for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do | |
414 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], | |
415 | [int attr = $ax_pthread_attr; return attr /* ; */])], | |
416 | [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], | |
417 | []) | |
418 | done | |
419 | ]) | |
420 | AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ | |
421 | test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ | |
422 | test "x$ax_pthread_joinable_attr_defined" != "xyes"], | |
423 | [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], | |
424 | [$ax_cv_PTHREAD_JOINABLE_ATTR], | |
425 | [Define to necessary symbol if this constant | |
426 | uses a non-standard name on your system.]) | |
427 | ax_pthread_joinable_attr_defined=yes | |
428 | ]) | |
429 | ||
430 | AC_CACHE_CHECK([whether more special flags are required for pthreads], | |
431 | [ax_cv_PTHREAD_SPECIAL_FLAGS], | |
432 | [ax_cv_PTHREAD_SPECIAL_FLAGS=no | |
433 | case $host_os in | |
434 | solaris*) | |
435 | ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" | |
436 | ;; | |
437 | esac | |
438 | ]) | |
439 | AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ | |
440 | test "x$ax_pthread_special_flags_added" != "xyes"], | |
441 | [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" | |
442 | ax_pthread_special_flags_added=yes]) | |
443 | ||
444 | AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], | |
445 | [ax_cv_PTHREAD_PRIO_INHERIT], | |
446 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], | |
447 | [[int i = PTHREAD_PRIO_INHERIT;]])], | |
448 | [ax_cv_PTHREAD_PRIO_INHERIT=yes], | |
449 | [ax_cv_PTHREAD_PRIO_INHERIT=no]) | |
450 | ]) | |
451 | AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ | |
452 | test "x$ax_pthread_prio_inherit_defined" != "xyes"], | |
453 | [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) | |
454 | ax_pthread_prio_inherit_defined=yes | |
455 | ]) | |
456 | ||
457 | CFLAGS="$ax_pthread_save_CFLAGS" | |
458 | LIBS="$ax_pthread_save_LIBS" | |
459 | ||
460 | # More AIX lossage: compile with *_r variant | |
461 | if test "x$GCC" != "xyes"; then | |
462 | case $host_os in | |
463 | aix*) | |
464 | AS_CASE(["x/$CC"], | |
465 | [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], | |
466 | [#handle absolute path differently from PATH based program lookup | |
467 | AS_CASE(["x$CC"], | |
468 | [x/*], | |
469 | [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], | |
470 | [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) | |
471 | ;; | |
472 | esac | |
473 | fi | |
397 | ax_pthread_save_CFLAGS="$CFLAGS" | |
398 | ax_pthread_save_LIBS="$LIBS" | |
399 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
400 | LIBS="$PTHREAD_LIBS $LIBS" | |
401 | ||
402 | # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. | |
403 | AC_CACHE_CHECK([for joinable pthread attribute], | |
404 | [ax_cv_PTHREAD_JOINABLE_ATTR], | |
405 | [ax_cv_PTHREAD_JOINABLE_ATTR=unknown | |
406 | for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do | |
407 | AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], | |
408 | [int attr = $ax_pthread_attr; return attr /* ; */])], | |
409 | [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], | |
410 | []) | |
411 | done | |
412 | ]) | |
413 | AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ | |
414 | test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ | |
415 | test "x$ax_pthread_joinable_attr_defined" != "xyes"], | |
416 | [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], | |
417 | [$ax_cv_PTHREAD_JOINABLE_ATTR], | |
418 | [Define to necessary symbol if this constant | |
419 | uses a non-standard name on your system.]) | |
420 | ax_pthread_joinable_attr_defined=yes | |
421 | ]) | |
422 | ||
423 | AC_CACHE_CHECK([whether more special flags are required for pthreads], | |
424 | [ax_cv_PTHREAD_SPECIAL_FLAGS], | |
425 | [ax_cv_PTHREAD_SPECIAL_FLAGS=no | |
426 | case $host_os in | |
427 | solaris*) | |
428 | ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" | |
429 | ;; | |
430 | esac | |
431 | ]) | |
432 | AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ | |
433 | test "x$ax_pthread_special_flags_added" != "xyes"], | |
434 | [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" | |
435 | ax_pthread_special_flags_added=yes]) | |
436 | ||
437 | AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], | |
438 | [ax_cv_PTHREAD_PRIO_INHERIT], | |
439 | [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]], | |
440 | [[int i = PTHREAD_PRIO_INHERIT;]])], | |
441 | [ax_cv_PTHREAD_PRIO_INHERIT=yes], | |
442 | [ax_cv_PTHREAD_PRIO_INHERIT=no]) | |
443 | ]) | |
444 | AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ | |
445 | test "x$ax_pthread_prio_inherit_defined" != "xyes"], | |
446 | [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) | |
447 | ax_pthread_prio_inherit_defined=yes | |
448 | ]) | |
449 | ||
450 | CFLAGS="$ax_pthread_save_CFLAGS" | |
451 | LIBS="$ax_pthread_save_LIBS" | |
452 | ||
453 | # More AIX lossage: compile with *_r variant | |
454 | if test "x$GCC" != "xyes"; then | |
455 | case $host_os in | |
456 | aix*) | |
457 | AS_CASE(["x/$CC"], | |
458 | [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], | |
459 | [#handle absolute path differently from PATH based program lookup | |
460 | AS_CASE(["x$CC"], | |
461 | [x/*], | |
462 | [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], | |
463 | [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) | |
464 | ;; | |
465 | esac | |
466 | fi | |
474 | 467 | fi |
475 | 468 | |
476 | 469 | test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" |
481 | 474 | |
482 | 475 | # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: |
483 | 476 | if test "x$ax_pthread_ok" = "xyes"; then |
484 | ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) | |
485 | : | |
477 | ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) | |
478 | : | |
486 | 479 | else |
487 | ax_pthread_ok=no | |
488 | $2 | |
480 | ax_pthread_ok=no | |
481 | $2 | |
489 | 482 | fi |
490 | ||
491 | # undo hack for Clang analyzer | |
492 | if test "${OLDCC#*$SUBST}" != ${OLDCC}; then | |
493 | CC=${OLDCC} | |
494 | fi | |
495 | ||
496 | 483 | AC_LANG_POP |
497 | 484 | ])dnl AX_PTHREAD |
4 | 4 | LDADD = libfolia.la |
5 | 5 | |
6 | 6 | lib_LTLIBRARIES = libfolia.la |
7 | libfolia_la_LDFLAGS = -version-info 6:3:0 | |
7 | libfolia_la_LDFLAGS = -version-info 7:0:0 | |
8 | 8 | |
9 | 9 | libfolia_la_SOURCES = folia_impl.cxx folia_document.cxx folia_utils.cxx \ |
10 | 10 | folia_types.cxx folia_properties.cxx |
533 | 533 | AM_CXXFLAGS = -std=c++11 -g -O3 -W -Wall -pedantic |
534 | 534 | LDADD = libfolia.la |
535 | 535 | lib_LTLIBRARIES = libfolia.la |
536 | libfolia_la_LDFLAGS = -version-info 6:3:0 | |
536 | libfolia_la_LDFLAGS = -version-info 7:0:0 | |
537 | 537 | libfolia_la_SOURCES = folia_impl.cxx folia_document.cxx folia_utils.cxx \ |
538 | 538 | folia_types.cxx folia_properties.cxx |
539 | 539 |