summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-01-16 14:18:10 +0000
committerSean Bright <sean@malleable.com>2009-01-16 14:18:10 +0000
commitd1679d45cd5664b707ece84431ca1d20f5637180 (patch)
treedd8ff62cc74fc06458517143317ccbb95a176ee5 /configure.ac
parent275052c583ab7604d585c17c000725950a762aba (diff)
Properly detect GENERIC_HDLC_VERSION on various kernel versions.
(closes issue #14150) Reported by: ccesario Patches: 20090115__bug14150.diff.txt uploaded by seanbright (license 71) Tested by: ccesario git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@5662 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac48
1 files changed, 37 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 23929f1..8893fec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,7 +90,43 @@ AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h])
-AST_C_DEFINE_CHECK([HDLC], [GENERIC_HDLC_VERSION], [linux/hdlc.h], [4])
+PBX_HDLC=0
+AC_MSG_CHECKING([for GENERIC_HDLC_VERSION version 4 in linux/hdlc.h])
+AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM( [#include <linux/hdlc.h>],
+ [#if defined(GENERIC_HDLC_VERSION) && GENERIC_HDLC_VERSION >= 4
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0])],
+ [AC_MSG_RESULT(yes)
+ PBX_HDLC=1],
+ [AC_MSG_RESULT(no)]
+)
+if test $PBX_HDLC = 0; then
+ AC_MSG_CHECKING([for GENERIC_HDLC_VERSION version 4 in linux/hdlc/ioctl.h])
+ AC_COMPILE_IFELSE(
+ [ AC_LANG_PROGRAM( [
+ #include <sys/socket.h>
+ #include <linux/if.h>],
+ [#if defined(GENERIC_HDLC_VERSION) && GENERIC_HDLC_VERSION >= 4
+ int foo = 0;
+ #else
+ int foo = bar;
+ #endif
+ 0])],
+ [AC_MSG_RESULT(yes)
+ PBX_HDLC=1],
+ [AC_MSG_RESULT(no)]
+ )
+fi
+
+if test "x${PBX_HDLC}" != "x1"; then
+ AC_MSG_NOTICE([GENERIC_HDLC_VERSION (version 4) not found, disabling sethdlc.])
+fi
+
+AC_SUBST(PBX_HDLC)
AC_ARG_WITH(selinux,
[AS_HELP_STRING([--with-selinux],
@@ -146,16 +182,6 @@ case "$with_ppp" in
;;
esac
-if test "x${PBX_HDLC}" == "x1"; then
- AC_EGREP_CPP([VERSION = 4],
- [#include <linux/hdlc.h>
- VERSION = GENERIC_HDLC_VERSION], [], [PBX_HDLC=0])
-fi
-
-if test "x${PBX_HDLC}" != "x1"; then
- AC_MSG_NOTICE([GENERIC_HDLC_VERSION version 4 not found, disabling sethdlc.])
-fi
-
if test "x${PBX_DAHDI}" != "x1"; then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** Building this package requires DAHDI support. *** ])