Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building for Android #49

Open
waldemarKunkel opened this issue May 29, 2018 · 8 comments
Open

Building for Android #49

waldemarKunkel opened this issue May 29, 2018 · 8 comments

Comments

@waldemarKunkel
Copy link

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)

@babelouest
Copy link
Owner

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.

@waldemarKunkel
Copy link
Author

I have quick-and-dirty managed to compile all the libraries and it works for now. I will upload my changes somehow.

@babelouest
Copy link
Owner

Awesome, I'll wait for your feedback then.

@EauContraire
Copy link

EauContraire commented Jun 16, 2018

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.

@babelouest
Copy link
Owner

@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 ..

@babelouest
Copy link
Owner

@waldemarKunkel , were you able to move on with the android build?

@chipitsine
Copy link
Contributor

Azure DevOps (former VSTS) can build for android. I'll have a look at it

@OblackatO
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants