diff options
Diffstat (limited to 'm4/check-libheader.m4')
-rw-r--r-- | m4/check-libheader.m4 | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/m4/check-libheader.m4 b/m4/check-libheader.m4 index 1e24d8a97..4e0285336 100644 --- a/m4/check-libheader.m4 +++ b/m4/check-libheader.m4 | |||
@@ -11,30 +11,19 @@ dnl HEADER-NAME - header file name as in AC_CHECK_HEADER | |||
11 | dnl ACTION-IF-FOUND - when feature is found then execute given action | 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 | 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) | 13 | dnl EXTRA-LDFLAGS - extra linker flags (-L or -l) |
14 | dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include | 14 | dnl EXTRA-CPPFLAGS - extra C preprocessor flags, e.g. -I/usr/X11R6/include |
15 | dnl | 15 | dnl |
16 | dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1. | ||
17 | dnl | 16 | dnl |
18 | AC_DEFUN([CHECK_LIBHEADER], | 17 | AC_DEFUN([CHECK_LIBHEADER], |
19 | [ | 18 | [m4_if([$7], ,:,[LDFLAGS="$7 $LDFLAGS"]) |
20 | AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7]) | 19 | m4_if([$8], ,:,[CPPFLAGS="$8 $CPPFLAGS"]) |
21 | check_libheader_feature_name=translit([$1], A-Z, a-z) | ||
22 | |||
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 | ||
28 | fi | ||
29 | |||
30 | if test "x$HAVE_[$1]" = "xyes"; then | ||
31 | ifelse([$5], , :, [$5]) | ||
32 | AC_MSG_NOTICE($check_libheader_feature_name was found) | ||
33 | else | ||
34 | ifelse([$6], , :, [$6]) | ||
35 | AC_MSG_WARN($check_libheader_feature_name not found) | ||
36 | fi | ||
37 | AC_SUBST(HAVE_[$1]) | ||
38 | ] | ||
39 | ) | ||
40 | 20 | ||
21 | AC_CHECK_HEADERS([$4], | ||
22 | [AC_CHECK_LIB([$2], [$3], | ||
23 | [eval "HAVE_]AS_TR_SH([$1])[=yes"] | ||
24 | m4_if([$5], ,:,[$5]), | ||
25 | [eval "HAVE_]AS_TR_SH([$1])[=no"] | ||
26 | m4_if([$6], ,:,[$6]))], | ||
27 | [eval "HAVE_]AS_TR_SH([$1])[=no"] | ||
28 | m4_if([$6], ,:,[$6])) | ||
29 | ])dnl | ||