diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-02-01 11:01:42 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-02-01 11:01:42 -0500 |
commit | 33d320ab80aebb89dc63931684ef2e748b5fb91c (patch) | |
tree | 0d501481e3c76b48ea6a9d1a018c589703b628c8 | |
parent | 185026706d926d1f94bd1c42a11dd83e6b8e74ec (diff) | |
download | bfs-33d320ab80aebb89dc63931684ef2e748b5fb91c.tar.xz |
util: Allow configuration macros to be specified with -D
In case we need to override them at build time.
-rw-r--r-- | posix1e.h | 2 | ||||
-rw-r--r-- | util.h | 29 |
2 files changed, 24 insertions, 7 deletions
@@ -21,7 +21,7 @@ #include "util.h" #include <stdbool.h> -#if BFS_HAS_SYS_CAPABILITY && !__FreeBSD__ +#if !defined(BFS_HAS_POSIX1E_CAPABILITIES) && BFS_HAS_SYS_CAPABILITY && !__FreeBSD__ # include <sys/capability.h> # ifdef CAP_CHOWN # define BFS_HAS_POSIX1E_CAPABILITIES true @@ -39,12 +39,29 @@ # define BFS_HAS_INCLUDE(header, fallback) fallback #endif -#define BFS_HAS_MNTENT BFS_HAS_INCLUDE(<mntent.h>, __GLIBC__) -#define BFS_HAS_SYS_ACL BFS_HAS_INCLUDE(<sys/acl.h>, true) -#define BFS_HAS_SYS_CAPABILITY BFS_HAS_INCLUDE(<sys/capability.h>, __linux__) -#define BFS_HAS_SYS_MKDEV BFS_HAS_INCLUDE(<sys/mkdev.h>, false) -#define BFS_HAS_SYS_PARAM BFS_HAS_INCLUDE(<sys/param.h>, true) -#define BFS_HAS_SYS_SYSMACROS BFS_HAS_INCLUDE(<sys/sysmacros.h>, __GLIBC__) +#ifndef BFS_HAS_MNTENT +# define BFS_HAS_MNTENT BFS_HAS_INCLUDE(<mntent.h>, __GLIBC__) +#endif + +#ifndef BFS_HAS_SYS_ACL +# define BFS_HAS_SYS_ACL BFS_HAS_INCLUDE(<sys/acl.h>, true) +#endif + +#ifndef BFS_HAS_SYS_CAPABILITY +# define BFS_HAS_SYS_CAPABILITY BFS_HAS_INCLUDE(<sys/capability.h>, __linux__) +#endif + +#ifndef BFS_HAS_SYS_MKDEV +# define BFS_HAS_SYS_MKDEV BFS_HAS_INCLUDE(<sys/mkdev.h>, false) +#endif + +#ifndef BFS_HAS_SYS_PARAM +# define BFS_HAS_SYS_PARAM BFS_HAS_INCLUDE(<sys/param.h>, true) +#endif + +#ifndef BFS_HAS_SYS_SYSMACROS +# define BFS_HAS_SYS_SYSMACROS BFS_HAS_INCLUDE(<sys/sysmacros.h>, __GLIBC__) +#endif #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) # define FNM_CASEFOLD FNM_IGNORECASE |