Codebase list libfolia / 64f885b
New upstream version 1.10.1 proycon 6 years ago
7 changed file(s) with 567 addition(s) and 578 deletion(s). Raw diff Collapse all Expand all
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
09 2017-10-16 Ko van der Sloot <K.vanderSloot@let.ru.nl>
110
211 * 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
04 1.10 2017-10-17
15 Major Release, implementing FoLiA spec 1.5
26 * added text checking for all 1.5 documents and up
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <lamasoftware@science.ru.nl>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='libfolia'
591591 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'
594594 PACKAGE_BUGREPORT='lamasoftware@science.ru.nl'
595595 PACKAGE_URL=''
596596
13571357 # Omit some internal or obsolete options to make the list less imposing.
13581358 # This message is too long to be a string in the A/UX 3.1 sh.
13591359 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.
13611361
13621362 Usage: $0 [OPTION]... [VAR=VALUE]...
13631363
14281428
14291429 if test -n "$ac_init_help"; then
14301430 case $ac_init_help in
1431 short | recursive ) echo "Configuration of libfolia 1.10:";;
1431 short | recursive ) echo "Configuration of libfolia 1.10.1:";;
14321432 esac
14331433 cat <<\_ACEOF
14341434
15551555 test -n "$ac_init_help" && exit $ac_status
15561556 if $ac_init_version; then
15571557 cat <<\_ACEOF
1558 libfolia configure 1.10
1558 libfolia configure 1.10.1
15591559 generated by GNU Autoconf 2.69
15601560
15611561 Copyright (C) 2012 Free Software Foundation, Inc.
20752075 This file contains any messages produced by compilers while
20762076 running configure, to aid debugging if configure makes a mistake.
20772077
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
20792079 generated by GNU Autoconf 2.69. Invocation command line was
20802080
20812081 $ $0 $@
29382938
29392939 # Define the identity of the package.
29402940 PACKAGE='libfolia'
2941 VERSION='1.10'
2941 VERSION='1.10.1'
29422942
29432943
29442944 cat >>confdefs.h <<_ACEOF
1607616076
1607716077 ax_pthread_ok=no
1607816078
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
1608616079 # We used to check for pthread.h first, but this fails if pthread.h
1608716080 # requires special compiler flags (e.g. on Tru64 or Sequent).
1608816081 # It gets checked for in the link test anyway.
1609116084 # etcetera environment variables, and if threads linking works using
1609216085 # them:
1609316086 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 :
1609816091 CC="$PTHREAD_CC"
1609916092 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
1610316096 $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
1610516098 /* end confdefs.h. */
1610616099
1610716100 /* Override any GCC internal prototype to avoid an error.
1612416117 fi
1612516118 rm -f core conftest.err conftest.$ac_objext \
1612616119 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
1612816121 $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"
1613616129 fi
1613716130
1613816131 # We must check for the threads library under a number of different
1616916162
1617016163 case $host_os in
1617116164
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
1619616189 /* end confdefs.h. */
1619716190
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
1620116194
1620216195 _ACEOF
1620316196 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1620716200 fi
1620816201 rm -f conftest*
1620916202
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 ;;
1622416217 esac
1622516218
1622616219 # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
1623416227 # correctly enabled
1623516228
1623616229 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 ;;
1624816241 esac
1624916242 if test "x$ax_pthread_check_macro" = "x--"; then :
1625016243 ax_pthread_check_cond=0
1625116244 else
1625216245 ax_pthread_check_cond="!defined($ax_pthread_check_macro)"
1625316246 fi
16247
16248 # Are we compiling with Clang?
1625416249
1625516250 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5
1625616251 $as_echo_n "checking whether $CC is Clang... " >&6; }
1626016255 ax_cv_PTHREAD_CLANG=no
1626116256 # Note that Autoconf sets GCC=yes for Clang as well as GCC
1626216257 if test "x$GCC" = "xyes"; then
16263 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16258 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1626416259 /* end confdefs.h. */
1626516260 /* 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
1626916264
1627016265 _ACEOF
1627116266 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1628816283
1628916284 if test "x$ax_pthread_clang" = "xyes"; then
1629016285
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
1632816323 $as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; }
1632916324 if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then :
1633016325 $as_echo_n "(cached) " >&6
1633116326 else
1633216327 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 :
1634416339 break
1634516340 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
1634916344 /* end confdefs.h. */
1635016345 int main(void){return 0;}
1635116346 _ACEOF
1635216347 if ac_fn_c_try_link "$LINENO"; then :
1635316348 ac_link="$ax_pthread_2step_ac_link"
16354 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16349 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1635516350 /* end confdefs.h. */
1635616351 int main(void){return 0;}
1635716352 _ACEOF
1636416359 fi
1636516360 rm -f core conftest.err conftest.$ac_objext \
1636616361 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 :
1637116366 ax_pthread_try=no
1637216367 fi
16373 ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
16368 ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
1637416369
1637516370 fi
1637616371 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5
1637716372 $as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; }
1637816373
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
1638316378
1638416379 fi # $ax_pthread_clang = yes
1638516380
1638616381 if test "x$ax_pthread_ok" = "xno"; then
1638716382 for ax_pthread_try_flag in $ax_pthread_flags; do
1638816383
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
1639216387 $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
1639716392 $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
1640416399 $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.
1641016405 set dummy pthread-config; ac_word=$2
1641116406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
1641216407 $as_echo_n "checking for $ac_word... " >&6; }
1644416439 fi
1644516440
1644616441
16447 if test "x$ax_pthread_config" = "xno"; then :
16442 if test "x$ax_pthread_config" = "xno"; then :
1644816443 continue
1644916444 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
1645616451 $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
1647716472 /* end confdefs.h. */
1647816473 #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; }
1648416479 int
1648516480 main ()
1648616481 {
1648716482 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) /* ; */
1649316488 ;
1649416489 return 0;
1649516490 }
1650016495 rm -f core conftest.err conftest.$ac_objext \
1650116496 conftest$ac_exeext conftest.$ac_ext
1650216497
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
1650716502 $as_echo "$ax_pthread_ok" >&6; }
16508 if test "x$ax_pthread_ok" = "xyes"; then :
16503 if test "x$ax_pthread_ok" = "xyes"; then :
1650916504 break
1651016505 fi
1651116506
16512 PTHREAD_LIBS=""
16513 PTHREAD_CFLAGS=""
16507 PTHREAD_LIBS=""
16508 PTHREAD_CFLAGS=""
1651416509 done
1651516510 fi
1651616511
1651716512 # Various other checks:
1651816513 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
1652616521 $as_echo_n "checking for joinable pthread attribute... " >&6; }
1652716522 if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then :
1652816523 $as_echo_n "(cached) " >&6
1652916524 else
1653016525 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
1653316528 /* end confdefs.h. */
1653416529 #include <pthread.h>
1653516530 int
1654516540 fi
1654616541 rm -f core conftest.err conftest.$ac_objext \
1654716542 conftest$ac_exeext conftest.$ac_ext
16548 done
16543 done
1654916544
1655016545 fi
1655116546 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5
1655216547 $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 :
1655616551
1655716552 cat >>confdefs.h <<_ACEOF
1655816553 #define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR
1655916554 _ACEOF
1656016555
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
1656616561 $as_echo_n "checking whether more special flags are required for pthreads... " >&6; }
1656716562 if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then :
1656816563 $as_echo_n "(cached) " >&6
1656916564 else
1657016565 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
1657616571
1657716572 fi
1657816573 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5
1657916574 $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 :
1658216577 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
1658716582 $as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; }
1658816583 if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then :
1658916584 $as_echo_n "(cached) " >&6
1661016605 fi
1661116606 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5
1661216607 $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 :
1661516610
1661616611 $as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h
1661716612
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 #(
1663016625 x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) :
1663116626 #handle absolute path differently from PATH based program lookup
16632 case "x$CC" in #(
16627 case "x$CC" in #(
1663316628 x/*) :
1663416629 if as_fn_executable_p ${CC}_r; then :
1663516630 PTHREAD_CC="${CC}_r"
1668216677 *) :
1668316678 ;;
1668416679 esac
16685 ;;
16686 esac
16687 fi
16680 ;;
16681 esac
16682 fi
1668816683 fi
1668916684
1669016685 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
1669816693
1669916694 $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
1670016695
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
1671216701 ac_ext=cpp
1671316702 ac_cpp='$CXXCPP $CPPFLAGS'
1671416703 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1779817787 # report actual input values of CONFIG_FILES etc. instead of their
1779917788 # values after options handling.
1780017789 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
1780217791 generated by GNU Autoconf 2.69. Invocation command line was
1780317792
1780417793 CONFIG_FILES = $CONFIG_FILES
1786417853 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1786517854 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1786617855 ac_cs_version="\\
17867 libfolia config.status 1.10
17856 libfolia config.status 1.10.1
1786817857 configured by $0, generated by GNU Autoconf 2.69,
1786917858 with options \\"\$ac_cs_config\\"
1787017859
11 # Process this file with autoconf to produce a configure script.
22
33 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])
55 AM_INIT_AUTOMAKE([foreign])
66 AC_CONFIG_SRCDIR([configure.ac])
77 AC_CONFIG_MACRO_DIR([m4])
00 # ===========================================================================
1 # http://www.gnu.org/software/autoconf-archive/ax_pthread.html
1 # https://www.gnu.org/software/autoconf-archive/ax_pthread.html
22 # ===========================================================================
33 #
44 # SYNOPSIS
55 #
66 # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
7 #
8 # Ko vd Sloot: special hacked version to survive clang's cc-analyser usage
97 #
108 # DESCRIPTION
119 #
6866 # Public License for more details.
6967 #
7068 # 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/>.
7270 #
7371 # As a special exception, the respective Autoconf Macro's copyright owner
7472 # gives unlimited permission to copy, distribute and modify the configure
8381 # modified version of the Autoconf Macro, you may extend this special
8482 # exception to the GPL to apply to your modified version as well.
8583
86 #serial 222
84 #serial 24
8785
8886 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
8987 AC_DEFUN([AX_PTHREAD], [
9391 AC_LANG_PUSH([C])
9492 ax_pthread_ok=no
9593
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
10394 # We used to check for pthread.h first, but this fails if pthread.h
10495 # requires special compiler flags (e.g. on Tru64 or Sequent).
10596 # It gets checked for in the link test anyway.
10899 # etcetera environment variables, and if threads linking works using
109100 # them:
110101 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"
127118 fi
128119
129120 # We must check for the threads library under a number of different
160151
161152 case $host_os in
162153
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 ;;
207198 esac
208199
209200 # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
216207 # correctly enabled
217208
218209 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 ;;
230221 esac
231222 AS_IF([test "x$ax_pthread_check_macro" = "x--"],
232223 [ax_pthread_check_cond=0],
233224 [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
225
226 # Are we compiling with Clang?
234227
235228 AC_CACHE_CHECK([whether $CC is Clang],
236229 [ax_cv_PTHREAD_CLANG],
237230 [ax_cv_PTHREAD_CLANG=no
238231 # Note that Autoconf sets GCC=yes for Clang as well as GCC
239232 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])
247240 fi
248241 ])
249242 ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
255248
256249 if test "x$ax_pthread_clang" = "xyes"; then
257250
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
326319
327320 fi # $ax_pthread_clang = yes
328321
329322 if test "x$ax_pthread_ok" = "xno"; then
330323 for ax_pthread_try_flag in $ax_pthread_flags; do
331324
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=""
399392 done
400393 fi
401394
402395 # Various other checks:
403396 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
474467 fi
475468
476469 test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
481474
482475 # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
483476 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 :
486479 else
487 ax_pthread_ok=no
488 $2
480 ax_pthread_ok=no
481 $2
489482 fi
490
491 # undo hack for Clang analyzer
492 if test "${OLDCC#*$SUBST}" != ${OLDCC}; then
493 CC=${OLDCC}
494 fi
495
496483 AC_LANG_POP
497484 ])dnl AX_PTHREAD
44 LDADD = libfolia.la
55
66 lib_LTLIBRARIES = libfolia.la
7 libfolia_la_LDFLAGS = -version-info 6:3:0
7 libfolia_la_LDFLAGS = -version-info 7:0:0
88
99 libfolia_la_SOURCES = folia_impl.cxx folia_document.cxx folia_utils.cxx \
1010 folia_types.cxx folia_properties.cxx
533533 AM_CXXFLAGS = -std=c++11 -g -O3 -W -Wall -pedantic
534534 LDADD = libfolia.la
535535 lib_LTLIBRARIES = libfolia.la
536 libfolia_la_LDFLAGS = -version-info 6:3:0
536 libfolia_la_LDFLAGS = -version-info 7:0:0
537537 libfolia_la_SOURCES = folia_impl.cxx folia_document.cxx folia_utils.cxx \
538538 folia_types.cxx folia_properties.cxx
539539