summaryrefslogtreecommitdiffstats
path: root/m4/check-libheader.m4
diff options
context:
space:
mode:
authorWrobell <wrobell@ite.pl>2002-01-18 14:06:11 +0000
committerWrobell <wrobell@ite.pl>2002-01-18 14:06:11 +0000
commit1fa123ed51a3d00f41ad877162792e23baef852e (patch)
treefb6792b3033943c6c93fa08e388ade2bc3d53386 /m4/check-libheader.m4
parentffd06121fa0e8f48ad278dd68a3e8568c9ee67b5 (diff)
downloadgst-plugins-bad-1fa123ed51a3d00f41ad877162792e23baef852e.tar.gz
gst-plugins-bad-1fa123ed51a3d00f41ad877162792e23baef852e.tar.bz2
gst-plugins-bad-1fa123ed51a3d00f41ad877162792e23baef852e.zip
- CHECK_LIBHEADER macro, which is based on GST_CHECK_LIBHEADER the main difference between them is that you can speci...
Original commit message from CVS: - CHECK_LIBHEADER macro, which is based on GST_CHECK_LIBHEADER the main difference between them is that you can specify cpp flags with CHECK_LIBHEADER
Diffstat (limited to 'm4/check-libheader.m4')
-rw-r--r--m4/check-libheader.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/m4/check-libheader.m4 b/m4/check-libheader.m4
new file mode 100644
index 00000000..42db689b
--- /dev/null
+++ b/m4/check-libheader.m4
@@ -0,0 +1,42 @@
+dnl
+dnl CHECK-LIBHEADER(FEATURE-NAME, LIB-NAME, LIB-FUNCTION, HEADER-NAME,
+dnl ACTION-IF-FOUND, ACTION-IF-NOT-FOUND,
+dnl EXTRA-LDFLAGS, EXTRA-CPPFLAGS)
+dnl
+dnl FEATURE-NAME - feature name; library and header files are treated
+dnl as feature, which we look for
+dnl LIB-NAME - library name as in AC_CHECK_LIB macro
+dnl LIB-FUNCTION - library symbol as in AC_CHECK_LIB macro
+dnl HEADER-NAME - header file name as in AC_CHECK_HEADER
+dnl ACTION-IF-FOUND - when feature is found then execute given action
+dnl ACTION-IF-NOT-FOUND - when feature is not found then execute given action
+dnl EXTRA-LDFLAGS - extra linker flags (-L or -l)
+dnl EXTRA-CPPFLAGS - extra C preprocessor flags, i.e. -I/usr/X11R6/include
+dnl
+dnl Based on GST_CHECK_LIBHEADER from gstreamer plugins 0.3.1.
+dnl
+AC_DEFUN(CHECK_LIBHEADER,
+[
+ AC_CHECK_LIB([$2], [$3], HAVE_[$1]=yes, HAVE_[$1]=no, [$7])
+ check_libheader_feature_name=translit([$1], A-Z, a-z)
+
+ if test "x$HAVE_[$1]" = "xyes"; then
+
+ check_libheader_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="[$8] $CPPFLAGS"
+ AC_CHECK_HEADER([$4], :, HAVE_[$1]=no)
+ CPPFLAGS=$check_libheader_save_CPPFLAGS
+
+ if test "x$HAVE_[$1]" = "xyes"; then
+ dnl execute what needs to be
+ ifelse([$5], , :, [$5])
+ AC_MSG_NOTICE(feature $check_libheader_feature_name is found)
+ else
+ ifelse([$6], , :, [$6])
+ fi
+ else
+ AC_MSG_WARN($check_libheader_feature_name not found)
+ fi
+ AC_SUBST(HAVE_[$1])
+]
+)