From 6a6e9d22b338bb2c290b7c7fd0ae434ad13232d9 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 26 Jun 2018 23:22:25 +0900 Subject: lib: Compile custom glob() implementation for Android The Android C library doesn't provide the glob() function which we use in the configfs code. Add conditional compilation to cmake such that a local copy of glob is automatically compiled if glob isn't provided. Signed-off-by: Paul Elder Signed-off-by: Laurent Pinchart --- include/config.h.in | 9 +++++++++ include/glob.h | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 include/config.h.in create mode 100644 include/glob.h (limited to 'include') diff --git a/include/config.h.in b/include/config.h.in new file mode 100644 index 0000000..c968271 --- /dev/null +++ b/include/config.h.in @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ + +#ifndef __UVC_GADGET_CONFIG_H__ +#define __UVC_GADGET_CONFIG_H__ + +#cmakedefine HAVE_DIRENT_H @HAVE_DIRENT_H@ +#cmakedefine HAVE_GLOB @HAVE_GLOB@ + +#endif diff --git a/include/glob.h b/include/glob.h new file mode 100644 index 0000000..d3ddcff --- /dev/null +++ b/include/glob.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * glob() compatibility + * + * Copyright (C) 2018 Laurent Pinchart + * + * Contact: Laurent Pinchart + */ +#ifndef __UVC_GADGET_GLOB_H__ +#define __UVC_GADGET_GLOB_H__ + +#include "config.h" + +#ifdef HAVE_GLOB +#include_next +#else +#include "compat/glob.h" +#endif + +#endif /* __UVC_GADGET_GLOB_H__ */ -- cgit v1.2.3