diff options
author | Austin Seipp <aseipp@pobox.com> | 2017-11-26 19:29:00 -0600 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2017-12-10 16:06:01 -0600 |
commit | 997bb216aa37010826067d0cfa33b4fde5aaa225 (patch) | |
tree | 63e968981b6be6ffa17ccf9612b8c5d2cf639a25 | |
parent | 04035f0c7eaf26ef0a74e36e0edf1adddecb62b5 (diff) |
build: require explicit include paths for libbcachefs/
This removes the implicit `-I libbcachefs` argument to $(CC), which in turn
requires a set of minor changes throughout the tools. There are two advantages
to this setup:
1) It is (arguably) easier to read, since the location of bcachefs includes
are easier to understand at a glance ("where does util.h live?")
2) It removes the need for a hack to include glibc's copy of
dirent.h explicitly via '/usr/include/dirent.h', because libbcachefs/
*also* has a dirent.h file and the compiler cannot disambiguate them.
This has some ramifications on systems where /usr/include may not
exist, such as NixOS.
Signed-off-by: Austin Seipp <aseipp@pobox.com>
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cmd_assemble.c | 2 | ||||
-rw-r--r-- | cmd_debug.c | 16 | ||||
-rw-r--r-- | cmd_device.c | 4 | ||||
-rw-r--r-- | cmd_format.c | 6 | ||||
-rw-r--r-- | cmd_fsck.c | 4 | ||||
-rw-r--r-- | cmd_key.c | 2 | ||||
-rw-r--r-- | cmd_migrate.c | 22 | ||||
-rw-r--r-- | cmd_run.c | 2 | ||||
-rw-r--r-- | crypto.c | 2 | ||||
-rw-r--r-- | libbcachefs.c | 8 | ||||
-rw-r--r-- | libbcachefs.h | 4 | ||||
-rw-r--r-- | tools-util.c | 4 |
13 files changed, 39 insertions, 39 deletions
@@ -4,7 +4,7 @@ INSTALL=install CFLAGS+=-std=gnu89 -O2 -g -MMD -Wall \ -Wno-pointer-sign \ -fno-strict-aliasing \ - -I. -Iinclude -Ilibbcachefs \ + -I. -Iinclude \ -D_FILE_OFFSET_BITS=64 \ -D_GNU_SOURCE \ -D_LGPL_SOURCE \ diff --git a/cmd_assemble.c b/cmd_assemble.c index 051c32f8..5fbabdd9 100644 --- a/cmd_assemble.c +++ b/cmd_assemble.c @@ -7,7 +7,7 @@ #include <string.h> #include <sys/ioctl.h> -#include "bcachefs_ioctl.h" +#include "libbcachefs/bcachefs_ioctl.h" #include "cmds.h" int cmd_assemble(int argc, char *argv[]) diff --git a/cmd_debug.c b/cmd_debug.c index 7ee4e1f2..b1bdda8c 100644 --- a/cmd_debug.c +++ b/cmd_debug.c @@ -8,14 +8,14 @@ #include "qcow2.h" #include "tools-util.h" -#include "bcachefs.h" -#include "alloc.h" -#include "btree_cache.h" -#include "btree_iter.h" -#include "buckets.h" -#include "error.h" -#include "journal.h" -#include "super.h" +#include "libbcachefs/bcachefs.h" +#include "libbcachefs/alloc.h" +#include "libbcachefs/btree_cache.h" +#include "libbcachefs/btree_iter.h" +#include "libbcachefs/buckets.h" +#include "libbcachefs/error.h" +#include "libbcachefs/journal.h" +#include "libbcachefs/super.h" static void dump_usage(void) { diff --git a/cmd_device.c b/cmd_device.c index e5a2f09e..f2d751c5 100644 --- a/cmd_device.c +++ b/cmd_device.c @@ -12,10 +12,10 @@ #include <sys/types.h> #include <unistd.h> -#include "bcachefs_ioctl.h" +#include "libbcachefs/bcachefs_ioctl.h" #include "cmds.h" #include "libbcachefs.h" -#include "opts.h" +#include "libbcachefs/opts.h" #include "tools-util.h" /* This code belongs under show_fs */ diff --git a/cmd_format.c b/cmd_format.c index 9cc56a5f..b22fe946 100644 --- a/cmd_format.c +++ b/cmd_format.c @@ -24,9 +24,9 @@ #include "cmds.h" #include "libbcachefs.h" #include "crypto.h" -#include "opts.h" -#include "super-io.h" -#include "util.h" +#include "libbcachefs/opts.h" +#include "libbcachefs/super-io.h" +#include "libbcachefs/util.h" #define OPTS \ t("bcachefs format - create a new bcachefs filesystem on one or more devices") \ @@ -1,8 +1,8 @@ #include "cmds.h" -#include "error.h" +#include "libbcachefs/error.h" #include "libbcachefs.h" -#include "super.h" +#include "libbcachefs/super.h" #include "tools-util.h" static void usage(void) @@ -3,7 +3,7 @@ #include <uuid/uuid.h> #include "cmds.h" -#include "checksum.h" +#include "libbcachefs/checksum.h" #include "crypto.h" #include "libbcachefs.h" diff --git a/cmd_migrate.c b/cmd_migrate.c index ec6c8314..d683a5f2 100644 --- a/cmd_migrate.c +++ b/cmd_migrate.c @@ -1,4 +1,4 @@ -#include </usr/include/dirent.h> +#include <dirent.h> #include <errno.h> #include <fcntl.h> #include <getopt.h> @@ -24,16 +24,16 @@ #include <linux/dcache.h> #include <linux/generic-radix-tree.h> #include <linux/xattr.h> -#include "bcachefs.h" -#include "btree_update.h" -#include "buckets.h" -#include "dirent.h" -#include "fs.h" -#include "inode.h" -#include "io.h" -#include "str_hash.h" -#include "super.h" -#include "xattr.h" +#include "libbcachefs/bcachefs.h" +#include "libbcachefs/btree_update.h" +#include "libbcachefs/buckets.h" +#include "libbcachefs/dirent.h" +#include "libbcachefs/fs.h" +#include "libbcachefs/inode.h" +#include "libbcachefs/io.h" +#include "libbcachefs/str_hash.h" +#include "libbcachefs/super.h" +#include "libbcachefs/xattr.h" static char *dev_t_to_path(dev_t dev) { @@ -11,7 +11,7 @@ #include <uuid/uuid.h> -#include "bcachefs_ioctl.h" +#include "libbcachefs/bcachefs_ioctl.h" #include "cmds.h" int cmd_run(int argc, char *argv[]) @@ -15,7 +15,7 @@ #include <libscrypt.h> #include <uuid/uuid.h> -#include "checksum.h" +#include "libbcachefs/checksum.h" #include "crypto.h" char *read_passphrase(const char *prompt) diff --git a/libbcachefs.c b/libbcachefs.c index b9c3d57a..bb2aee57 100644 --- a/libbcachefs.c +++ b/libbcachefs.c @@ -12,12 +12,12 @@ #include <uuid/uuid.h> -#include "bcachefs_format.h" -#include "checksum.h" +#include "libbcachefs/bcachefs_format.h" +#include "libbcachefs/checksum.h" #include "crypto.h" #include "libbcachefs.h" -#include "opts.h" -#include "super-io.h" +#include "libbcachefs/opts.h" +#include "libbcachefs/super-io.h" #define NSEC_PER_SEC 1000000000L diff --git a/libbcachefs.h b/libbcachefs.h index 99a4c132..2e49edd8 100644 --- a/libbcachefs.h +++ b/libbcachefs.h @@ -4,9 +4,9 @@ #include <linux/uuid.h> #include <stdbool.h> -#include "bcachefs_format.h" +#include "libbcachefs/bcachefs_format.h" #include "tools-util.h" -#include "vstructs.h" +#include "libbcachefs/vstructs.h" struct format_opts { char *label; diff --git a/tools-util.c b/tools-util.c index 7c88c9d4..90bbda2a 100644 --- a/tools-util.c +++ b/tools-util.c @@ -16,10 +16,10 @@ #include <blkid.h> #include <uuid/uuid.h> -#include "bcachefs_ioctl.h" +#include "libbcachefs/bcachefs_ioctl.h" #include "linux/sort.h" #include "tools-util.h" -#include "util.h" +#include "libbcachefs/util.h" void die(const char *fmt, ...) { |