Skip to contentSkip to conversation

Move libfsverity.h to its own directory

PATCH New Eric Biggers 1 participant 1 message Sep 23, 2020

Subsystems (3)
lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 Move libfsverity.h to its own directory

From: Eric Biggers <[email protected]>

libfsverity.h is the public API, but the other headers in common/ are private headers for fsverity-utils. Move libfsverity.h to its own directory to make this clear. This is also needed for Android's build system in order to restrict the exported headers to libfsverity.h.

This doesn't affect users who are using 'make install', since 'make install' still installs libfsverity.h to the same place, and it doesn't install any private headers.

---
 Makefile                          | 4 ++--
 {common => include}/libfsverity.h | 0
 lib/lib_private.h                 | 2 +-
 programs/utils.h                  | 2 +-
 scripts/do-release.sh             | 2 +-
 scripts/run-sparse.sh             | 2 +-
 scripts/run-tests.sh              | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
 rename {common => include}/libfsverity.h (100%)
Makefile +2 -2
index ec23ed6..deffe8b 100644
@@ -44,7 +44,7 @@ CFLAGS ?= -O2 -Wall -Wundef					\
 	$(call cc-option,-Wunused-parameter)			\
 	$(call cc-option,-Wvla)
 
-override CPPFLAGS := -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
+override CPPFLAGS := -Iinclude -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
 
 ifneq ($(V),1)
 QUIET_CC        = @echo '  CC      ' $@;
@@ -182,7 +182,7 @@ install:all
 	install -m644 libfsverity.a $(DESTDIR)$(LIBDIR)
 	install -m755 libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)
 	ln -sf libfsverity.so.$(SOVERSION) $(DESTDIR)$(LIBDIR)/libfsverity.so
-	install -m644 common/libfsverity.h $(DESTDIR)$(INCDIR)
+	install -m644 include/libfsverity.h $(DESTDIR)$(INCDIR)
 
 uninstall:
 	rm -f $(DESTDIR)$(BINDIR)/fsverity
include/libfsverity.h renamed from common/libfsverity.h +0 -0
similarity index 100%
rename from common/libfsverity.h
rename to include/libfsverity.h
lib/lib_private.h +1 -1
index 54f583e..ff00490 100644
@@ -11,7 +11,7 @@
 #ifndef LIB_LIB_PRIVATE_H
 #define LIB_LIB_PRIVATE_H
 
-#include "../common/libfsverity.h"
+#include "libfsverity.h"
 #include "../common/common_defs.h"
 #include "../common/fsverity_uapi.h"
 
programs/utils.h +1 -1
index cd5641c..6968708 100644
@@ -11,7 +11,7 @@
 #ifndef PROGRAMS_UTILS_H
 #define PROGRAMS_UTILS_H
 
-#include "../common/libfsverity.h"
+#include "libfsverity.h"
 #include "../common/common_defs.h"
 
 #include <stdio.h>
scripts/do-release.sh +1 -1
index 9662919..255fc53 100755
@@ -27,7 +27,7 @@ major=$(echo "$VERS" | cut -d. -f1)
 minor=$(echo "$VERS" | cut -d. -f2)
 sed -E -i -e "/FSVERITY_UTILS_MAJOR_VERSION/s/[0-9]+/$major/" \
 	  -e "/FSVERITY_UTILS_MINOR_VERSION/s/[0-9]+/$minor/" \
-	  common/libfsverity.h
+	  include/libfsverity.h
 git commit -a --signoff --message="v$VERS"
 git tag --sign "v$VERS" --message="$PKG"
 
scripts/run-sparse.sh +1 -1
index 5b6a0ba..fe43ce2 100755
@@ -10,5 +10,5 @@ set -e -u -o pipefail
 
 find . -name '*.c' | while read -r file; do
 	sparse "$file" -gcc-base-dir "$(gcc --print-file-name=)"	\
-		-D_FILE_OFFSET_BITS=64 -I. -Wbitwise
+		-D_FILE_OFFSET_BITS=64 -Iinclude -Wbitwise
 done
scripts/run-tests.sh +1 -1
index 44df304..c061e34 100755
@@ -71,7 +71,7 @@ int main()
 	std::cout << libfsverity_get_digest_size(FS_VERITY_HASH_ALG_SHA256) << std::endl;
 }
 EOF
-c++ -Wall -Werror "$TMPDIR/test.cc" -Icommon -L. -lfsverity -o "$TMPDIR/test"
+c++ -Wall -Werror "$TMPDIR/test.cc" -Iinclude -L. -lfsverity -o "$TMPDIR/test"
 [ "$(LD_LIBRARY_PATH=. "$TMPDIR/test")" = "32" ]
 rm "${TMPDIR:?}"/*
 
Signature · 1 line
2.28.0