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

Compiling nanomsg for Android #316

Closed
kristianlm opened this issue Oct 9, 2014 · 7 comments
Closed

Compiling nanomsg for Android #316

kristianlm opened this issue Oct 9, 2014 · 7 comments

Comments

@kristianlm
Copy link
Contributor

We've put together an Android.mk file which seems to build nanomsg for Android without any problems with one exception:

bionic/libc/kernel/common/linux/un.h:18: error: expected specifier-qualifier-list before 'sa_family_t'

which was fixed with this patch:

diff --git a/src/transports/ipc/ipc.c b/src/transports/ipc/ipc.c
index 26ffb07..39d7371 100644
--- a/src/transports/ipc/ipc.c
+++ b/src/transports/ipc/ipc.c
@@ -36,6 +36,7 @@
 #if defined NN_HAVE_WINDOWS
 #include "../../utils/win.h"
 #else
+#include <linux/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
 #endif

It's probably just bionic that's suffering from this, but since it's a relatively unintrusive patch, I though I might suggest it upstream.

@kristianlm
Copy link
Contributor Author

Actually, when I think of it - that patch is probably quite intrusive as it introduces Linux-specifics. The problem is that my un.h looks like this, with no definition of sa_family_t.

This patch works too, which may be a better candidate:

diff --git a/src/transports/ipc/ipc.c b/src/transports/ipc/ipc.c
index 26ffb07..552ba13 100644
--- a/src/transports/ipc/ipc.c
+++ b/src/transports/ipc/ipc.c
@@ -36,6 +36,7 @@
 #if defined NN_HAVE_WINDOWS
 #include "../../utils/win.h"
 #else
+#include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
 #endif

@sustrik
Copy link
Contributor

sustrik commented Oct 9, 2014

Can you confirm that the patch is submitted under MIT license?

@kristianlm
Copy link
Contributor Author

haha of course! pick any license you like :)

@sustrik
Copy link
Contributor

sustrik commented Oct 31, 2014

Applied to master. Thanks!

@sustrik sustrik closed this as completed Oct 31, 2014
@mardistal
Copy link

How did you compile he mk file ?

@kristianlm
Copy link
Contributor Author

@mardistal that depends on your Android setup, really. We're building Android from scratch (aka aosp) which builds all Android.mk files by itself.

If I remember correctly, it's the same with NDK apps: Android.mk files under ./jni/ will get built in.

@sweisgerber-dev
Copy link

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

No branches or pull requests

4 participants