1
# ====================================================================
3
# ====================================================================
5
# This script has been downloaded from
6
# http://autoconf-archive.cryp.to/acx_pthread.html
8
# Copyright © 2006 Steven G. Johnson <stevenj@alum.mit.edu>
10
# This program is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
12
# the Free Software Foundation; either version 2 of the License, or (at
13
# your option) any later version.
15
# This program is distributed in the hope that it will be useful, but
16
# WITHOUT ANY WARRANTY; without even the implied warranty of
17
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
# General Public License for more details.
20
# You should have received a copy of the GNU General Public License
21
# along with this program; if not, write to the Free Software
22
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
25
# As a special exception, the respective Autoconf Macro's copyright
26
# owner gives unlimited permission to copy, distribute and modify the
27
# configure scripts that are the output of Autoconf when processing the
28
# Macro. You need not follow the terms of the GNU General Public
29
# License when using or distributing such scripts, even though portions
30
# of the text of the Macro appear in them. The GNU General Public
31
# License (GPL) does govern all other use of the material that
32
# constitutes the Autoconf Macro.
34
# This special exception to the GPL applies to versions of the
35
# Autoconf Macro released by the Autoconf Macro Archive. When you make
36
# and distribute a modified version of the Autoconf Macro, you may
37
# extend this special exception to the GPL to apply to your modified
40
AC_DEFUN([ACX_PTHREAD], [
41
AC_REQUIRE([AC_CANONICAL_HOST])
46
# We used to check for pthread.h first, but this fails if pthread.h
47
# requires special compiler flags (e.g. on True64 or Sequent).
48
# It gets checked for in the link test anyway.
50
# First of all, check if the user has set any of the PTHREAD_LIBS,
51
# etcetera environment variables, and if threads linking works using
53
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
55
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
57
LIBS="$PTHREAD_LIBS $LIBS"
58
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
59
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
60
AC_MSG_RESULT($acx_pthread_ok)
61
if test x"$acx_pthread_ok" = xno; then
69
# We must check for the threads library under a number of different
70
# names; the ordering is very important because some systems
71
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
72
# libraries is broken (non-POSIX).
74
# Create a list of thread flags to try. Items starting with a "-" are
75
# C compiler flags, and other items are library names, except for "none"
76
# which indicates that we try without any flags at all, and "pthread-config"
77
# which is a program returning the flags for the Pth emulation library.
79
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
81
# The ordering *is* (sometimes) important. Some notes on the
82
# individual items follow:
84
# pthreads: AIX (must check this before -lpthread)
85
# none: in case threads are in libc; should be tried before -Kthread and
86
# other compiler flags to prevent continual compiler warnings
87
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
88
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
89
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
90
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
91
# -pthreads: Solaris/gcc
92
# -mthreads: Mingw32/gcc, Lynx/gcc
93
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
94
# doesn't hurt to check since this sometimes defines pthreads too;
95
# also defines -D_REENTRANT)
96
# ... -mt is also the pthreads flag for HP/aCC
97
# pthread: Linux, etcetera
98
# --thread-safe: KAI C++
99
# pthread-config: use pthread-config program (for GNU Pth library)
101
case "${host_cpu}-${host_os}" in
104
# On Solaris (at least, for some versions), libc contains stubbed
105
# (non-functional) versions of the pthreads routines, so link-based
106
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
107
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
108
# a function called by this macro, so we could check for that, but
109
# who knows whether they'll stub that too in a future libc.) So,
110
# we'll just look for -pthreads and -lpthread first:
112
acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
116
if test x"$acx_pthread_ok" = xno; then
117
for flag in $acx_pthread_flags; do
121
AC_MSG_CHECKING([whether pthreads work without any flags])
125
AC_MSG_CHECKING([whether pthreads work with $flag])
126
PTHREAD_CFLAGS="$flag"
130
AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
131
if test x"$acx_pthread_config" = xno; then continue; fi
132
PTHREAD_CFLAGS="`pthread-config --cflags`"
133
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
137
AC_MSG_CHECKING([for the pthreads library -l$flag])
138
PTHREAD_LIBS="-l$flag"
143
save_CFLAGS="$CFLAGS"
144
LIBS="$PTHREAD_LIBS $LIBS"
145
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
147
# Check for various functions. We must include pthread.h,
148
# since some functions may be macros. (On the Sequent, we
149
# need a special flag -Kthread to make this header compile.)
150
# We check for pthread_join because it is in -lpthread on IRIX
151
# while pthread_create is in libc. We check for pthread_attr_init
152
# due to DEC craziness with -lpthreads. We check for
153
# pthread_cleanup_push because it is one of the few pthread
154
# functions on Solaris that doesn't have a non-functional libc stub.
155
# We try pthread_create on general principles.
156
AC_TRY_LINK([#include <pthread.h>],
157
[pthread_t th; pthread_join(th, 0);
158
pthread_attr_init(0); pthread_cleanup_push(0, 0);
159
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
160
[acx_pthread_ok=yes])
163
CFLAGS="$save_CFLAGS"
165
AC_MSG_RESULT($acx_pthread_ok)
166
if test "x$acx_pthread_ok" = xyes; then
175
# Various other checks:
176
if test "x$acx_pthread_ok" = xyes; then
178
LIBS="$PTHREAD_LIBS $LIBS"
179
save_CFLAGS="$CFLAGS"
180
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
182
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
183
AC_MSG_CHECKING([for joinable pthread attribute])
185
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
186
AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
187
[attr_name=$attr; break])
189
AC_MSG_RESULT($attr_name)
190
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
191
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
192
[Define to necessary symbol if this constant
193
uses a non-standard name on your system.])
196
AC_MSG_CHECKING([if more special flags are required for pthreads])
198
case "${host_cpu}-${host_os}" in
199
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
200
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
202
AC_MSG_RESULT(${flag})
203
if test "x$flag" != xno; then
204
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
208
CFLAGS="$save_CFLAGS"
210
# More AIX lossage: must compile with xlc_r or cc_r
211
if test x"$GCC" != xyes; then
212
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
220
AC_SUBST(PTHREAD_LIBS)
221
AC_SUBST(PTHREAD_CFLAGS)
224
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
225
if test x"$acx_pthread_ok" = xyes; then
226
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
235
# sets the search path which is used by MT_HAVE_PACKAGE
236
AC_DEFUN([MT_SET_SEARCHPATH],
238
AC_REQUIRE([AC_CANONICAL_HOST])
240
MT_SEARCHPATH="/usr/local"
243
MT_SEARCHPATH="/opt/local"
248
AC_HELP_STRING([--with-search=DIR], [Additionally search for packages in DIR]),
250
MT_SEARCHPATH=$withval
251
AC_MSG_NOTICE([Will also search for packages in ${MT_SEARCHPATH}])
255
MT_SEARCHPATH_HEADERS="${MT_SEARCHPATH}/include"
256
MT_SEARCHPATH_LIBS="${MT_SEARCHPATH}/lib"
257
MT_SEARCHPATH_PROGS="${MT_SEARCHPATH}/bin"
259
AC_SUBST(MT_SEARCHPATH)
260
AC_SUBST(MT_SEARCHPATH_HEADERS)
261
AC_SUBST(MT_SEARCHPATH_LIBS)
262
AC_SUBST(MT_SEARCHPATH_PROGS)
266
# $1 with parameter/package name
271
# mt_$1_library_status
275
AC_DEFUN([MT_CHECK_LIBRARY_INTERNAL],
277
mt_$1_arg_default=yes
278
mt_$1_library_status=yes
281
LDFLAGS_SAVE=$LDFLAGS
283
CXXFLAGS_SAVE=$CXXFLAGS
284
CPPFLAGS_SAVE=$CPPFLAGS
287
AC_HELP_STRING([--with-$1-libs=DIR], [search for $1 libraries in DIR]),
289
mt_$1_search_libs="$withval"
290
AC_MSG_NOTICE([Will search for $1 libs in $withval])
294
if test "$mt_$1_search_libs" ; then
295
unset ac_cv_lib_$2_$3
296
LDFLAGS="$LDFLAGS -L$mt_$1_search_libs"
300
mt_$1_ldflags="-L$mt_$1_search_libs"
303
AC_MSG_ERROR([$1 library not found in requested location $mt_$1_search_libs])
307
unset ac_cv_lib_$2_$3
313
LDFLAGS="$LDFLAGS -L$MT_SEARCHPATH_LIBS"
314
unset ac_cv_lib_$2_$3
318
mt_$1_ldflags="-L$MT_SEARCHPATH_LIBS"
321
mt_$1_library_status=missing
328
if test "x$mt_$1_library_status" != xyes; then
334
LDFLAGS=$LDFLAGS_SAVE
336
CXXFLAGS=$CXXFLAGS_SAVE
337
CPPFLAGS=$CPPFLAGS_SAVE
340
# $1 with parameter / library name
341
# $2 header without .h extension
345
# mt_$1_header_status
348
AC_DEFUN([MT_CHECK_HEADER_INTERNAL],
351
LDFLAGS_SAVE=$LDFLAGS
353
CXXFLAGS_SAVE=$CXXFLAGS
354
CPPFLAGS_SAVE=$CPPFLAGS
356
mt_$1_header_status=yes
359
AC_HELP_STRING([--with-$1-h=DIR], [search for $1 headers in DIR]),
361
mt_$1_search_headers="$withval"
362
AC_MSG_NOTICE([Will search for $1 headers in $withval])
366
if test "$mt_$1_search_headers" ; then
367
unset translit(ac_cv_header_$2_h, `/.-', `___')
368
CFLAGS="$CFLAGS -I${mt_$1_search_headers}"
369
CXXFLAGS="$CXXFLAGS -I${mt_$1_search_headers}"
370
CPPFLAGS="$CPPFLAGS -I${mt_$1_search_headers}"
371
AC_CHECK_HEADER($mt_$1_search_headers/$2.h,
373
mt_$1_cxxflags="-I${mt_$1_search_headers}"
376
mt_$1_header_status=missing
377
if test "$3" = "pass"; then
378
AC_MSG_NOTICE([$1 headers not found in requested location $mt_$1_search_headers])
380
AC_MSG_ERROR([$1 headers not found in requested location $mt_$1_search_headers])
385
unset translit(ac_cv_header_$2_h, `/.-', `___')
386
AC_CHECK_HEADER($2.h,
389
CFLAGS="$CFLAGS -I$MT_SEARCHPATH_HEADERS"
390
CXXFLAGS="$CXXFLAGS -I$MT_SEARCHPATH_HEADERS"
391
CPPFLAGS="$CPPFLAGS -I$MT_SEARCHPATH_HEADERS"
392
unset translit(ac_cv_header_$2_h, `/.-', `___')
393
AC_CHECK_HEADER($MT_SEARCHPATH_HEADERS/$2.h,
395
mt_$1_cxxflags="-I${MT_SEARCHPATH_HEADERS}"
398
mt_$1_header_status=missing
405
if test "x$mt_$1_header_status" != xyes; then
410
LDFLAGS=$LDFLAGS_SAVE
412
CXXFLAGS=$CXXFLAGS_SAVE
413
CPPFLAGS=$CPPFLAGS_SAVE
418
# $2 header name (without .h extension)
423
# mt_$1_package_status
428
AC_DEFUN([MT_CHECK_PACKAGE_INTERNAL],
430
MT_CHECK_HEADER_INTERNAL([$1], [$2])
431
mt_$1_package_status=${mt_$1_header_status}
433
if test "x$mt_$1_package_status" = xyes; then
434
MT_CHECK_LIBRARY_INTERNAL([$1], [$3], [$4])
435
mt_$1_package_status=${mt_$1_library_status}
438
if test "x$mt_$1_package_status" = xyes; then
439
translit($1, `a-z/.-', `A-Z___')_CFLAGS=${mt_$1_cxxflags}
440
translit($1, `a-z/.-', `A-Z___')_LIBS=${mt_$1_libs}
441
translit($1, `a-z/.-', `A-Z___')_LDFLAGS=${mt_$1_ldflags}
448
# $4 action if enabled
449
# $5 action if disabled
453
# $1_OPTION_REQUESTED
455
AC_DEFUN([MT_OPTION],
458
translit(mt_$1_option_enabled, `/.-', `___')=
459
translit(mt_$1_option_requested, `/.-', `___')=no
460
if test "x$2" = xdisable; then
461
translit(mt_$1_option_enabled, `/.-', `___')=yes
463
translit(mt_$1_option_enabled, `/.-', `___')=no
467
AC_HELP_STRING([--$2-$1], [$3]),
469
translit(mt_$1_option_enabled, `/.-', `___')=$enableval
470
translit(mt_$1_option_requested, `/.-', `___')=yes
474
translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED=${translit(mt_$1_option_enabled,`/.-', `___')}
475
translit($1, `a-z/.-', `A-Z___')_OPTION_REQUESTED=${translit(mt_$1_option_requested, `/.-', `___')}
477
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED)
478
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_OPTION_REQUESTED)
480
AS_IF([test "x${translit(mt_$1_option_enabled,`/.-', `___')}" = xyes], [$4], [$5])[]dnl
485
# $3 enable/disable help string
486
# $4 header name (without .h)
495
AC_DEFUN([MT_CHECK_OPTIONAL_PACKAGE],
499
MT_OPTION([$1], [$2], [$3],[],[])
501
if test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED}" = xyes; then
502
MT_CHECK_PACKAGE_INTERNAL([$1], [$4], [$5], [$6])
503
mt_$1_status=${mt_$1_package_status}
505
mt_$1_status=disabled
508
if ((test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED}" = xyes) &&
509
(test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_REQUESTED}" = xyes) &&
510
(test "x$mt_$1_status" != xyes)); then
511
AC_MSG_ERROR([unable to configure $1 support])
514
if test "x$mt_$1_status" = xyes; then
515
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
518
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_status}
520
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
521
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LDFLAGS)
522
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
523
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
527
# $2 header name (without .h)
538
AC_DEFUN([MT_CHECK_REQUIRED_PACKAGE],
540
MT_CHECK_PACKAGE_INTERNAL($1, $2, $3, $4)
541
if test "x$mt_$1_package_status" != xyes; then
542
AC_MSG_ERROR([unable to configure required package $1])
545
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
547
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_package_status}
549
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
550
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
551
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LDFLAGS)
552
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
555
# $1 with parameter name
557
# $3 function to check
558
AC_DEFUN([MT_CHECK_LIBRARY],
560
MT_CHECK_LIBRARY_INTERNAL([$1], [$2], [$3])
562
translit($1, `a-z/.-', `A-Z___')_LIBS=${mt_$1_libs}
563
translit($1, `a-z/.-', `A-Z___')_LDFLAGS=${mt_$1_ldflags}
564
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_library_status}
566
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
567
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LDFLAGS)
568
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
571
# $1 with parameter name
573
# $3 fail or pass in case a path parameter was specified and the header missing
575
AC_DEFUN([MT_CHECK_HEADER],
577
MT_CHECK_HEADER_INTERNAL($1, $2, $3)
579
translit($1, `a-z/.-', `A-Z___')_CFLAGS=${mt_$1_cxxflags}
580
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_header_status}
582
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
583
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
587
# $2 config file name
591
# $6 optional library command
594
# $mt_$1_package_status
599
AC_DEFUN([MT_CHECK_BINCONFIG_INTERNAL],
602
LDFLAGS_SAVE=$LDFLAGS
604
CXXFLAGS_SAVE=$CXXFLAGS
605
CPPFLAGS_SAVE=$CPPFLAGS
609
mt_$1_package_status=yes
612
AC_HELP_STRING([--with-$1-cfg=$2], [absolute path/name of $2]),
614
mt_$1_search_config="$withval"
615
AC_MSG_NOTICE([Will search for $1 config in $withval])
619
if test -n "$mt_$1_search_config"; then
620
AC_MSG_NOTICE([You specified ${mt_$1_search_config} for $2])
621
if test -f "$mt_$1_search_config"; then
622
mt_$1_config=${mt_$1_search_config}
624
AC_MSG_ERROR([${mt_$1_search_config} not found])
627
mt_$1_version=`${mt_$1_config} --version 2>/dev/null`
628
if test -z "$mt_$1_version"; then
629
AC_MSG_ERROR([${mt_$1_search_config} could not be executed or returned invalid values])
632
AC_PATH_PROG(mt_$1_config, $2, none)
633
if test "x$mt_$1_config" = xnone; then
634
unset ac_cv_path_mt_$1_config
635
AC_PATH_PROG(mt_$1_config, $2, none, $MT_SEARCHPATH_PROGS)
636
if test "x$mt_$1_config" = xnone; then
637
mt_$1_package_status=missing
638
AC_MSG_RESULT([$2 not found, please install the $1 devel package])
642
mt_$1_version=`${mt_$1_config} --version 2>/dev/null`
643
if test -z "$mt_$1_version"; then
644
AC_MSG_NOTICE([${mt_$1_config} could not be executed or returned invalid values])
645
mt_$1_package_status=missing
648
if test "x$mt_$1_package_status" = xyes; then
649
AC_MSG_CHECKING([$1 cflags])
650
mt_$1_cxxflags=`${mt_$1_config} --cflags`
651
AC_MSG_RESULT([$mt_$1_cxxflags])
653
AC_MSG_CHECKING([$1 libs])
654
if test -z "$6"; then
655
mt_$1_libs=`${mt_$1_config} --libs`
657
mt_$1_libs=`${mt_$1_config} $6`
659
AC_MSG_RESULT([$mt_$1_libs])
662
if test "x$mt_$1_package_status" = xyes; then
663
CPPFLAGS="$CPPFLAGS $mt_$1_cxxflags"
664
CXXFLAGS="$CXXFLAGS $mt_$1_cxxflags"
665
CFLAGS="$CFLAGS $mt_$1_cxxflags"
666
for mt_u_header in translit($3, `/.-', `___'); do
667
unset ac_cv_header_${mt_u_header}
669
AC_CHECK_HEADERS($3, [], [mt_$1_package_status=missing])
672
if test "x$mt_$1_package_status" = xyes; then
673
LIBS="$mt_$1_libs $LIBS"
674
if test -z "$4"; then
676
AC_CHECK_FUNCS($5, [], [mt_$1_package_status=missing])
678
unset ac_cv_lib_$4_$5
679
AC_CHECK_LIB($4, $5, [], [mt_$1_package_status=missing])
683
if test "x$mt_$1_package_status" = xyes; then
684
translit($1, `a-z/.-', `A-Z___')_CFLAGS=${mt_$1_cxxflags}
685
translit($1, `a-z/.-', `A-Z___')_LIBS=${mt_$1_libs}
686
translit($1, `a-z/.-', `A-Z___')_VERSION=${mt_$1_version}
691
LDFLAGS=$LDFLAGS_SAVE
693
CXXFLAGS=$CXXFLAGS_SAVE
694
CPPFLAGS=$CPPFLAGS_SAVE
699
# $3 enable/disable help string
700
# $4 config file name
704
# $8 custom lib parameter
707
# mt_$1_package_status
712
AC_DEFUN([MT_CHECK_OPTIONAL_PACKAGE_CFG],
717
MT_OPTION([$1], [$2], [$3],[],[])
719
if test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED}" = xyes; then
720
MT_CHECK_BINCONFIG_INTERNAL($1, $4, $5, $6, $7, $8)
721
mt_$1_status=${mt_$1_package_status}
723
mt_$1_status=disabled
726
if ((test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_ENABLED}" = xyes) &&
727
(test "x${translit($1, `a-z/.-', `A-Z___')_OPTION_REQUESTED}" = xyes) &&
728
(test "x$mt_$1_status" != xyes)); then
729
AC_MSG_ERROR([unable to configure $1 support])
732
if test "x$mt_$1_status" = xyes; then
733
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
736
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_status}
738
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
739
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
740
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_VERSION)
741
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
744
# AS_IF([test x"$mt_$1_status" = xyes], [$8], [$9])[]dnl
748
# $2 config file name
754
# $mt_$1_package_status
759
AC_DEFUN([MT_CHECK_REQUIRED_PACKAGE_CFG],
761
MT_CHECK_BINCONFIG_INTERNAL($1, $2, $3, $4, $5)
762
if test "x$mt_$1_package_status" != xyes; then
763
AC_MSG_ERROR([unable to configure required package $1])
766
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_package_status}
768
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
770
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
771
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
772
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_VERSION)
773
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
777
# $2 config file name
783
# $mt_$1_package_status
789
AC_DEFUN([MT_CHECK_PACKAGE_CFG],
793
if test "x$mt_$1_status" = xyes; then
794
MT_CHECK_BINCONFIG_INTERNAL($1, $2, $3, $4, $5)
795
mt_$1_status=${mt_$1_package_status}
798
if test "x$mt_$1_status" = xyes; then
799
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
802
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_status}
804
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
805
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
806
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_VERSION)
807
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)
816
# $mt_$1_package_status
822
AC_DEFUN([MT_CHECK_PACKAGE],
826
if test "x$mt_$1_status" = xyes; then
827
MT_CHECK_PACKAGE_INTERNAL($1, $2, $3, $4)
828
mt_$1_status=${mt_$1_package_status}
831
if test "x$mt_$1_status" = xyes; then
832
AC_DEFINE(translit(HAVE_$1, `a-z/.-', `A-Z___'), [1], [$1 library presence])
835
translit($1, `a-z/.-', `A-Z___')_STATUS=${mt_$1_status}
837
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_CFLAGS)
838
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_LIBS)
839
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_VERSION)
840
AC_SUBST(translit($1, `a-z/.-', `A-Z___')_STATUS)