SMPP: build the smpp interface only in case of ./configure --enable-smpp
diff --git a/openbsc/configure.ac b/openbsc/configure.ac
index 279d12a..b56254c 100644
--- a/openbsc/configure.ac
+++ b/openbsc/configure.ac
@@ -41,12 +41,23 @@
     ])
 AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
 
+AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
+    [
+        PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
+        osmo_ac_build_smpp="yes"
+	AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP])
+    ],
+    [
+        osmo_ac_build_smpp="no"
+    ])
+AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes")
+
+
 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
 PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
 PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0)
 PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2)
-PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
 
 found_libgtp=yes
 PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no)
diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am
index c29d521..89fee91 100644
--- a/openbsc/src/libmsc/Makefile.am
+++ b/openbsc/src/libmsc/Makefile.am
@@ -16,6 +16,8 @@
 			ussd.c \
 			vty_interface_layer3.c \
 			transaction.c \
-			smpp_smsc.c smpp_openbsc.c \
 			osmo_msc.c
 
+if BUILD_SMPP
+libmsc_a_SOURCES += smpp_smsc.c smpp_openbsc.c
+endif
diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index 2ed31e3..fe1b645 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -117,8 +117,10 @@
 		subscr_put(sms->sender);
 	if (sms->receiver)
 		subscr_put(sms->receiver);
+#ifdef BUILD_SMPP
 	if (sms->smpp.esme)
 		smpp_esme_put(sms->smpp.esme);
+#endif
 
 	talloc_free(sms);
 }
diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c
index fa38f1f..b82a026 100644
--- a/openbsc/src/osmo-nitb/bsc_hack.c
+++ b/openbsc/src/osmo-nitb/bsc_hack.c
@@ -312,10 +312,10 @@
 	/* start the SMS queue */
 	if (sms_queue_start(bsc_gsmnet, 20) != 0)
 		return -1;
-
+#ifdef BUILD_SMPP
 	if (smpp_openbsc_init(bsc_gsmnet, 6040) < 0)
 		return -1;
-
+#endif
 	if (daemonize) {
 		rc = osmo_daemonize();
 		if (rc < 0) {