[vlc-devel] [PATCH] Fix build with nfs for Android

Andrey Gursky andrey.gursky at e-mail.ua
Mon Jan 18 02:50:31 CET 2016


Hi,

this somehow got forgotten? It breaks git master builds for Android.

Regards,
Andrey

--
The patch from Jean-Baptiste Kempf has been already merged in libnfs.
But it is still missing here.
---
 .../src/nfs/correct-NDK-define-for-Android.patch   | 74 ++++++++++++++++++++++
 contrib/src/nfs/rules.mak                          |  1 +
 2 files changed, 75 insertions(+)
 create mode 100644 contrib/src/nfs/correct-NDK-define-for-Android.patch

diff --git a/contrib/src/nfs/correct-NDK-define-for-Android.patch b/contrib/src/nfs/correct-NDK-define-for-Android.patch
new file mode 100644
index 0000000..9e73d43
--- /dev/null
+++ b/contrib/src/nfs/correct-NDK-define-for-Android.patch
@@ -0,0 +1,74 @@
+From d02d5d0f5e75afbebba77dcf11898e8886fa5d3b Mon Sep 17 00:00:00 2001
+From: Jean-Baptiste Kempf <jb at videolan.org>
+Date: Sat, 9 Jan 2016 13:35:11 +0100
+Subject: [PATCH] The correct NDK define for Android is __ANDROID__
+
+The ANDROID macro is not recommended
+---
+ include/nfsc/libnfs.h | 2 +-
+ lib/libnfs-sync.c     | 2 +-
+ lib/libnfs.c          | 4 ++--
+ utils/nfs-ls.c        | 2 +-
+ 4 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/include/nfsc/libnfs.h b/include/nfsc/libnfs.h
+index 55cec1d..7cd02d8 100644
+--- a/include/nfsc/libnfs.h
++++ b/include/nfsc/libnfs.h
+@@ -22,7 +22,7 @@
+ #define _LIBNFS_H_
+ 
+ #include <stdint.h>
+-#if defined(ANDROID)
++#if defined(__ANDROID__)
+ #include <sys/time.h>
+ #endif
+ #if defined(AROS)
+diff --git a/lib/libnfs-sync.c b/lib/libnfs-sync.c
+index f176e72..2c728ff 100644
+--- a/lib/libnfs-sync.c
++++ b/lib/libnfs-sync.c
+@@ -37,7 +37,7 @@
+ #include <net/if.h>
+ #endif
+ 
+-#ifdef ANDROID
++#ifdef __ANDROID__
+ #define statvfs statfs
+ #endif
+ 
+diff --git a/lib/libnfs.c b/lib/libnfs.c
+index ca98805..c1c9ec9 100644
+--- a/lib/libnfs.c
++++ b/lib/libnfs.c
+@@ -33,7 +33,7 @@
+ #include <utime.h>
+ #endif
+ 
+-#ifdef ANDROID
++#ifdef __ANDROID__
+ #define statvfs statfs
+ #endif
+ 
+@@ -4220,7 +4220,7 @@ static void nfs_statvfs_1_cb(struct rpc_context *rpc, int status, void *command_
+ 	svfs.f_bavail  = res->FSSTAT3res_u.resok.abytes/NFS_BLKSIZE;
+ 	svfs.f_files   = res->FSSTAT3res_u.resok.tfiles;
+ 	svfs.f_ffree   = res->FSSTAT3res_u.resok.ffiles;
+-#if !defined(ANDROID)
++#if !defined(__ANDROID__)
+ 	svfs.f_favail  = res->FSSTAT3res_u.resok.afiles;
+ 	svfs.f_fsid    = 0;
+ 	svfs.f_flag    = 0;
+diff --git a/utils/nfs-ls.c b/utils/nfs-ls.c
+index a854dfc..f74ba2c 100644
+--- a/utils/nfs-ls.c
++++ b/utils/nfs-ls.c
+@@ -36,7 +36,7 @@ WSADATA wsaData;
+ #include <string.h>
+ #include <sys/stat.h>
+ #ifndef AROS
+-#ifdef ANDROID
++#ifdef __ANDROID__
+ #define statvfs statfs
+ #include <sys/vfs.h>
+ #else
diff --git a/contrib/src/nfs/rules.mak b/contrib/src/nfs/rules.mak
index ac7f4d5..1fcec3a 100644
--- a/contrib/src/nfs/rules.mak
+++ b/contrib/src/nfs/rules.mak
@@ -18,6 +18,7 @@ nfs: libnfs-$(NFS_VERSION).tar.gz .sum-nfs
 	$(UNPACK)
 	mv libnfs-libnfs-$(NFS_VERSION) libnfs-$(NFS_VERSION)
 	$(APPLY) $(SRC)/nfs/nfs-no-utils.patch
+	$(APPLY) $(SRC)/nfs/correct-NDK-define-for-Android.patch
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-- 
2.6.4


More information about the vlc-devel mailing list