[ekiga/gnome-2-26] Various fixes for SIP and H323 configuration



commit 560404dca5ecd84f3aa737f2a2419f0f61e6468c
Author: Mounir Lamouri (volkmar) <mounir lamouri gmail com>
Date:   Mon Aug 31 17:31:44 2009 +0200

    Various fixes for SIP and H323 configuration
    
    SIP support in ekiga is mandatory now.  Add sip/h323 options in
    configure script to let user to explicitely enable or disable
    SIP/H.323 support in ekiga.

 configure.ac                                      |   36 ++++++++++++++-------
 lib/engine/components/opal/Makefile.am            |    2 -
 lib/engine/components/opal/opal-gmconf-bridge.cpp |    4 --
 lib/engine/components/opal/opal-main.cpp          |    6 ---
 4 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4a0f8d8..6b76401 100644
--- a/configure.ac
+++ b/configure.ac
@@ -741,19 +741,33 @@ AC_SUBST(PTLIB_LIBS)
 AC_SUBST(OPAL_CFLAGS)
 AC_SUBST(OPAL_LIBS)
 
-dnl The =1 checks are here only for backward compatibility
-H323=`$PKG_CONFIG --variable=h323 opal`
-if test "x$H323" = "x1"; then
-  H323="yes"
+# check for H.323 support
+AC_ARG_ENABLE(h323, AC_HELP_STRING([--enable-h323],
+              [enable H.323 support (default same as opal)]),
+              enable_h323=$enableval)
+if test x$enable_h323 != xno; then
+  dnl The =1 checks are here only for backward compatibility
+  H323=`$PKG_CONFIG --variable=h323 opal`
+  if test "x$H323" = "x1"; then
+    H323="yes"
+  else
+    H323=`$PKG_CONFIG --variable=OPAL_H323 opal`
+  fi
+
+  if test "x$H323" = "xyes"; then
+    AC_DEFINE(HAVE_H323,1,[H323 support])
+  else
+    if test x$enable_h323 = xyes; then
+      AC_MSG_ERROR([To enable H.323 support you need to re-install opal with H.323 support])
+    fi
+  fi
 else
-  H323=`$PKG_CONFIG --variable=OPAL_H323 opal`
+  H323="no"
 fi
 
-if test "x$H323" = "xyes"; then
-  AC_DEFINE(HAVE_H323,1,[H323 support])
-fi
 AM_CONDITIONAL(HAVE_H323, test "x${H323}" = "xyes")
 
+# check for mandatory SIP support in opal
 SIP=`$PKG_CONFIG --variable=sip opal`
 if test "x$SIP" = "x1"; then
   SIP="yes"
@@ -761,10 +775,9 @@ else
   SIP=`$PKG_CONFIG --variable=OPAL_SIP opal`
 fi
 
-if test "x$SIP" = "xyes"; then
-  AC_DEFINE(HAVE_SIP,1,[SIP support])
+if test "x$SIP" != "xyes"; then
+  AC_MSG_ERROR([You have to compile opal with SIP support. SIP support is mandatory.])
 fi
-AM_CONDITIONAL(HAVE_SIP, test "x${SIP}" = "xyes")
 
 
 dnl #########################################################################
@@ -887,7 +900,6 @@ echo "                 DirectX support  :  $DX"
 fi
 echo ""
 echo "                   H.323 support  :  $H323"
-echo "                     SIP support  :  $SIP"
 echo ""
 if test "x${gm_platform}" != "xmingw" ; then
 echo "                    DBUS support  :  $DBUS"
diff --git a/lib/engine/components/opal/Makefile.am b/lib/engine/components/opal/Makefile.am
index 160fd22..5240e01 100644
--- a/lib/engine/components/opal/Makefile.am
+++ b/lib/engine/components/opal/Makefile.am
@@ -52,7 +52,6 @@ libgmopal_la_SOURCES += \
 	$(opal_dir)/h323-endpoint.cpp
 endif
 
-if HAVE_SIP
 libgmopal_la_SOURCES += \
 	$(opal_dir)/sip-chat-simple.h \
 	$(opal_dir)/sip-chat-simple.cpp \
@@ -60,6 +59,5 @@ libgmopal_la_SOURCES += \
 	$(opal_dir)/sip-dialect.cpp \
 	$(opal_dir)/sip-endpoint.h \
 	$(opal_dir)/sip-endpoint.cpp
-endif
 
 libgmopal_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS) $(GLIB_LIBS) $(OPAL_LIBS) $(PTLIB_LIBS)
diff --git a/lib/engine/components/opal/opal-gmconf-bridge.cpp b/lib/engine/components/opal/opal-gmconf-bridge.cpp
index 0083a93..baf5d8b 100644
--- a/lib/engine/components/opal/opal-gmconf-bridge.cpp
+++ b/lib/engine/components/opal/opal-gmconf-bridge.cpp
@@ -44,9 +44,7 @@
 #include "opal-gmconf-bridge.h"
 #include "opal-call-manager.h"
 
-#ifdef HAVE_SIP
 #include "sip-endpoint.h"
-#endif 
 
 #ifdef HAVE_H323
 #include "h323-endpoint.h"
@@ -262,7 +260,6 @@ void ConfBridge::on_property_changed (std::string key, GmConfEntry *entry)
   //
   // SIP related keys
   // 
-#ifdef HAVE_SIP
   else if (key.find (SIP_KEY) != string::npos) {
 
     gmref_ptr<Opal::Sip::EndPoint> sip_manager = manager.get_protocol_manager ("sip");
@@ -290,7 +287,6 @@ void ConfBridge::on_property_changed (std::string key, GmConfEntry *entry)
       }
     }
   }
-#endif
 
   //
   // H.323 keys
diff --git a/lib/engine/components/opal/opal-main.cpp b/lib/engine/components/opal/opal-main.cpp
index 3076e36..fc23681 100644
--- a/lib/engine/components/opal/opal-main.cpp
+++ b/lib/engine/components/opal/opal-main.cpp
@@ -48,10 +48,8 @@
 #include "opal-bank.h"
 #include "opal-call-manager.h"
 
-#ifdef HAVE_SIP
 #include "sip-endpoint.h"
 #define SIP_KEY "/apps/" PACKAGE_NAME "/protocols/sip/"
-#endif
 
 #ifdef HAVE_H323
 #include "h323-endpoint.h"
@@ -73,10 +71,8 @@ is_supported_address (const std::string uri)
     return true;
 #endif
 
-#ifdef HAVE_SIP
   if (uri.find ("sip:") == 0)
     return true;
-#endif
 
   return false;
 }
@@ -112,7 +108,6 @@ struct OPALSpark: public Ekiga::Spark
       core.add (bank);
       call_manager->ready.connect (sigc::mem_fun (&*bank, &Opal::Bank::call_manager_ready));
 
-#ifdef HAVE_SIP
       unsigned sip_port = gm_conf_get_int (SIP_KEY "listen_port");
       gmref_ptr<Sip::EndPoint> sip_manager (new Sip::EndPoint (*call_manager, core, sip_port));
       call_manager->add_protocol_manager (sip_manager);
@@ -121,7 +116,6 @@ struct OPALSpark: public Ekiga::Spark
       presence_core->add_presentity_decorator (sip_manager);
       presence_core->add_presence_fetcher (sip_manager);
       presence_core->add_presence_publisher (sip_manager);
-#endif
 
 #ifdef HAVE_H323
       unsigned h323_port = gm_conf_get_int (H323_KEY "listen_port");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]