]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
build: require explicit include paths for libbcachefs/
authorAustin Seipp <aseipp@pobox.com>
Mon, 27 Nov 2017 01:29:00 +0000 (19:29 -0600)
committerAustin Seipp <aseipp@pobox.com>
Sun, 10 Dec 2017 22:06:01 +0000 (16:06 -0600)
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>
13 files changed:
Makefile
cmd_assemble.c
cmd_debug.c
cmd_device.c
cmd_format.c
cmd_fsck.c
cmd_key.c
cmd_migrate.c
cmd_run.c
crypto.c
libbcachefs.c
libbcachefs.h
tools-util.c

index 6538fe78aa7ccea8d1c1c8de8f9ecd9fb562fb83..f1e0da2589117283ea1a4fdd4ba25fbcfc417d8a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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                                          \
index 051c32f8688f76ec96d825fffb0da5d442674664..5fbabdd95998c4101d5390eebd6af920394389ca 100644 (file)
@@ -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[])
index 7ee4e1f233e6d07c6c226d7099f15681c65e171c..b1bdda8c3e9174cc0b3acea82a69aaf4aaf1b96b 100644 (file)
@@ -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)
 {
index e5a2f09e64b8479b9097c415a1fcb9ab38fe3d15..f2d751c593c9e4fb053da3e00069d11558be3df6 100644 (file)
 #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 */
index 9cc56a5fc0175f2c6fe3cfa00914625f65874522..b22fe9461b6080c56c5c8a55d806256c3c56de46 100644 (file)
@@ -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") \
index 22422233325cc3993bed2b1c2f532309a435aaaa..9b01524a01c583beb6bfa0a86037e577ffbcb574 100644 (file)
@@ -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)
index b5bacf1c991ffd301e3b3aa3add29000b9fd1d71..879163f151d2c1ab542702e14632afce584f21bd 100644 (file)
--- a/cmd_key.c
+++ b/cmd_key.c
@@ -3,7 +3,7 @@
 #include <uuid/uuid.h>
 
 #include "cmds.h"
-#include "checksum.h"
+#include "libbcachefs/checksum.h"
 #include "crypto.h"
 #include "libbcachefs.h"
 
index ec6c8314dd269aec86b0aa32635e3ae04ee0644b..d683a5f2f4eac36ac68ec17ba74513f3ff0d575e 100644 (file)
@@ -1,4 +1,4 @@
-#include </usr/include/dirent.h>
+#include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #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)
 {
index cffc54b805d7a22c386c9d5e8c0f639879a44ca0..bbb37e5dc10d67ba53d83f5055943ec896933b38 100644 (file)
--- a/cmd_run.c
+++ b/cmd_run.c
@@ -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[])
index 306071f96ccf23050e5a09789e699f9063342e65..0e18b36ff81aa6e4f535cea29c8bc6ba52df3db1 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -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)
index b9c3d57a67fb898b61f644d22a60e8d03174529d..bb2aee57da8313f8387882b2c34511a72468b213 100644 (file)
 
 #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
 
index 99a4c13282b78a7f851e980b094e595168f05f88..2e49edd8eca92bc6d86ed8bbf24c45c91254ad2a 100644 (file)
@@ -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;
index 7c88c9d42a814e821b11d673857416d1e84848c8..90bbda2a46f835dc6897897e3cb9bfc9d5e473a9 100644 (file)
 #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, ...)
 {