Commit 80edb355 authored by Thomas Guillem's avatar Thomas Guillem

contrib: dsm: fix Android nl_langinfo detection

Fixes Android NDK 17+ build
parent 39808918
From 68dc318713f7ca577e9d5bb4088d31851944b0fa Mon Sep 17 00:00:00 2001
From: Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet@gmail.com>
Date: Tue, 11 Sep 2018 17:51:04 +0200
Subject: [PATCH] build: fix nl_langinfo detection on Android
The android NDK 17 provides the header, but not necessarily the
nl_langinfo function.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
---
configure.ac | 4 ++--
src/smb_utils.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index e0e40c9..17757d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,9 +107,9 @@ AC_CHECK_DECLS([CLOCK_MONOTONIC],,,[
AC_REPLACE_FUNCS([strlcpy])
AC_REPLACE_FUNCS([strndup])
AC_REPLACE_FUNCS([clock_gettime])
-AC_CHECK_FUNCS([pipe _pipe getifaddrs])
+AC_CHECK_FUNCS([pipe _pipe getifaddrs nl_langinfo])
-AC_CHECK_HEADERS([bsd/string.h langinfo.h alloca.h sys/queue.h arpa/inet.h sys/socket.h sys/time.h ifaddrs.h])
+AC_CHECK_HEADERS([bsd/string.h alloca.h sys/queue.h arpa/inet.h sys/socket.h sys/time.h ifaddrs.h])
## Configure random device path
AC_ARG_WITH([urandom],
diff --git a/src/smb_utils.c b/src/smb_utils.c
index a64c1db..3e8a420 100644
--- a/src/smb_utils.c
+++ b/src/smb_utils.c
@@ -40,7 +40,7 @@
#include <string.h>
#include <errno.h>
-#if HAVE_LANGINFO_H && !defined( __APPLE__ )
+#if HAVE_NL_LANGINFO && !defined( __APPLE__ )
# include <langinfo.h>
#endif
@@ -51,7 +51,7 @@ static const char *current_encoding()
{
#if defined( __APPLE__ )
return "UTF8";
-#elif !HAVE_LANGINFO_H
+#elif !HAVE_NL_LANGINFO
return "UTF-8";
#else
static int locale_set = 0;
--
2.19.1
......@@ -20,6 +20,7 @@ endif
libdsm: libdsm-$(LIBDSM_VERSION).tar.gz .sum-libdsm
$(UNPACK)
$(APPLY) $(SRC)/libdsm/0001-build-fix-nl_langinfo-detection-on-Android.patch
$(MOVE)
DEPS_libdsm = libtasn1 iconv
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment