FreeBSD, FreeSWITCH, zrtp

Hi all
There is an error when compile FreeSWITCH from git on FreeBSD with configure --enable-zrtp

Code:
freeswitch-src/libs/libzrtp/include/zrtp_config.h:54:6: error: #error "Libzrtp can't detect software platform: use manual setup in zrtp_config_user.h"

It is possible, if you manually #define ZRTP_PLATFORM ZP_BSD in zrtp_config_user.h
The question is would anybody clarify where is in the code defining OS?
 
Check you have added both lines in freeswitch-src/libs/libzrtp/include/zrtp_config_user.h:54:5:
Code:
/** \brief Constant to define ZRTP BSD platform */
#define ZP_BSD						107

Try build again.
 
They are there. It is interesting, where is defining on which platform building is? We need to define ZRTP_PLATFORM automatically.
 
I stopped here:
freeswitch-src/libs/libzrtp/include/zrtp_config.h:

Code:
/*
 * ZRTP PLATFORM DETECTION                                                     
 * If platworm is not specified manually in zrtp_config_user.h - try to detect it aytomatically
 */
#if !defined(ZRTP_PLATFORM)
#       if defined(ANDROID_NDK)
#               define ZRTP_PLATFORM ZP_ANDROID
#       elif defined(linux) || defined(__linux)
#               include <linux/version.h>
#               define ZRTP_PLATFORM ZP_LINUX
#       elif defined(__MACOSX__) || defined (__APPLE__) || defined (__MACH__)
#               define ZRTP_PLATFORM ZP_DARWIN
#       elif defined(_WIN32_WCE) || defined(UNDER_CE)
#               include <windef.h>
#               define ZRTP_PLATFORM ZP_WINCE
#       elif defined(__SYMBIAN32__)
#               define ZRTP_PLATFORM ZP_SYMBIAN
#       elif defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
#               if defined(__BUILDMACHINE__) && (__BUILDMACHINE__ == WinDDK)
#                       define ZRTP_PLATFORM ZP_WIN32_KERNEL
#               elif defined(_WIN64)
#                       define ZRTP_PLATFORM ZP_WIN32
#               else
#                       define ZRTP_PLATFORM ZP_WIN32
#               endif
#       endif
#endif

and can not find where (or how) is defining for example 'linux' that to add FreeBSD
 
Is defined as well in zrtp_config.h
Code:
#elif (ZRTP_PLATFORM == ZP_LINUX) || (ZRTP_PLATFORM == ZP_DARWIN) || (ZRTP_PLATFORM == ZP_BSD) || defined(ZRTP_AUTOMAKE)
#       include "zrtp_config_unix.h"

Check revisions here.

Added in config.h to build support.
Code:
#ifndef __ZRTP_H__
#define __ZRTP_H__
 
[B]#include "zrtp_config_unix.h"[/B]

#include "zrtp_config.h"
#include "zrtp_base.h"
#include "zrtp_error.h"
 
OK. Possible I was incorrect because english is not my native language.

The question is
Where is in the code learning on which OS we are building.

Need to automatically assign an appropriate value for ZRTP_PLATFORM namely ZP_BSD

To cpu82
Those what you suggested adding is already there. It is all from git, master branch. I realize that I may be inaccurate explain but your replies is some strange
 
Once again convinced do not ask in forums, but read the manuals.

This is the answer:

http://www.freebsd.org/doc/en/books/porters-handbook/porting-versions.html

This is the solution:

Code:
# cat ./zrtp_relative_diff
diff -cr ./freeswitch-orig/libs/libzrtp/configure.in ./freeswitch/libs/libzrtp/configure.in
*** ./freeswitch-orig/libs/libzrtp/configure.in 2013-03-16 20:03:32.151100861 +0400
--- ./freeswitch/libs/libzrtp/configure.in      2013-03-16 20:04:25.931359263 +0400
***************
*** 24,30 ****
    ;;
    *freebsd2* | *freebsd* | *netbsd* | *openbsd* | *osf[12]*)
    echo "------- START libzrtp configuration for BSD platform ------------"
-   AC_DEFINE(PLATFORM,ZP_BSD,BSD platform)
    ;;
    hpux* | irix* | linuxaout* | linux* | osf* | solaris2* | sunos4*)
    echo "------- START libzrtp configuration for Linux platform ------------"
--- 24,29 ----
diff -cr ./freeswitch-orig/libs/libzrtp/include/zrtp_config.h ./freeswitch/libs/libzrtp/include/zrtp_config.h
*** ./freeswitch-orig/libs/libzrtp/include/zrtp_config.h        2013-03-16 20:03:32.132993151 +0400
--- ./freeswitch/libs/libzrtp/include/zrtp_config.h     2013-03-16 20:07:15.787017033 +0400
***************
*** 19,24 ****
--- 19,26 ----
  #if !defined(ZRTP_PLATFORM)
  #     if defined(ANDROID_NDK)
  #             define ZRTP_PLATFORM ZP_ANDROID
+ #     elif defined(__FreeBSD__)
+ #             define ZRTP_PLATFORM ZP_BSD
  #     elif defined(linux) || defined(__linux)
  #             include <linux/version.h>
  #             define ZRTP_PLATFORM ZP_LINUX
 
Back
Top