libtool-cross 2.2.6[ab]: Drop legacy staging, taken from poky
[openembedded.git] / recipes / xmms / files / acinclude.m4
blob099d55b0b2ec1d6867ff40ac3fd97b37d5201ed2
1 dnl XMMS_FUNC_POSIX(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
2 dnl Test for functions in posix libraries, and define POSIX_LIBS
3 AC_DEFUN(XMMS_FUNC_POSIX,
4 [dnl
5     xmms_posix4=no
6     xmms_rt=no
7     for xmms_func in $1
8     do
9         xmms_have_func=no
10         AC_CHECK_FUNC($xmms_func,xmms_have_func=yes,[
11             dnl try in libposix4 if not found in current LIBS
12             AC_CHECK_LIB(posix4,$xmms_func,[xmms_have_func=yes xmms_posix4=yes],[
13                 dnl try in librt, if not found so far
14                 AC_CHECK_LIB(rt,$xmms_func,[xmms_have_func=yes xmms_rt=yes])
15             ])
16         ])
17         if test $xmms_have_func = yes; then
18             changequote(, )dnl
19             xmms_tr_func=HAVE_`echo $xmms_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
20             changequote([, ])dnl
21             AC_DEFINE_UNQUOTED($xmms_tr_func)
22             ifelse([$2], , :, [$2])
23         else
24             ifelse([$3], , :, [$3])
25         fi
26     done
27     POSIX_LIBS=
28     if test $xmms_posix4 = yes; then
29         POSIX_LIBS=-lposix4
30     fi
31     if test $xmms_rt = yes; then
32         POSIX_LIBS="$POSIX_LIBS -lrt"
33     fi
34     AC_SUBST(POSIX_LIBS)