diff options
author | Sean Bright <sean@malleable.com> | 2009-01-16 14:18:10 +0000 |
---|---|---|
committer | Sean Bright <sean@malleable.com> | 2009-01-16 14:18:10 +0000 |
commit | d1679d45cd5664b707ece84431ca1d20f5637180 (patch) | |
tree | dd8ff62cc74fc06458517143317ccbb95a176ee5 /configure | |
parent | 275052c583ab7604d585c17c000725950a762aba (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')
-rwxr-xr-x | configure | 125 |
1 files changed, 70 insertions, 55 deletions
@@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 4904 . +# From configure.ac Revision: 4977 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -4420,17 +4420,10 @@ _ACEOF fi - - if test "x${PBX_HDLC}" != "x1"; then - { echo "$as_me:$LINENO: checking for GENERIC_HDLC_VERSION in linux/hdlc.h" >&5 -echo $ECHO_N "checking for GENERIC_HDLC_VERSION in linux/hdlc.h... $ECHO_C" >&6; } - saved_cppflags="${CPPFLAGS}" - if test "x${HDLC_DIR}" != "x"; then - HDLC_INCLUDE="-I${HDLC_DIR}/include" - fi - CPPFLAGS="${CPPFLAGS} ${HDLC_INCLUDE}" - - cat >conftest.$ac_ext <<_ACEOF +PBX_HDLC=0 +{ echo "$as_me:$LINENO: checking for GENERIC_HDLC_VERSION version 4 in linux/hdlc.h" >&5 +echo $ECHO_N "checking for GENERIC_HDLC_VERSION version 4 in linux/hdlc.h... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4440,13 +4433,12 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -#if defined(GENERIC_HDLC_VERSION) - int foo = 0; - #else - int foo = bar; - #endif - 0 - +#if defined(GENERIC_HDLC_VERSION) && GENERIC_HDLC_VERSION >= 4 + int foo = 0; + #else + int foo = bar; + #endif + 0 ; return 0; } @@ -4468,32 +4460,80 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 + { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } - PBX_HDLC=1 + PBX_HDLC=1 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<\_ACEOF -#define HAVE_HDLC 1 -_ACEOF + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi -cat >>confdefs.h <<\_ACEOF -#define HAVE_HDLC_VERSION 4 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $PBX_HDLC = 0; then + { echo "$as_me:$LINENO: checking for GENERIC_HDLC_VERSION version 4 in linux/hdlc/ioctl.h" >&5 +echo $ECHO_N "checking for GENERIC_HDLC_VERSION version 4 in linux/hdlc/ioctl.h... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - + #include <sys/socket.h> + #include <linux/if.h> +int +main () +{ +#if defined(GENERIC_HDLC_VERSION) && GENERIC_HDLC_VERSION >= 4 + int foo = 0; + #else + int foo = bar; + #endif + 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + PBX_HDLC=1 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 + { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="${saved_cppflags}" - fi +fi + +if test "x${PBX_HDLC}" != "x1"; then + { echo "$as_me:$LINENO: GENERIC_HDLC_VERSION (version 4) not found, disabling sethdlc." >&5 +echo "$as_me: GENERIC_HDLC_VERSION (version 4) not found, disabling sethdlc." >&6;} +fi @@ -4560,31 +4600,6 @@ echo "$as_me: error: failed to find pppd/patchlevel.h: no ppp support." >&2;} ;; esac -if test "x${PBX_HDLC}" == "x1"; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <linux/hdlc.h> - VERSION = GENERIC_HDLC_VERSION -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "VERSION = 4" >/dev/null 2>&1; then - : -else - PBX_HDLC=0 -fi -rm -f conftest* - -fi - -if test "x${PBX_HDLC}" != "x1"; then - { echo "$as_me:$LINENO: GENERIC_HDLC_VERSION version 4 not found, disabling sethdlc." >&5 -echo "$as_me: GENERIC_HDLC_VERSION version 4 not found, disabling sethdlc." >&6;} -fi - if test "x${PBX_DAHDI}" != "x1"; then { echo "$as_me:$LINENO: ***" >&5 echo "$as_me: ***" >&6;} |