ulfius
ulfius copied to clipboard
Building for Android
Hi, I'm trying integrate your library in my Android project.
So far I was using MHD and was also able to build Jensson.
But ulfius won't build. It gives me this error:
-- Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)
This looks like an error in yder compilation where it needs systemd library by default.
You can try to build yder independently with disabling systemd dependency:
$ git clone https://github.com/babelouest/yder.git
$ cd yder/src
$ make Y_DISABLE_JOURNALD=1
$ sudo make install
Although I have never tried to compile Ulfius on android, I'm interested in the results.
I have quick-and-dirty managed to compile all the libraries and it works for now. I will upload my changes somehow.
Awesome, I'll wait for your feedback then.
I have the same problem under Debian Stretch, I downloaded Ulfius as a zip, then downloaded orcadia & yder into ulfius's lib directory and followed their installation instructions as per their README's. Orcadia installed OK, however yder did not.
I am happy to help if I can, I found alternative FindSystemd.cmake scripts but I am no cmake expert and couldn't see (quickly) how to integrate them.
paul@grunt:~/src/c/ulfius-master/lib/yder-master/build$ cmake \
> -DWITH_JANSSON=off \
> -DBUILD_STATIC=on \
> -DBUILD_TESTING=off \
> -DINSTALL_HEADER=on \
> -DCMAKE_BUILD_TYPE=Release ..
-- Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)
CMake Error at /usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find Systemd (missing: SYSTEMD_LIBRARY SYSTEMD_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake-modules/FindSystemd.cmake:47 (find_package_handle_standard_args)
CMakeLists.txt:98 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/paul/src/c/ulfius-master/lib/yder-master/build/CMakeFiles/CMakeOutput.log".
A quick look at yder.c shows
#ifndef _WIN32
#include <syslog.h>
#ifndef Y_DISABLE_JOURNALD
#include <systemd/sd-journal.h>
#endif
#endif
but:
find / -mount -name 'sd-journal.h' -print
yields no file of that name.
I tried:
make Y_DISABLE_JOURNALD=1
and.. FX: Ooops! my first try failed, I then tried again and it compiled.
I followed this by:
sudo make static-install
and I have what I want.
Sorry for the noise, comment about cmake above still stands.
@EauContraire , it seems that your problem was the absence of libsystemd: apt install libsystemd-dev
Or as you figured out, building yder without journald: cmake -DWITH_JOURNALD=off ..
@waldemarKunkel , were you able to move on with the android build?
Azure DevOps (former VSTS) can build for android. I'll have a look at it
Are there already any updates or guides in how to build in android? It would be lovely to use ulfius as a client in my android, since I am also thinking of using it in my RESTful server.