From ca17ef88f57a373fef29513273e8f24c2492c969 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 5 Feb 2011 15:13:27 +0100 Subject: [PATCH] [DAHDI] build dahdi driver only if dahdi header is present --- openbsc/configure.in | 2 ++ openbsc/src/e1_input.c | 4 ++++ openbsc/src/input/dahdi.c | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/openbsc/configure.in b/openbsc/configure.in index 6aa68d89e..ff6a466b1 100644 --- a/openbsc/configure.in +++ b/openbsc/configure.in @@ -48,6 +48,8 @@ PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.1.19) dnl checks for header files AC_HEADER_STDC +AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) + dnl Checks for typedefs, structures and compiler characteristics diff --git a/openbsc/src/e1_input.c b/openbsc/src/e1_input.c index 823387831..def6aca95 100644 --- a/openbsc/src/e1_input.c +++ b/openbsc/src/e1_input.c @@ -54,6 +54,8 @@ #include #include +#include "../bscconfig.h" + #define NUM_E1_TS 32 /* list of all E1 drivers */ @@ -622,5 +624,7 @@ void e1inp_init(void) register_signal_handler(SS_GLOBAL, e1i_sig_cb, NULL); e1inp_misdn_init(); +#ifdef HAVE_DAHDI_USER_H e1inp_dahdi_init(); +#endif } diff --git a/openbsc/src/input/dahdi.c b/openbsc/src/input/dahdi.c index 8f6bddae3..2615557b2 100644 --- a/openbsc/src/input/dahdi.c +++ b/openbsc/src/input/dahdi.c @@ -22,6 +22,10 @@ * */ +#include "../../bscconfig.h" + +#ifdef HAVE_DAHDI_USER_H + #include #include #include @@ -444,3 +448,5 @@ int e1inp_dahdi_init(void) /* register the driver with the core */ e1inp_driver_register(&dahdi_driver); } + +#endif /* HAVE_DAHDI_USER_H */