adobkin / libcapn

A simple C Library for interact with the Apple Push Notification Service (APNs)
MIT License
100 stars 37 forks source link

build problem #21

Open sagaertj opened 8 years ago

sagaertj commented 8 years ago

Hi Make Error at /home/buildroot12git/output/host/usr/share/cmake-3.1/Modules/ExternalProject.cmake:1584 (message): error: no download info for 'jansson' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND

How do i solve this, besides this i want to crosscompile this for embedded usage.

cuongtv51 commented 8 years ago

I think you miss command to download jansson dependency: git submodule update --init

sagaertj commented 8 years ago

Hi


Van: Kd [mailto:notifications@github.com] Verzonden: dinsdag 16 februari 2016 4:16 Aan: adobkin/libcapn CC: Sagaert Johan (ON5DI) Onderwerp: Re: [libcapn] build problem (#21)

I think you miss command to download jansson dependency: git submodule update --init

Reply to this email directly or view https://github.com/adobkin/libcapn/issues/21#issuecomment-184495463 it on GitHub. https://github.com/notifications/beacon/ABKp0q-ku1p7ORmmfRRiTYM28vK6VvQhks5pkovWgaJpZM4HZ_OI.gif

mailto:root@debian605:/gitrepos/libcapn/build root@debian605:/gitrepos/libcapn/build# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/home/buildroot12git/output/host/usr/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX=/usr ../ -- ccache program has been found and will be used for the build. -- To disable ccache, add -DUSE_CCACHE=OFF on the cmake command line. -- ccache program has been found and will be used for the build. -- To disable ccache, add -DUSE_CCACHE=OFF on the cmake command line. -- The C compiler identification is GNU 4.9.3 -- Check for working C compiler: /home/buildroot12git/output/host/usr/bin/ccache-- Check for working C compiler: /home/buildroot12git/output/host/usr/bin/ccache -- works -- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Looking for include file ctype.h-- Looking for include file ctype.h - found-- Looking for include file inttypes.h-- Looking for include file inttypes.h - found-- Looking for include file stdint.h-- Looking for include file stdint.h - found-- Looking for include file unistd.h-- Looking for include file unistd.h - found-- Looking for include file netinet/in.h-- Looking for include file netinet/in.h - found-- Looking for include file arpa/inet.h-- Looking for include file arpa/inet.h - found -- Looking for include file netdb.h -- Looking for include file netdb.h - found -- Looking for include file sys/fcntl.h -- Looking for include file sys/fcntl.h - found -- Looking for include file sys/socket.h -- Looking for include file sys/socket.h - found -- Looking for include file strings.h -- Looking for include file strings.h - found -- Looking for strerror_r -- Looking for strerror_r - found -- Performing test APN_HAVE_GLIBC_STRERROR_R CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: APN_HAVE_GLIBC_STRERROR_R (advanced) APN_HAVE_GLIBC_STRERROR_RTRYRUN_OUTPUT (advanced) For details see /gitrepos/libcapn/build/TryRunResults.cmake -- Performing test APN_HAVE_GLIBC_STRERROR_R - Failed -- Performing test APN_HAVE_POSIX_STRERROR_R CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: APN_HAVE_POSIX_STRERROR_R (advanced) APN_HAVE_POSIX_STRERROR_RTRYRUN_OUTPUT (advanced) For details see /gitrepos/libcapn/build/TryRunResults.cmake -- Performing test APN_HAVE_POSIX_STRERROR_R - Failed -- Found OpenSSL: /home/buildroot12git/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libssl.so;/home/buildroot12git/output/host/usr/arm- buildroot-linux-gnueabi/sysroot/usr/lib/libcrypto.so (found version "1.0.2c") -- Configuring incomplete, errors occurred! See also "/gitrepos/libcapn/build/CMakeFiles/CMakeOutput.log". mailto:root@debian605:/gitrepos/libcapn/build root@debian605:/gitrepos/libcapn/build#

Now i disabled CCACHE

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/home/buildroot12git/output/host/usr/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CCACHE=OFF ../ -- Performing test APN_HAVE_GLIBC_STRERROR_R -- Performing test APN_HAVE_GLIBC_STRERROR_R - Success -- Performing test APN_HAVE_POSIX_STRERROR_R -- Performing test APN_HAVE_POSIX_STRERROR_R - Success -- Configuring done -- Generating done -- Build files have been written to: /gitrepos/libcapn/build root@debian605:/gitrepos/libcapn/build# make Scanning dependencies of target jansson [ 5%] Creating directories for 'jansson' [ 10%] No download step for 'jansson' [ 15%] No patch step for 'jansson' [ 20%] No update step for 'jansson' [ 25%] Performing configure step for 'jansson' -- The C compiler identification is GNU 4.6.4 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done C compiler: GNU -- Looking for include file endian.h -- Looking for include file endian.h - found -- Looking for include file fcntl.h -- Looking for include file fcntl.h - found -- Looking for include file sched.h -- Looking for include file sched.h - found -- Looking for include file unistd.h -- Looking for include file unistd.h - found -- Looking for include file sys/param.h -- Looking for include file sys/param.h - found -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for include file sys/time.h -- Looking for include file sys/time.h - found -- Looking for close -- Looking for close - found -- Looking for getpid -- Looking for getpid - found -- Looking for gettimeofday -- Looking for gettimeofday - found -- Looking for open -- Looking for open - found -- Looking for read -- Looking for read - found -- Looking for sched_yield -- Looking for sched_yield - found -- Looking for include file stdint.h -- Looking for include file stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of int64 -- Check size of int64 - failed -- Check size of int64_t -- Check size of int64_t - done -- Check size of long long -- Check size of long long - done -- Check size of int32_t -- Check size of int32_t - done -- Check size of int32 -- Check size of int32 - failed -- Check size of long -- Check size of long - done -- Check size of int -- Check size of int - done -- Check size of unsigned long -- Check size of unsigned long - done -- Check size of unsigned int -- Check size of unsigned int - done -- Check size of unsigned short -- Check size of unsigned short - done -- Check size of uint32_t -- Check size of uint32_t - done -- Check size of uint32 -- Check size of uint32 - failed -- Check size of uint16_t -- Check size of uint16_t - done -- Check size of uint16 -- Check size of uint16 - failed -- Check size of uint8_t -- Check size of uint8_t - done -- Check size of uint8 -- Check size of uint8 - failed -- Check size of ssize_t -- Check size of ssize_t - done -- Check size of SSIZE_T -- Check size of SSIZE_T - failed -- Looking for strtoll -- Looking for strtoll - found -- Looking for strtoq -- Looking for strtoq - found -- Looking for _strtoi64 -- Looking for _strtoi64 - not found -- Looking for include file locale.h -- Looking for include file locale.h - found -- Looking for localeconv -- Looking for localeconv - found -- Looking for setlocale -- Looking for setlocale - found -- Performing Test HAVE_INLINE -- Performing Test HAVE_INLINE - Success -- Performing Test HAVE__INLINE -- Performing Test HAVEINLINE - Success -- Performing Test HAVE___INLINE -- Performing Test HAVE_INLINE - Success -- Looking for snprintf -- Looking for snprintf - found -- Looking for _snprintf -- Looking for _snprintf - not found -- Performing Test HAVE_SYNC_BUILTINS -- Performing Test HAVE_SYNC_BUILTINS - Success -- Performing Test HAVE_ATOMIC_BUILTINS -- Performing Test HAVE_ATOMIC_BUILTINS - Failed -- Configuring done -- Generating done -- Build files have been written to: /gitrepos/libcapn/src/third_party/jansson [ 30%] Performing build step for 'jansson' Scanning dependencies of target jansson [ 3%] Building C object CMakeFiles/jansson.dir/src/hashtable.c.o [ 7%] Building C object CMakeFiles/jansson.dir/src/utf.c.o [ 11%] Building C object CMakeFiles/jansson.dir/src/hashtable_seed.c.o [ 15%] Building C object CMakeFiles/jansson.dir/src/load.c.o [ 19%] Building C object CMakeFiles/jansson.dir/src/pack_unpack.c.o [ 23%] Building C object CMakeFiles/jansson.dir/src/strconv.c.o [ 26%] Building C object CMakeFiles/jansson.dir/src/strbuffer.c.o [ 30%] Building C object CMakeFiles/jansson.dir/src/value.c.o [ 34%] Building C object CMakeFiles/jansson.dir/src/error.c.o [ 38%] Building C object CMakeFiles/jansson.dir/src/dump.c.o [ 42%] Building C object CMakeFiles/jansson.dir/src/memory.c.o Linking C static library lib/libjansson.a [ 42%] Built target jansson Scanning dependencies of target json_process [ 46%] Building C object CMakeFiles/json_process.dir/test/bin/json_process.c.o Linking C executable bin/json_process [ 46%] Built target json_process Scanning dependencies of target simple_parse [ 50%] Building C object CMakeFiles/simple_parse.dir/examples/simple_parse.c.o /gitrepos/libcapn/src/third_party/jansson/examples/simple_parse.c: In function 'print_json_object': /gitrepos/libcapn/src/third_party/jansson/examples/simple_parse.c:95:5: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Wformat] /gitrepos/libcapn/src/third_party/jansson/examples/simple_parse.c: In function 'print_json_array': /gitrepos/libcapn/src/third_party/jansson/examples/simple_parse.c:109:5: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t' [-Wformat] Linking C executable bin/simple_parse [ 50%] Built target simple_parse Scanning dependencies of target test_array [ 53%] Building C object CMakeFiles/test_array.dir/test/suites/api/test_array.c.o Linking C executable bin/test_array [ 53%] Built target test_array Scanning dependencies of target test_copy [ 57%] Building C object CMakeFiles/test_copy.dir/test/suites/api/test_copy.c.o Linking C executable bin/test_copy [ 57%] Built target test_copy Scanning dependencies of target test_dump [ 61%] Building C object CMakeFiles/test_dump.dir/test/suites/api/test_dump.c.o Linking C executable bin/test_dump [ 61%] Built target test_dump Scanning dependencies of target test_dump_callback [ 65%] Building C object CMakeFiles/test_dump_callback.dir/test/suites/api/test_dump_callback.c.o Linking C executable bin/test_dump_callback [ 65%] Built target test_dump_callback Scanning dependencies of target test_equal [ 69%] Building C object CMakeFiles/test_equal.dir/test/suites/api/test_equal.c.o Linking C executable bin/test_equal [ 69%] Built target test_equal Scanning dependencies of target test_load [ 73%] Building C object CMakeFiles/test_load.dir/test/suites/api/test_load.c.o Linking C executable bin/test_load [ 73%] Built target test_load Scanning dependencies of target test_loadb [ 76%] Building C object CMakeFiles/test_loadb.dir/test/suites/api/test_loadb.c.o Linking C executable bin/test_loadb [ 76%] Built target test_loadb Scanning dependencies of target test_memory_funcs [ 80%] Building C object CMakeFiles/test_memory_funcs.dir/test/suites/api/test_memory_funcs.c.o Linking C executable bin/test_memory_funcs [ 80%] Built target test_memory_funcs Scanning dependencies of target test_number [ 84%] Building C object CMakeFiles/test_number.dir/test/suites/api/test_number.c.o Linking C executable bin/test_number [ 84%] Built target test_number Scanning dependencies of target test_object [ 88%] Building C object CMakeFiles/test_object.dir/test/suites/api/test_object.c.o Linking C executable bin/test_object [ 88%] Built target test_object Scanning dependencies of target test_pack [ 92%] Building C object CMakeFiles/test_pack.dir/test/suites/api/test_pack.c.o Linking C executable bin/test_pack [ 92%] Built target test_pack Scanning dependencies of target test_simple [ 96%] Building C object CMakeFiles/test_simple.dir/test/suites/api/test_simple.c.o Linking C executable bin/test_simple [ 96%] Built target test_simple Scanning dependencies of target test_unpack [100%] Building C object CMakeFiles/test_unpack.dir/test/suites/api/test_unpack.c.o Linking C executable bin/test_unpack [100%] Built target test_unpack [ 35%] No install step for 'jansson' [ 40%] Completed 'jansson' [ 40%] Built target jansson Scanning dependencies of target capn [ 45%] Building C object CMakeFiles/capn.dir/src/library/apn_memory.c.o [ 50%] Building C object CMakeFiles/capn.dir/src/library/apn.c.o [ 55%] Building C object CMakeFiles/capn.dir/src/library/apn_strings.c.o [ 60%] Building C object CMakeFiles/capn.dir/src/library/apn_payload.c.o [ 65%] Building C object CMakeFiles/capn.dir/src/library/apn_tokens.c.o [ 70%] Building C object CMakeFiles/capn.dir/src/library/apn_binary_message.c.o [ 75%] Building C object CMakeFiles/capn.dir/src/library/apn_array.c.o [ 80%] Building C object CMakeFiles/capn.dir/src/library/apn_strerror.c.o [ 85%] Building C object CMakeFiles/capn.dir/src/library/apn_ssl.c.o [ 90%] Building C object CMakeFiles/capn.dir/src/library/apn_log.c.o Linking C shared library lib/Release/libcapn.so /home/buildroot12git/output/host/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/../../../../arm-buildroot-linux-gnueabi/bin/ld: ../src/third_party/jansson/lib/libjansson.a(value.c.o): Relocations in generic ELF (EM: 3) /home/buildroot12git/output/host/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/../../../../arm-buildroot-linux-gnueabi/bin/ld: ../src/third_party/jansson/lib/libjansson.a(value.c.o): Relocations in generic ELF (EM: 3) ../src/third_party/jansson/lib/libjansson.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: * [lib/Release/libcapn.so.2.0.0] Error 1 make[1]: * [CMakeFiles/capn.dir/all] Error 2 make: *\ [all] Error 2 root@debian605:/gitrepos/libcapn/build#

It looks like that jannsson is compiled for the host I guess something needs to be changed in the cmake source files.

Best Regards, Johan

sagaertj commented 8 years ago

followup:

After running cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="/home/buildroot12git/output/host/usr/share/buildroot/toolchainfile.cmake" -DCMAKE_INSTALL_PREFIX=//home/buildroot12git/output/staging/usr -DUSE_CCACHE=OFF ../

i modified build/CMakeFiles/apn-pusher.dir/link.txt and build/CMakeFiles/capn.dir/link.txt

have replaced
../src/third_party/jansson/lib/libjansson.a
into -ljansson

then ran make again

So since i already had a cross libjansson on my target system using that one solved the jansson problem. This is just a quick and dirty fix, maybe the cmakefiles need some tweaking . I am always available to test things if you have modified something in the cmake project to resolve this.

Regards, Johan