-
Notifications
You must be signed in to change notification settings - Fork 0
emscripten ZRTP libs builds
edysli edited this page Sep 11, 2014
·
5 revisions
Source: https://github.com/traviscross/libzrtp Not sure this is the official source... it is no longer available from the Zfone project.
Commands:
#!/bin/sh
git clone https://github.com/traviscross/libzrtp.git
pushd libzrtp
git status
./bootstrap.sh
pushd ~/Sources/emsdk_portable/
source ./emsdk_env.sh
popd
emconfigure ./configure CFLAGS="-O0 -g3 -W -Wall -DBUILD_DEBUG_LOG"
emmake make
popd
Output (make):
Making all in third_party/bnlib
make[1]: Entering directory `/home/edysli/Desktop/libzrtp/third_party/bnlib'
/home/edysli/Sources/emsdk_portable/emscripten/master/emcc -O0 -g3 -W -Wall -DBUILD_DEBUG_LOG -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1 -DHAVE_CONFIG_H -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -I. -I. -o bn00.o -c bn00.c
/home/edysli/Sources/emsdk_portable/emscripten/master/emcc -O0 -g3 -W -Wall -DBUILD_DEBUG_LOG -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1 -DHAVE_CONFIG_H -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -I. -I. -o lbn00.o -Wl,-r -nostdlib lbn00.c -lgcc
WARNING root: emcc: cannot find library "gcc"
/home/edysli/Sources/emsdk_portable/emscripten/master/emcc -O0 -g3 -W -Wall -DBUILD_DEBUG_LOG -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1 -DHAVE_CONFIG_H -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -I. -I. -o bn.o -c bn.c
/home/edysli/Sources/emsdk_portable/emscripten/master/emcc -O0 -g3 -W -Wall -DBUILD_DEBUG_LOG -std=c99 -O2 -g3 -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -fPIC -DZRTP_AUTOMAKE=1 -DHAVE_CONFIG_H -I../../include -I../../include/enterprise -I../../projects/gnu/config -I../../third_party/bgaes -I. -I. -o lbnmem.o -c lbnmem.c
In file included from lbnmem.c:63:
In file included from ../../include/zrtp.h:18:
../../include/zrtp_config.h:56:6: error: "Libzrtp can't detect software platform: use manual setup in zrtp_config_user.h"
# error "Libzrtp can't detect software platform: use manual setup in zrtp_config_user.h"
^
../../include/zrtp_config.h:109:6: error: "Libzrtp can't detect byte order: use manual setup in zrtp_config_user.h"
# error "Libzrtp can't detect byte order: use manual setup in zrtp_config_user.h"
^
In file included from lbnmem.c:63:
In file included from ../../include/zrtp.h:19:
In file included from ../../include/zrtp_base.h:52:
In file included from ../../third_party/bgaes/sha2.h:50:
In file included from ../../third_party/bgaes/brg_types.h:49:
../../third_party/bgaes/bg2zrtp.h:24:3: error: "Can't define byte order for BG AES. Edit zrtp_system.h"
#error "Can't define byte order for BG AES. Edit zrtp_system.h"
^
In file included from lbnmem.c:63:
In file included from ../../include/zrtp.h:27:
../../include/zrtp_iface_scheduler.h:61:31: error: unknown type name 'zrtp_thread_routine_t'
extern int zrtp_thread_create(zrtp_thread_routine_t start_routine, void *arg);
^
4 errors generated.
ERROR root: compiler frontend failed to generate LLVM bitcode, halting
make[1]: *** [lbnmem.o] Error 1
make[1]: Leaving directory `/home/edysli/Desktop/libzrtp/third_party/bnlib'
make: *** [all-recursive] Error 1
- Does not compile cleanly out of the box (see above).
- Uses pthread and emscripten currently cannot compile threads to JS (see https://github.com/kripken/emscripten/issues/953).
Source: https://github.com/wernerd/ZRTPCPP
Commands:
#!/bin/sh
git clone https://github.com/wernerd/ZRTPCPP.git
pushd ZRTPCPP
pushd ~/Sources/emsdk_portable/
source ./emsdk_env.sh
popd
mkdir build
pushd build
emcmake cmake -DSDES=false -DCORE_LIB=true ..
emcmake cmake -DSDES=false -DCORE_LIB=true ..
emmake make
emcc clients/no_client/libzrtpcppcore.so.4.2.4 -o libzrtpcppcore.js
popd
popd
Output (cmake x2):
-- Configuring GNU libzrtpcpp 4.2.4 for libzrtpcore, commit: b8817a5 ...
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.26")
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
THREADS_PTHREAD_ARG (advanced)
For details see /home/edysli/Desktop/ZRTPCPP/build/TryRunResults.cmake
-- Check if compiler accepts -pthread - no
-- Found Threads: TRUE
-- Configuring incomplete, errors occurred!
See also "/home/edysli/Desktop/ZRTPCPP/build/CMakeFiles/CMakeOutput.log".
See also "/home/edysli/Desktop/ZRTPCPP/build/CMakeFiles/CMakeError.log".
ERROR root: Configure step failed with non-zero return code 1! Command line: ['cmake', '-DSDES=false', '-DCORE_LIB=true', '..', '-DCMAKE_TOOLCHAIN_FILE=/home/edysli/Sources/emsdk_portable/emscripten/master/cmake/Modules/Platform/Emscripten.cmake']
-- Configuring GNU libzrtpcpp 4.2.4 for libzrtpcore, commit: b8817a5 ...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/edysli/Desktop/ZRTPCPP/build
Output (make):
Scanning dependencies of target zrtpcppcore
[ 1%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCallbackWrapper.cpp.o
In file included from /home/edysli/Desktop/ZRTPCPP/zrtp/ZrtpCallbackWrapper.cpp:20:
In file included from /home/edysli/Desktop/ZRTPCPP/zrtp/libzrtpcpp/ZrtpCallbackWrapper.h:27:
/home/edysli/Desktop/ZRTPCPP/zrtp/libzrtpcpp/ZrtpCWrapper.h:977:2: warning: zrtp_getSasType(...) API changed - caller shall free() returned data [-W#warnings]
#warning zrtp_getSasType(...) API changed - caller shall free() returned data
^
1 warning generated.
[ 3%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZRtp.cpp.o
[ 4%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCrc32.cpp.o
[ 6%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketCommit.cpp.o
[ 7%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketConf2Ack.cpp.o
[ 9%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketConfirm.cpp.o
[ 10%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketDHPart.cpp.o
[ 12%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketGoClear.cpp.o
[ 13%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketClearAck.cpp.o
[ 15%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketHelloAck.cpp.o
[ 16%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketHello.cpp.o
[ 18%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketError.cpp.o
[ 20%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketErrorAck.cpp.o
[ 21%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketPingAck.cpp.o
[ 23%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketPing.cpp.o
[ 24%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketSASrelay.cpp.o
[ 26%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketRelayAck.cpp.o
[ 27%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpStateClass.cpp.o
[ 29%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpTextData.cpp.o
[ 30%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpConfigure.cpp.o
[ 32%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCWrapper.cpp.o
In file included from /home/edysli/Desktop/ZRTPCPP/zrtp/ZrtpCWrapper.cpp:24:
In file included from /home/edysli/Desktop/ZRTPCPP/zrtp/libzrtpcpp/ZrtpCallbackWrapper.h:27:
/home/edysli/Desktop/ZRTPCPP/zrtp/libzrtpcpp/ZrtpCWrapper.h:977:2: warning: zrtp_getSasType(...) API changed - caller shall free() returned data [-W#warnings]
#warning zrtp_getSasType(...) API changed - caller shall free() returned data
^
1 warning generated.
[ 33%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/Base32.cpp.o
[ 35%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/zrtpB64Encode.c.o
[ 36%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/zrtpB64Decode.c.o
[ 38%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/common/osSpecifics.c.o
[ 40%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZIDCacheFile.cpp.o
[ 41%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZIDRecordFile.cpp.o
[ 43%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/ZrtpRandom.cpp.o
[ 44%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/common/Thread.cpp.o
/home/edysli/Desktop/ZRTPCPP/common/Thread.cpp:720:19: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
if( m_queuePos-1 < 0 )
~~~~~~~~~~~~ ^ ~
1 warning generated.
[ 46%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/common/MutexClass.cpp.o
[ 47%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/common/EventClass.cpp.o
[ 49%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/zrtpDH.cpp.o
[ 50%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/hmac256.cpp.o
[ 52%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/sha256.cpp.o
[ 53%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/hmac384.cpp.o
[ 55%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/sha384.cpp.o
[ 56%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/aesCFB.cpp.o
[ 58%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/twoCFB.cpp.o
[ 60%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/sha2.c.o
[ 61%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/bn00.c.o
[ 63%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/lbn00.c.o
[ 64%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/bn.c.o
[ 66%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/lbnmem.c.o
[ 67%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/sieve.c.o
[ 69%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/prime.c.o
[ 70%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/bnprint.c.o
[ 72%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/jacobi.c.o
[ 73%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/germain.c.o
[ 75%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/ec/ec.c.o
[ 76%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/ec/ecdh.c.o
[ 78%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/bnlib/ec/curve25519-donna.c.o
[ 80%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/macSkein.cpp.o
[ 81%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skein.c.o
[ 83%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skein_block.c.o
[ 84%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skeinApi.c.o
[ 86%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/twofish.c.o
[ 87%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/twofish_cfb.c.o
[ 89%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skeinMac256.cpp.o
[ 90%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skein256.cpp.o
[ 92%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skeinMac384.cpp.o
[ 93%] Building CXX object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skein384.cpp.o
[ 95%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/aescrypt.c.o
[ 96%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/aeskey.c.o
[ 98%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/aestab.c.o
[100%] Building C object clients/no_client/CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/aes_modes.c.o
Linking CXX shared library libzrtpcppcore.so
- Compiles but it looks like the library is not complete (missing ZRtpCallback interface for example).
- Uses pthread (errors in the configure stage)
Source: https://github.com/privatewave/zrtp-cpp Doesn't even have a build system 👎