Merge remote branch 'remotes/origin/acid-burn/bug_622_swupgrade_networkcheck'
[enigma2.git] / m4 / tuxbox.m4
1 AC_DEFUN([TUXBOX_APPS_DVB],[
2 AC_ARG_WITH(dvbincludes,
3         [  --with-dvbincludes=PATH  path for dvb includes [[NONE]]],
4         [DVBINCLUDES="$withval"],[DVBINCLUDES=""])
5
6 if test "$DVBINCLUDES"; then
7         CPPFLAGS="$CPPFLAGS -I$DVBINCLUDES"
8 fi
9
10 AC_CHECK_HEADERS(ost/dmx.h,[
11         DVB_API_VERSION=1
12         AC_MSG_NOTICE([found dvb version 1])
13 ])
14
15 if test -z "$DVB_API_VERSION"; then
16 AC_CHECK_HEADERS(linux/dvb/version.h,[
17         AC_LANG_PREPROC_REQUIRE()
18         AC_REQUIRE([AC_PROG_EGREP])
19         AC_LANG_CONFTEST([AC_LANG_SOURCE([[
20 #include <linux/dvb/version.h>
21 version DVB_API_VERSION
22         ]])])
23         DVB_API_VERSION=`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD | $EGREP "^version" | sed "s,version\ ,,"`
24         rm -f conftest*
25
26         AC_MSG_NOTICE([found dvb version $DVB_API_VERSION])
27 ])
28 fi
29
30 if test "$DVB_API_VERSION"; then
31         AC_DEFINE(HAVE_DVB,1,[Define to 1 if you have the dvb includes])
32         AC_DEFINE_UNQUOTED(HAVE_DVB_API_VERSION,$DVB_API_VERSION,[Define to the version of the dvb api])
33 else
34         AC_MSG_ERROR([can't find dvb headers])
35 fi
36 ])