diff options
Diffstat (limited to 'src/libsystemd-basic')
7 files changed, 24 insertions, 7 deletions
diff --git a/src/libsystemd-basic/include/systemd-basic/btrfs-ctree.h b/src/libsystemd-basic/include/systemd-basic/btrfs-ctree.h index 66bdf9736e..15e6d5582c 100644 --- a/src/libsystemd-basic/include/systemd-basic/btrfs-ctree.h +++ b/src/libsystemd-basic/include/systemd-basic/btrfs-ctree.h @@ -1,6 +1,7 @@ #pragma once #include "macro.h" +#include "missing.h" /* for BTRFS_UUID_SIZE */ #include "sparse-endian.h" /* Stolen from btrfs' ctree.h */ diff --git a/src/libsystemd-basic/include/systemd-basic/missing_syscall.h b/src/libsystemd-basic/include/systemd-basic/missing_syscall.h index e6fd67cb9d..9afba975fb 100644 --- a/src/libsystemd-basic/include/systemd-basic/missing_syscall.h +++ b/src/libsystemd-basic/include/systemd-basic/missing_syscall.h @@ -22,6 +22,10 @@ /* Missing glibc definitions to access certain kernel APIs */ +#if __INCLUDE_LEVEL__ <= 1 +#error "Do not include missing_syscall.h directly; include it through missing.h." +#endif + #if !HAVE_DECL_PIVOT_ROOT static inline int pivot_root(const char *new_root, const char *put_old) { return syscall(SYS_pivot_root, new_root, put_old); diff --git a/src/libsystemd-basic/include/systemd-basic/raw-clone.h b/src/libsystemd-basic/include/systemd-basic/raw-clone.h index d473828999..33fdf02f09 100644 --- a/src/libsystemd-basic/include/systemd-basic/raw-clone.h +++ b/src/libsystemd-basic/include/systemd-basic/raw-clone.h @@ -21,6 +21,7 @@ #include <sched.h> #include <sys/syscall.h> +#include <unistd.h> #include "log.h" #include "macro.h" diff --git a/src/libsystemd-basic/include/systemd-basic/rm-rf.h b/src/libsystemd-basic/include/systemd-basic/rm-rf.h index f693a5bb7c..8d315792ac 100644 --- a/src/libsystemd-basic/include/systemd-basic/rm-rf.h +++ b/src/libsystemd-basic/include/systemd-basic/rm-rf.h @@ -19,8 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdlib.h> #include <sys/stat.h> +#include "macro.h" + typedef enum RemoveFlags { REMOVE_ONLY_DIRECTORIES = 1, REMOVE_ROOT = 2, diff --git a/src/libsystemd-basic/include/systemd-basic/socket-util.h b/src/libsystemd-basic/include/systemd-basic/socket-util.h index 7f1a87bc3e..f0f12c8c2e 100644 --- a/src/libsystemd-basic/include/systemd-basic/socket-util.h +++ b/src/libsystemd-basic/include/systemd-basic/socket-util.h @@ -27,8 +27,8 @@ #include <sys/types.h> #include <sys/un.h> -#include <linux/netlink.h> #include <linux/if_packet.h> +#include <linux/netlink.h> #include "macro.h" #include "util.h" diff --git a/src/libsystemd-basic/include/systemd-basic/time-util.h b/src/libsystemd-basic/include/systemd-basic/time-util.h index 558b0b5b7f..977f7b6bc5 100644 --- a/src/libsystemd-basic/include/systemd-basic/time-util.h +++ b/src/libsystemd-basic/include/systemd-basic/time-util.h @@ -26,6 +26,8 @@ #include <stdio.h> #include <time.h> +#include "macro.h" + typedef uint64_t usec_t; typedef uint64_t nsec_t; diff --git a/src/libsystemd-basic/src/Makefile b/src/libsystemd-basic/src/Makefile index 76336dca63..fd72f23308 100644 --- a/src/libsystemd-basic/src/Makefile +++ b/src/libsystemd-basic/src/Makefile @@ -23,7 +23,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))/../../../config.mk include $(topsrcdir)/build-aux/Makefile.head.mk -noinst_LTLIBRARIES += \ +rootlibexec_LTLIBRARIES += \ libsystemd-basic.la libsystemd_basic_la_SOURCES = \ @@ -238,19 +238,19 @@ libsystemd_basic_la_LIBADD = \ -lrt \ -lm -$(outdir)/errno-list.txt: +$(outdir)/errno-list.txt: | $(outdir)/$(DEPDIR) $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@ $(outdir)/errno-to-name.h: $(outdir)/errno-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const errno_names[] = { "} !/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ -$(outdir)/af-list.txt: +$(outdir)/af-list.txt: | $(outdir)/$(DEPDIR) $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include sys/socket.h - </dev/null | grep -v AF_UNSPEC | grep -v AF_MAX | $(AWK) '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $$2; }' >$@ $(outdir)/af-to-name.h: $(outdir)/af-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const af_names[] = { "} !/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ { printf "[%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@ -$(outdir)/arphrd-list.txt: +$(outdir)/arphrd-list.txt: | $(outdir)/$(DEPDIR) $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@ $(outdir)/arphrd-to-name.h: $(outdir)/arphrd-list.txt @@ -259,8 +259,8 @@ $(outdir)/arphrd-to-name.h: $(outdir)/arphrd-list.txt $(outdir)/arphrd-from-name.gperf: $(outdir)/arphrd-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct arphrd_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, ARPHRD_%s\n", $$1, $$1 }' <$< >$@ -$(outdir)/cap-list.txt: - $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/capability.h -include missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@ +$(outdir)/cap-list.txt: | $(outdir)/$(DEPDIR) + $(AM_V_GEN)$(CPP) $(sd.ALL_CPPFLAGS) -dM -include linux/capability.h -include systemd-basic/missing.h - </dev/null | $(AWK) '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $$2; }' | grep -v CAP_LAST_CAP >$@ $(outdir)/cap-to-name.h: $(outdir)/cap-list.txt $(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const capability_names[] = { "} { printf "[%s] = \"%s\",\n", $$1, tolower($$1) } END{print "};"}' <$< >$@ @@ -271,4 +271,10 @@ $(outdir)/cap-from-name.gperf: $(outdir)/cap-list.txt $(outdir)/cap-from-name.h: $(outdir)/cap-from-name.gperf $(AM_V_GPERF)$(GPERF) -L ANSI-C -t --ignore-case -N lookup_capability -H hash_capability_name -p -C <$< >$@ +$(outdir)/af-list.lo: $(outdir)/af-from-name.h $(outdir)/af-to-name.h +$(outdir)/arphrd-list.lo: $(outdir)/arphrd-from-name.h $(outdir)/arphrd-to-name.h +$(outdir)/cap-list.lo: $(outdir)/cap-from-name.h $(outdir)/cap-to-name.h +$(outdir)/errno-list.lo: $(outdir)/errno-from-name.h $(outdir)/errno-to-name.h +sd.CPPFLAGS += $(libsystemd-basic.CPPFLAGS) + include $(topsrcdir)/build-aux/Makefile.tail.mk |