re-introduce optional build of DAHDI input plugin

We should only build it when the dahdi/user.h file is actually present.
diff --git a/configure.ac b/configure.ac
index 3fdc050..f14f047 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,7 +38,7 @@
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
 PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
 
-AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_ERROR(DAHDI input driver headers missing))
+AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
 
 AC_OUTPUT(
 	libosmoabis.pc
diff --git a/src/e1_input.c b/src/e1_input.c
index f9d3477..a549ba4 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -20,6 +20,7 @@
  */
 
 #include "internal.h"
+#include "../config.h"
 
 #include <stdio.h>
 #include <unistd.h>
@@ -722,7 +723,9 @@
 	osmo_signal_register_handler(SS_L_GLOBAL, e1i_sig_cb, NULL);
 
 	e1inp_misdn_init();
+#ifdef HAVE_DAHDI_USER_H
 	e1inp_dahdi_init();
+#endif
 	e1inp_ipaccess_init();
 	e1inp_hsl_init();
 	e1inp_rs232_init();
diff --git a/src/input/dahdi.c b/src/input/dahdi.c
index 4fd4e61..a4dbd03 100644
--- a/src/input/dahdi.c
+++ b/src/input/dahdi.c
@@ -22,6 +22,10 @@
  *
  */
 
+#include "../../config.h"
+
+#ifdef HAVE_DAHDI_USER_H
+
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -461,3 +465,5 @@
 	/* register the driver with the core */
 	return e1inp_driver_register(&dahdi_driver);
 }
+
+#endif /* HAVE_DAHDI_USER_H */