[Ekiga-devel-list] patches for OPAL for FreeBSD



Hi Damien,

I'm attaching some small patches for OPAL to make it working in FreeBSD;
some pieces are #if defined P_FREEBSD wrapped and should cause no problem
in other systems; concerning the 'configure' changes I don't know how to
provide a common solution (_dlopen & friends are just in libc.so)
because 'configure' and 'plugins/configure' are generated, but in SVN;
please check what you could do so a 'svn update' will not clobber my
changes in my local rep. :-)

will provide the same for PTLib and Ekiga too after cleanups

thx

	matthias
-- 
Matthias Apitz
Manager Technical Support - OCLC GmbH
Gruenwalder Weg 28g - 82041 Oberhaching - Germany
t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211
e <matthias apitz oclc org> - w http://www.oclc.org/ http://www.UnixArea.de/
b http://gurucubano.blogspot.com/
Don't top-post, read RFC1855 http://www.faqs.org/rfcs/rfc1855.html
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on Usenet and in e-mail?
*** opal/plugins/video/H.264/gpl/x264loader_unix.cxx.orig	2008-03-27 14:34:39.000000000 +0100
--- opal/plugins/video/H.264/gpl/x264loader_unix.cxx	2008-03-27 14:34:56.000000000 +0100
***************
*** 112,118 ****
    _dynamicLibrary = dlopen(name, RTLD_NOW);
  
    if (_dynamicLibrary == NULL) {
!     char * error = dlerror();
      if (error != NULL)
          TRACE(1, "H264\tDYNA\tError loading " << name << " - " << error)
        else
--- 112,118 ----
    _dynamicLibrary = dlopen(name, RTLD_NOW);
  
    if (_dynamicLibrary == NULL) {
!     char * error = (char *) dlerror();
      if (error != NULL)
          TRACE(1, "H264\tDYNA\tError loading " << name << " - " << error)
        else
*** opal/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx.orig	2008-03-25 13:52:46.000000000 +0100
--- opal/plugins/video/H.263-ffmpeg/h263ffmpeg.cxx	2008-03-26 10:38:27.000000000 +0100
***************
*** 92,97 ****
--- 92,103 ----
  #    define DIR_TOKENISER ":"
  #  endif
  
+ #if defined P_FREEBSD
+ #   define P_DEFAULT_PLUGIN_DIR "/usr/local/lib"
+ #    define DIR_SEPERATOR "/"
+ #    define DIR_TOKENISER ":"
+ #endif
+ 
  #include <vector>
  
  // if defined, the FFMPEG code is access via another DLL
***************
*** 291,297 ****
        _hDLL = dlopen((const char *)path, RTLD_NOW);
        if (_hDLL == NULL) {
          fprintf(stderr, "error loading %s", path);
!         char * err = dlerror();
          if (err != NULL)
            fprintf(stderr, " - %s", err);
          fprintf(stderr, "\n");
--- 297,303 ----
        _hDLL = dlopen((const char *)path, RTLD_NOW);
        if (_hDLL == NULL) {
          fprintf(stderr, "error loading %s", path);
!         char * err = (char *)  dlerror();
          if (err != NULL)
            fprintf(stderr, " - %s", err);
          fprintf(stderr, "\n");
***************
*** 424,435 ****
--- 430,445 ----
    if (IsLoaded())
      return true;
  
+ #if defined P_FREEBSD
+   if(!DynaLink::Open("libavcodec.so")
+ #else
    if (!DynaLink::Open("avcodec")
  #if defined(WIN32)
        && !DynaLink::Open("libavcodec")
  #else
        && !DynaLink::Open("libavcodec.so")
  #endif
+ #endif  // P_FREEBSD
      ) {
      //cerr << "FFLINK\tFailed to load a library, some codecs won't operate correctly;" << endl;
  #if !defined(WIN32)
*** opal/plugins/video/H.263-ffmpeg/Makefile.in.orig	2008-03-26 08:14:27.000000000 +0100
--- opal/plugins/video/H.263-ffmpeg/Makefile.in	2008-03-26 08:14:48.000000000 +0100
***************
*** 63,69 ****
  OBJECTS = $(addprefix $(OBJDIR)/,$(patsubst %.cxx,%.o,$(notdir $(SRCS))))
  
  $(PLUGIN): $(OBJECTS)
! 	$(CXX) $(LDSO) -o $@ $^
  
  install:
  	mkdir -p $(DESTDIR)$(LIBDIR)/ptlib/codecs/video/
--- 63,69 ----
  OBJECTS = $(addprefix $(OBJDIR)/,$(patsubst %.cxx,%.o,$(notdir $(SRCS))))
  
  $(PLUGIN): $(OBJECTS)
! 	$(CXX) $(LDSO) $(LDFLAGS) -o $@ $^
  
  install:
  	mkdir -p $(DESTDIR)$(LIBDIR)/ptlib/codecs/video/
*** opal/plugins/video/THEORA/Makefile.in.orig	2008-03-26 08:02:41.000000000 +0100
--- opal/plugins/video/THEORA/Makefile.in	2008-03-26 08:03:04.000000000 +0100
***************
*** 64,70 ****
  OBJECTS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(patsubst %.cxx,%.o,$(notdir $(SRCS)))))
  
  $(PLUGIN): $(OBJECTS)
! 	$(CXX) $(THEORA_LIBS) $(LDSO) -o $@ $^
  
  
  install:
--- 64,70 ----
  OBJECTS = $(addprefix $(OBJDIR)/,$(patsubst %.c,%.o,$(patsubst %.cxx,%.o,$(notdir $(SRCS)))))
  
  $(PLUGIN): $(OBJECTS)
! 	$(CXX) $(LDFLAGS) $(THEORA_LIBS) $(LDSO) -o $@ $^
  
  
  install:
*** opal/plugins/video/common/trace.cxx.orig	2008-03-25 13:46:17.000000000 +0100
--- opal/plugins/video/common/trace.cxx	2008-03-25 13:48:19.000000000 +0100
***************
*** 35,40 ****
--- 35,44 ----
  #include <libgen.h>
  #endif
  
+ #ifdef P_FREEBSD
+ #include <libgen.h>
+ #endif
+ 
  unsigned TraceLevel = 0;
  
  void Trace::SetLevel (unsigned level)
*** opal/plugins/configure.orig	2008-03-26 07:50:06.000000000 +0100
--- opal/plugins/configure	2008-03-27 14:28:37.000000000 +0100
***************
*** 5904,5910 ****
        printf("%s\n", header.speex_version);
      }
  C_FILE
!     cc -o t t.c -lspeex > /dev/null 2>&1
      if test \! -x t ; then
        { echo "$as_me:$LINENO: result: cannot determine - using library version" >&5
  echo "${ECHO_T}cannot determine - using library version" >&6; }
--- 5904,5910 ----
        printf("%s\n", header.speex_version);
      }
  C_FILE
!     cc -o t t.c $LDFLAGS -lspeex > /dev/null 2>&1
      if test \! -x t ; then
        { echo "$as_me:$LINENO: result: cannot determine - using library version" >&5
  echo "${ECHO_T}cannot determine - using library version" >&6; }
***************
*** 6565,6577 ****
    else
      { echo "$as_me:$LINENO: result: yes" >&5
  echo "${ECHO_T}yes" >&6; }
!     { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
! echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
  if test "${ac_cv_lib_dl_dlopen+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
! LIBS="-ldl  $LIBS"
  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
--- 6565,6577 ----
    else
      { echo "$as_me:$LINENO: result: yes" >&5
  echo "${ECHO_T}yes" >&6; }
!     { echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
! echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6; }
  if test "${ac_cv_lib_dl_dlopen+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
! LIBS="-lc  $LIBS"
  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
***************
*** 6955,6967 ****
                  cat > t.c <<C_FILE
                    int main () {}
  C_FILE
!                 cc -o t t.c -lavcodec > /dev/null 2>&1
                  if test \! -x t ; then
                      { echo "$as_me:$LINENO: result: cannot determine - using defaults" >&5
  echo "${ECHO_T}cannot determine - using defaults" >&6; }
                   else
                      ffmpeg_lib_name=`ldd ./t  | grep libavcodec | awk '{ print $1; }'`
- echo libavcodec ; ldd ./t
                      rm -f t t.c
                      { echo "$as_me:$LINENO: result: $ffmpeg_lib_name" >&5
  echo "${ECHO_T}$ffmpeg_lib_name" >&6; }
--- 6955,6966 ----
                  cat > t.c <<C_FILE
                    int main () {}
  C_FILE
!                 cc -o t t.c $LDFLAGS -lavcodec > /dev/null 2>&1
                  if test \! -x t ; then
                      { echo "$as_me:$LINENO: result: cannot determine - using defaults" >&5
  echo "${ECHO_T}cannot determine - using defaults" >&6; }
                   else
                      ffmpeg_lib_name=`ldd ./t  | grep libavcodec | awk '{ print $1; }'`
                      rm -f t t.c
                      { echo "$as_me:$LINENO: result: $ffmpeg_lib_name" >&5
  echo "${ECHO_T}$ffmpeg_lib_name" >&6; }
***************
*** 7226,7232 ****
  
          if test "x${x264_headers}" = "xtrue"; then
            if test "x$HAS_LIBDL" != "x0" ; then
! 	    X264_LIBS="-ldl"
            fi
  
            { echo "$as_me:$LINENO: checking for x264 version >= 48" >&5
--- 7225,7231 ----
  
          if test "x${x264_headers}" = "xtrue"; then
            if test "x$HAS_LIBDL" != "x0" ; then
! 	    X264_LIBS="-lc"
            fi
  
            { echo "$as_me:$LINENO: checking for x264 version >= 48" >&5
***************
*** 7262,7268 ****
                cat > t.c <<C_FILE
                  int main () {}
  C_FILE
!               cc -o t t.c -lx264 > /dev/null 2>&1
                if test \! -x t ; then
                    { echo "$as_me:$LINENO: result: cannot determine - using defaults" >&5
  echo "${ECHO_T}cannot determine - using defaults" >&6; }
--- 7261,7267 ----
                cat > t.c <<C_FILE
                  int main () {}
  C_FILE
!               cc -o t t.c $LDFLAGS -lx264 > /dev/null 2>&1
                if test \! -x t ; then
                    { echo "$as_me:$LINENO: result: cannot determine - using defaults" >&5
  echo "${ECHO_T}cannot determine - using defaults" >&6; }
*** opal/src/codec/speex/libspeex/kiss_fft.h.orig	2008-03-25 13:16:43.000000000 +0100
--- opal/src/codec/speex/libspeex/kiss_fft.h	2008-03-25 13:36:27.000000000 +0100
***************
*** 5,11 ****
--- 5,14 ----
  #include <stdio.h>
  #include <math.h>
  #include <memory.h>
+ 
+ #if !defined __STDC__
  #include <malloc.h>
+ #endif
  
  #ifdef __cplusplus
  extern "C" {
*** opal/configure.orig	2008-03-27 14:27:15.000000000 +0100
--- opal/configure	2008-03-27 14:27:39.000000000 +0100
***************
*** 6498,6510 ****
    else
      { echo "$as_me:$LINENO: result: yes" >&5
  echo "${ECHO_T}yes" >&6; }
!     { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
! echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
  if test "${ac_cv_lib_dl_dlopen+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
! LIBS="-ldl  $LIBS"
  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
--- 6498,6510 ----
    else
      { echo "$as_me:$LINENO: result: yes" >&5
  echo "${ECHO_T}yes" >&6; }
!     { echo "$as_me:$LINENO: checking for dlopen in -lc" >&5
! echo $ECHO_N "checking for dlopen in -lc... $ECHO_C" >&6; }
  if test "${ac_cv_lib_dl_dlopen+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    ac_check_lib_save_LIBS=$LIBS
! LIBS="-lc  $LIBS"
  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF


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