diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2018-06-26 23:22:25 +0900 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-07-31 15:56:48 +0300 |
commit | 6a6e9d22b338bb2c290b7c7fd0ae434ad13232d9 (patch) | |
tree | 9f9a2a1d0f12881acc0f46e93a246eb90f39daba /include | |
parent | 35a4212180272b5dd648b99c07a692aab19a5e67 (diff) |
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 <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/config.h.in | 9 | ||||
-rw-r--r-- | include/glob.h | 20 |
2 files changed, 29 insertions, 0 deletions
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 <laurent.pinchart@ideasonboard.com> + */ +#ifndef __UVC_GADGET_GLOB_H__ +#define __UVC_GADGET_GLOB_H__ + +#include "config.h" + +#ifdef HAVE_GLOB +#include_next <glob.h> +#else +#include "compat/glob.h" +#endif + +#endif /* __UVC_GADGET_GLOB_H__ */ |