2 dnl A52_CHECK-LIBHEADER(FEATURE-NAME, LIB-NAME, LIB-FUNCTION, HEADER-NAME,
3 dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND,
4 dnl EXTRA-LDFLAGS, EXTRA-CPPFLAGS)
6 dnl FEATURE-NAME - feature name; library and header files are treated
7 dnl as feature, which we look for
8 dnl LIB-NAME - library name as in AC_CHECK_LIB macro
9 dnl LIB-FUNCTION - library symbol as in AC_CHECK_LIB macro
10 dnl HEADER-NAME - header file name as in AC_CHECK_HEADER
11 dnl ACTION-IF-FOUND - when feature is found then execute given action
12 dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
13 dnl EXTRA-LDFLAGS - extra linker flags (-L or -l)
14 dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include
16 dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1.
18 AC_DEFUN([A52_CHECK_LIBHEADER],
20 AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7])
21 check_libheader_feature_name=translit([$1], A-Z, a-z)
23 if test "x$HAVE_[$1]" = "xyes"; then
24 check_libheader_save_CPPFLAGS=$CPPFLAGS
25 CPPFLAGS="[$8] $CPPFLAGS"
26 AC_CHECK_HEADER([$4], :, HAVE_[$1]=no)
27 CPPFLAGS=$check_libheader_save_CPPFLAGS
30 if test "x$HAVE_[$1]" = "xyes"; then
31 ifelse([$5], , :, [$5])
33 ifelse([$6], , :, [$6])
39 dnl AC_CHECK_A52DEC(ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
41 dnl ACTION-IF-FOUND - when feature is found then execute given action
42 dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
44 dnl Defines HAVE_A52DEC to yes if liba52 is found
46 dnl CFLAGS and LDFLAGS for the library are stored in A52DEC_CFLAGS and
47 dnl A52DEC_LIBS, respectively
49 dnl Based on GST_CHECK_A52DEC from gstreamer plugins 0.3.3.1
50 dnl Thomas Vander Stichele <thomas@apestaart.org>, Andy Wingo <wingo@pobox.com>
52 AC_DEFUN([AC_CHECK_A52DEC],
54 AC_ARG_WITH(a52dec-prefix,
55 AC_HELP_STRING([--with-a52dec-prefix=PFX],
56 [prefix where a52dec is installed (optional)]),
57 a52dec_config_prefix="$withval", a52dec_config_prefix="")
59 if test x$a52dec_config_prefix = x ; then
60 A52_CHECK_LIBHEADER(A52DEC, a52, a52_init, a52dec/a52.h,
61 A52DEC_LIBS="-la52 -lm", , -lm)
63 A52_CHECK_LIBHEADER(A52DEC, a52, a52_init, a52dec/a52.h, [
64 A52DEC_LIBS="-la52 -L$a52dec_config_prefix/lib -lm"
65 A52DEC_CFLAGS="-I$a52dec_config_prefix/include"
66 ], , -L$a52dec_config_prefix/lib, -I$a52dec_config_prefix/include)
69 if test $HAVE_A52DEC = "yes"; then
70 ac_save_CFLAGS="$CFLAGS"
72 CFLAGS="$CFLAGS $A52DEC_CFLAGS"
73 LIBS="$A52DEC_LIBS $LIBS"
76 #include <a52dec/a52.h>
86 ],, HAVE_A52DEC=no, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
88 if test HAVE_A52DEC = "no"; then
89 echo "*** Your a52dec is borked somehow. Please update to 0.7.4."
93 #include <a52dec/a52.h>
99 int i = sizeof (state);
103 ], HAVE_A52DEC=no,, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
105 if test HAVE_A52DEC = "no"; then
106 echo "*** Your a52dec is too old. Please update to 0.7.4."
109 CFLAGS="$ac_save_CFLAGS"
113 if test HAVE_A52DEC = "no"; then
118 if test "x$HAVE_A52DEC" = "xyes"; then
119 ifelse([$1], , :, [$1])
121 ifelse([$2], , :, [$2])
124 AC_SUBST(A52DEC_CFLAGS)
125 AC_SUBST(A52DEC_LIBS)