Re: [OpenSIPStack] Caveats in solaris 10 compilation
Brought to you by:
joegenbaclor
From: Joegen E. B. <jo...@pl...> - 2006-09-13 10:30:04
|
Hi Ryan, Thanks for the input. I've also cross posted this to the openh323 mailing list. It may also be helpful to the solaris guys over there. Also it would be nice to know the real cause of the regex issue in sol 10 so we can fix pwlib regex and probably submit a patch to openh323. Thanks again! Joegen Ryan Colobong wrote: > Hello Joegen, > > Here are some problems that I encounter when compiling opensipstack and > opensbc in solaris. > > -- GCC version : 3.4.3 > -- Operating System: Solaris 5.10 x86 > > 1. Compiling opensbc encounter errors regarding -x03 flag in g++ > > **********LOG > > g++ -DP_USE_PRAGMA -D_REENTRANT > -I/export/home/joegen/opensipstack/include -Wall > -I/export/home/joegen/opensipstack/include -xO3 -DSOLARIS -DUSE_GCC -c > ../common/vfakeio.cxx -o > /export/home/joegen/opensipstack/lib/obj_solaris_x86_r/vfakeio.o > g++: ../common/vfakeio.cxx: No such file or directory > g++: warning: `-x O3' after last input file has no effect > g++: no input files > > **********SOLUTION > > modify opensipstack/make/unix.mak and find the piece of code below > > ifneq ($(OSTYPE),Darwin) > ifeq ($(OSTYPE),solaris) > OPTCCFLAGS += -xO3 > else > OPTCCFLAGS += -Os > endif > else > OPTCCFLAGS += -O2 > endif > > modify the line OPTCCFLAGS += -xO3 to OPTCCFLAGS += -O3 > > > > > > 2. It is using cc as a default C compiler but my system does not have cc > installed > > **********LOG > > cc -DSOLARIS -DUSE_GCC -DP_USE_PRAGMA -D_REENTRANT > -I/export/home/joegen/opensipstack/include -Wall > -I/export/home/joegen/opensipstack/include -c ../common/getdate.tab.c -o > /export/home/joegen/opensipstack/lib/obj_solaris_x86_r/getdate.tab.o > make[3]: cc: Command not found > > **********SOLUTION > > change CC value into gcc during make > > bash-3.00$ make optnoshared CC=gcc > > > > > 3. Compiling opensbc encounter undefined symbol. Below are the error > during compilation. > > **********LOG > > PVideoInputDevice::GetDriversDeviceNames(PString const&, > PPluginManager*) > /export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(manager.o) > PVideoInputDevice::CreateDeviceByName(PString const&, PPluginManager*) > /export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(manager.o) > PVideoInputDevice::GetDriverNames(PPluginManager*) > /export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(manager.o) > PVideoDevice::CalculateFrameBytes(unsigned int, unsigned int, PString > const&)/export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(vidcodec.o) > PVideoOutputDevice::GetDriversDeviceNames(PString const&, > PPluginManager*) > /export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(manager.o) > PVideoOutputDevice::CreateDeviceByName(PString const&, PPluginManager*) > /export/home/joegen/opensipstack/lib/libopensipstack_solaris_x86_r_s.a(manager.o) > ld: fatal: Symbol referencing errors. No output written to > obj_solaris_x86_r/opensbc > > **********SOLUTION > > during configuration, opensipstack is unable to detect video support. To > be able to fix this we need to tell the configure that we will be using > a plugin. > > bash-3.00$ ./configure --enable-plugins > > > > > 4. When you access the http of OpenSBC and click any of the links, > OpenSBC causes an assertion and exit. > > **********LOG > > 2006/09/13 08:36:30.394 OpenSIPSta...pplication Message Starting service > process "OpenSIPStack Application" v1.1.2 > 2006/09/13 08:36:30.395 OpenSIPSta...pplication Debug3 OpenSIPStack > Application Process is starting > 2006/09/13 08:37:32.517 HTTP Service:8625d50 Debug3 PWLib Asse > 2006/09/13 08:37:32.517 HTTP Service:8625d50 Message 8:37 > > 2006/09/13 08:37:32.517 HTTP Service:8625d50 Message > <A>bort, <C>ore dump, <I>gnore? > > **********SOLUTION > > The problem here is that the configure is unable to check properly if > the PThreads has support for recursive mutex. > First we need to update the code below in configure.ac > > dnl ######################################################################## > dnl check for recursive mutexes > P_HAS_RECURSIVE_MUTEX=0 > AC_MSG_CHECKING(if recursive mutexes are available) > AC_TRY_COMPILE([#include <pthread.h>], > [pthread_mutexattr_t attr; > pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);], > P_HAS_RECURSIVE_MUTEX=1) > if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then > AC_MSG_RESULT(yes) > else > if test ${OSTYPE} == Darwin ; then > AC_TRY_COMPILE([#include <pthread.h>], > [pthread_mutexattr_t attr; > pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);], > P_HAS_RECURSIVE_MUTEX=1) > if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then > AC_MSG_RESULT(yes) > else > AC_MSG_RESULT(no) > fi > else > AC_MSG_RESULT(no) > fi > fi > AC_DEFINE_UNQUOTED(P_HAS_RECURSIVE_MUTEX, ${P_HAS_RECURSIVE_MUTEX}) > > > The PTHREAD_MUTEX_RECURSIVE_NP is not defined in pthreads.h in solaris > 10, it is actually defined as PTHREAD_MUTEX_RECURSIVE. So we need to add > another > validation after checking if $(OSTYPE) == Darwin. Below is my update in > configure.ac > > ... > if test ${OSTYPE} == Darwin ; then > AC_TRY_COMPILE([#include <pthread.h>], > [pthread_mutexattr_t attr; > pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);], > P_HAS_RECURSIVE_MUTEX=1) > if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then > AC_MSG_RESULT(yes) > else > AC_MSG_RESULT(no) > fi > elif test ${OSTYPE} == solaris ; then > AC_TRY_COMPILE([#include <pthread.h>], > [pthread_mutexattr_t attr; > pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);], > P_HAS_RECURSIVE_MUTEX=1) > if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then > AC_MSG_RESULT(yes) > else > AC_MSG_RESULT(no) > fi > else > AC_MSG_RESULT(no) > fi > ... > > > Then update the affected file in opensipstack which is in > opensipstack/src/pwlib/src/ptlib/unix/tlibthrd.cxx and find this piece > of code > > #if defined(P_QNX) && (P_HAS_RECURSIVE_MUTEX == 1) > #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE > #endif > #if defined(P_MACOSX) && (P_HAS_RECURSIVE_MUTEX == 1) > #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE > #endif > > and update it into this > > #if ( defined(P_QNX) || defined(P_SOLARIS) ) && (P_HAS_RECURSIVE_MUTEX == 1) > #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE > #endif > #if defined(P_MACOSX) && (P_HAS_RECURSIVE_MUTEX == 1) > #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE > #endif > > > After modifying configure.ac and tlibthrd.cxx, run again the autoconf to > update our configure. Then we need to use the internal Regex of > opensipstack due to it has problems with the latest Regex. So execute > again the configure like this. > > bash-3.00$ ./configure --enable-plugins --enable-internalregex > > then we should be able to run opensbc without a problem > > > > thats all > Ryan S. Colobong > > > > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > opensipstack-devel mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel > > |