diff options
author | Martin Pitt <martinpitt@users.noreply.github.com> | 2017-04-21 21:36:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-21 21:36:56 +0200 |
commit | 56744c037da0ba2032fba0c7ac116317bb5ae4ae (patch) | |
tree | db0347ca9acff034003a7d947fd9e77729affa41 | |
parent | 301fb51922d435d5f5ef02d234dc7a271ecca930 (diff) | |
parent | 62cc1c55cb6909c9b0065bf55940bc5a5780f67b (diff) | |
download | systemd-56744c037da0ba2032fba0c7ac116317bb5ae4ae.tar.gz systemd-56744c037da0ba2032fba0c7ac116317bb5ae4ae.tar.bz2 systemd-56744c037da0ba2032fba0c7ac116317bb5ae4ae.zip |
Merge pull request #5756 from keszybz/make-cleanups
Various meson-independent cleanups from the meson patchset
-rw-r--r-- | Makefile.am | 47 | ||||
-rw-r--r-- | configure.ac | 19 | ||||
-rw-r--r-- | src/basic/def.h | 4 | ||||
-rw-r--r-- | src/basic/missing.h | 2 | ||||
-rw-r--r-- | src/basic/random-util.c | 8 | ||||
-rw-r--r-- | src/journal-remote/journal-remote.c | 2 | ||||
-rw-r--r-- | src/journal-remote/microhttpd-util.h | 13 | ||||
-rw-r--r-- | src/journal/test-compress-benchmark.c | 7 | ||||
-rw-r--r-- | src/journal/test-compress.c | 6 | ||||
-rw-r--r-- | src/libsystemd/sd-bus/test-bus-track.c | 2 | ||||
-rw-r--r-- | src/rc-local-generator/rc-local-generator.c | 8 | ||||
-rw-r--r-- | src/resolve/resolved-dns-server.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-dns-transaction.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-dns-trust-anchor.c | 2 | ||||
-rw-r--r-- | src/shared/cgroup-show.c | 2 | ||||
-rw-r--r-- | src/shared/cgroup-show.h | 2 | ||||
-rw-r--r-- | src/shared/dissect-image.c | 8 | ||||
-rw-r--r-- | src/test/test-exec-util.c | 2 | ||||
-rw-r--r-- | units/systemd-networkd.service.m4.in | 1 |
19 files changed, 78 insertions, 61 deletions
diff --git a/Makefile.am b/Makefile.am index 6ef20c8032..4ba230569a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2990,22 +2990,24 @@ endif endif # ------------------------------------------------------------------------------ -systemd_boot_headers = \ - src/boot/efi/util.h \ +efi_headers = \ src/boot/efi/console.h \ + src/boot/efi/disk.h \ src/boot/efi/graphics.h \ - src/boot/efi/pefile.h \ + src/boot/efi/linux.h \ src/boot/efi/measure.h \ - src/boot/efi/disk.h + src/boot/efi/pefile.h \ + src/boot/efi/splash.h \ + src/boot/efi/util.h systemd_boot_sources = \ - src/boot/efi/util.c \ + src/boot/efi/boot.c \ src/boot/efi/console.c \ - src/boot/efi/graphics.c \ - src/boot/efi/pefile.c \ src/boot/efi/disk.c \ + src/boot/efi/graphics.c \ src/boot/efi/measure.c \ - src/boot/efi/boot.c + src/boot/efi/pefile.c \ + src/boot/efi/util.c EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers) @@ -3017,7 +3019,7 @@ if ENABLE_EFI if HAVE_GNUEFI bootlib_DATA = $(systemd_boot) -$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers)) +$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(efi_headers)) @$(MKDIR_P) $(top_builddir)/src/boot/efi/ $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ @@ -3035,24 +3037,15 @@ endif CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot) # ------------------------------------------------------------------------------ -stub_headers = \ - src/boot/efi/util.h \ - src/boot/efi/pefile.h \ - src/boot/efi/disk.h \ - src/boot/efi/graphics.h \ - src/boot/efi/splash.h \ - src/boot/efi/measure.h \ - src/boot/efi/linux.h - stub_sources = \ - src/boot/efi/util.c \ - src/boot/efi/pefile.c \ src/boot/efi/disk.c \ src/boot/efi/graphics.c \ - src/boot/efi/splash.c \ src/boot/efi/linux.c \ src/boot/efi/measure.c \ - src/boot/efi/stub.c + src/boot/efi/pefile.c \ + src/boot/efi/splash.c \ + src/boot/efi/stub.c \ + src/boot/efi/util.c EXTRA_DIST += \ $(stub_sources) \ @@ -3067,10 +3060,6 @@ if ENABLE_EFI if HAVE_GNUEFI bootlib_DATA += $(stub) -$(top_builddir)/src/boot/efi/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers)) - @$(MKDIR_P) $(top_builddir)/src/boot/efi/ - $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ - $(stub_solib): $(stub_objects) $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \ -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \ @@ -5933,10 +5922,8 @@ dist_dbuspolicy_DATA += \ GENERAL_ALIASES += \ $(systemunitdir)/systemd-networkd.socket $(pkgsysconfdir)/system/sockets.target.wants/systemd-networkd.socket \ $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/multi-user.target.wants/systemd-networkd.service \ - $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service - -SYSTEM_UNIT_ALIASES += \ - systemd-networkd.service dbus-org.freedesktop.network1.service + $(systemunitdir)/systemd-networkd-wait-online.service $(pkgsysconfdir)/system/network-online.target.wants/systemd-networkd-wait-online.service \ + $(systemunitdir)/systemd-networkd.service $(pkgsysconfdir)/system/dbus-org.freedesktop.network1.service BUSNAMES_TARGET_WANTS += \ org.freedesktop.network1.busname diff --git a/configure.ac b/configure.ac index 68e82463a3..13e758331e 100644 --- a/configure.ac +++ b/configure.ac @@ -328,7 +328,6 @@ AC_CHECK_DECLS([ pivot_root, name_to_handle_at, setns, - getrandom, renameat2, kcmp, keyctl, @@ -343,6 +342,13 @@ AC_CHECK_DECLS([ #include <sched.h> #include <string.h> #include <linux/loop.h> +]]) + +AC_CHECK_DECLS([getrandom], + [AC_DEFINE([USE_SYS_RANDOM_H], [], [sys/random.h is usable])], + [AC_CHECK_DECLS([getrandom], [], [], [[ +#include <sys/random.h> +]])], [[ #include <linux/random.h> ]]) @@ -399,6 +405,16 @@ AS_IF([test "x$enable_dbus" != "xno"], [ AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"]) # ------------------------------------------------------------------------------ +have_glib=no +AC_ARG_ENABLE(glib, AS_HELP_STRING([--disable-glib], [disable usage of glib,gobject,gio in tests])) +AS_IF([test "x$enable_glib" != "xno"], [ + PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0 gio-2.0], + [AC_DEFINE(HAVE_GLIB, 1, [Define if glib,gobject,gio are available]) have_glib=yes], + [have_glib=no]) + AS_IF([test "x$have_glib" = "xno" -a "x$enable_glib" = "xyes"], + [AC_MSG_ERROR([*** glib support requested but libraries not found])])]) + +# ------------------------------------------------------------------------------ have_utmp=yes AC_ARG_ENABLE([utmp], AS_HELP_STRING([--disable-utmp], [disable utmp/wtmp log handling]), AS_CASE("x${enableval}", @@ -1741,6 +1757,7 @@ AC_MSG_RESULT([ blkid: ${have_blkid} libmount: ${have_libmount} dbus: ${have_dbus} + glib: ${have_glib} nss-myhostname: ${have_myhostname} hwdb: ${enable_hwdb} tpm: ${have_tpm} diff --git a/src/basic/def.h b/src/basic/def.h index 200ea973c1..b1a3bc190b 100644 --- a/src/basic/def.h +++ b/src/basic/def.h @@ -67,10 +67,6 @@ .un.sun_path = "\0/org/freedesktop/plymouthd", \ } -#ifndef TTY_GID -#define TTY_GID 5 -#endif - #define NOTIFY_FD_MAX 768 #define NOTIFY_BUFFER_MAX PIPE_BUF diff --git a/src/basic/missing.h b/src/basic/missing.h index 284cbaffc0..e860fa7c2c 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -68,8 +68,6 @@ struct sockaddr_vm { }; #endif /* !HAVE_LINUX_VM_SOCKETS_H */ -#include "macro.h" - #ifndef RLIMIT_RTTIME #define RLIMIT_RTTIME 15 #endif diff --git a/src/basic/random-util.c b/src/basic/random-util.c index ad7b3eedf2..b216be579d 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -27,7 +27,13 @@ #include <stdint.h> #ifdef HAVE_SYS_AUXV_H -#include <sys/auxv.h> +# include <sys/auxv.h> +#endif + +#ifdef USE_SYS_RANDOM_H +# include <sys/random.h> +#else +# include <linux/random.h> #endif #include "fd-util.h" diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 2d1a88027a..36c1a32dcd 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -529,7 +529,7 @@ static int process_http_upload( log_warning("Failed to process data for connection %p", connection); if (r == -E2BIG) return mhd_respondf(connection, - r, MHD_HTTP_REQUEST_ENTITY_TOO_LARGE, + r, MHD_HTTP_PAYLOAD_TOO_LARGE, "Entry is too large, maximum is " STRINGIFY(DATA_SIZE_MAX) " bytes."); else return mhd_respondf(connection, diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h index 49def4f630..7f88c2cb7d 100644 --- a/src/journal-remote/microhttpd-util.h +++ b/src/journal-remote/microhttpd-util.h @@ -31,14 +31,21 @@ # define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE #endif +/* Renamed in µhttpd 0.9.51 */ +#ifndef MHD_USE_PIPE_FOR_SHUTDOWN +# define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN +#endif + /* Renamed in µhttpd 0.9.52 */ #ifndef MHD_USE_EPOLL_LINUX_ONLY # define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY #endif -/* Renamed in µhttpd 0.9.51 */ -#ifndef MHD_USE_PIPE_FOR_SHUTDOWN -# define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN +/* Both the old and new names are defines, check for the new one. */ + +/* Renamed in µhttpd 0.9.53 */ +#ifndef MHD_HTTP_PAYLOAD_TOO_LARGE +# define MHD_HTTP_PAYLOAD_TOO_LARGE MHD_HTTP_REQUEST_ENTITY_TOO_LARGE #endif #if MHD_VERSION < 0x00094203 diff --git a/src/journal/test-compress-benchmark.c b/src/journal/test-compress-benchmark.c index 6f6d71435d..4fb93ded73 100644 --- a/src/journal/test-compress-benchmark.c +++ b/src/journal/test-compress-benchmark.c @@ -30,6 +30,8 @@ typedef int (compress_t)(const void *src, uint64_t src_size, void *dst, typedef int (decompress_t)(const void *src, uint64_t src_size, void **dst, size_t *dst_alloc_size, size_t* dst_size, size_t dst_max); +#if defined(HAVE_XZ) || defined(HAVE_LZ4) + static usec_t arg_duration = 2 * USEC_PER_SEC; static size_t arg_start; @@ -151,8 +153,10 @@ static void test_compress_decompress(const char* label, const char* type, 100 - compressed * 100. / total, skipped); } +#endif int main(int argc, char *argv[]) { +#if defined(HAVE_XZ) || defined(HAVE_LZ4) const char *i; log_set_max_level(LOG_INFO); @@ -177,4 +181,7 @@ int main(int argc, char *argv[]) { #endif } return 0; +#else + return EXIT_TEST_SKIP; +#endif } diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c index 44a2cf5217..92108a84b3 100644 --- a/src/journal/test-compress.c +++ b/src/journal/test-compress.c @@ -54,6 +54,7 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size, typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes); typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size); +#if defined(HAVE_XZ) || defined(HAVE_LZ4) static void test_compress_decompress(int compression, compress_blob_t compress, decompress_blob_t decompress, @@ -203,6 +204,7 @@ static void test_compress_stream(int compression, assert_se(unlink(pattern) == 0); assert_se(unlink(pattern2) == 0); } +#endif #ifdef HAVE_LZ4 static void test_lz4_decompress_partial(void) { @@ -247,6 +249,7 @@ static void test_lz4_decompress_partial(void) { #endif int main(int argc, char *argv[]) { +#if defined(HAVE_XZ) || defined(HAVE_LZ4) const char text[] = "text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF" "foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"; @@ -312,4 +315,7 @@ int main(int argc, char *argv[]) { #endif return 0; +#else + return EXIT_TEST_SKIP; +#endif } diff --git a/src/libsystemd/sd-bus/test-bus-track.c b/src/libsystemd/sd-bus/test-bus-track.c index 4beb61f05a..06c6167511 100644 --- a/src/libsystemd/sd-bus/test-bus-track.c +++ b/src/libsystemd/sd-bus/test-bus-track.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <sd-bus.h> +#include "sd-bus.h" #include "macro.h" diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c index b704ca3b4b..db3bf5bd21 100644 --- a/src/rc-local-generator/rc-local-generator.c +++ b/src/rc-local-generator/rc-local-generator.c @@ -28,14 +28,6 @@ #include "string-util.h" #include "util.h" -#ifndef RC_LOCAL_SCRIPT_PATH_START -#define RC_LOCAL_SCRIPT_PATH_START "/etc/rc.d/rc.local" -#endif - -#ifndef RC_LOCAL_SCRIPT_PATH_STOP -#define RC_LOCAL_SCRIPT_PATH_STOP "/sbin/halt.local" -#endif - static const char *arg_dest = "/tmp"; static int add_symlink(const char *service, const char *where) { diff --git a/src/resolve/resolved-dns-server.c b/src/resolve/resolved-dns-server.c index 5498f7b9cb..63cb6a5bda 100644 --- a/src/resolve/resolved-dns-server.c +++ b/src/resolve/resolved-dns-server.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <sd-messages.h> +#include "sd-messages.h" #include "alloc-util.h" #include "resolved-dns-server.h" diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index ff2ad9c1de..3075f62b5e 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <sd-messages.h> +#include "sd-messages.h" #include "af-list.h" #include "alloc-util.h" diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c index 7e9f9e5a20..dda9875063 100644 --- a/src/resolve/resolved-dns-trust-anchor.c +++ b/src/resolve/resolved-dns-trust-anchor.c @@ -17,7 +17,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <sd-messages.h> +#include "sd-messages.h" #include "alloc-util.h" #include "conf-files.h" diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index 8765cf2f49..436130edea 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -24,8 +24,6 @@ #include <stdlib.h> #include <string.h> -#include <systemd/sd-bus.h> - #include "alloc-util.h" #include "bus-error.h" #include "bus-util.h" diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h index 736f0f34c8..1764f76744 100644 --- a/src/shared/cgroup-show.h +++ b/src/shared/cgroup-show.h @@ -22,7 +22,7 @@ #include <stdbool.h> #include <sys/types.h> -#include <systemd/sd-bus.h> +#include "sd-bus.h" #include "logs-show.h" #include "output-mode.h" diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 36c94ac71b..163995c1e5 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -42,8 +42,8 @@ #include "udev-util.h" #include "xattr-util.h" +_unused_ static int probe_filesystem(const char *node, char **ret_fstype) { #ifdef HAVE_BLKID -static int probe_filesystem(const char *node, char **ret_fstype) { _cleanup_blkid_free_probe_ blkid_probe b = NULL; const char *fstype; int r; @@ -80,8 +80,10 @@ static int probe_filesystem(const char *node, char **ret_fstype) { not_found: *ret_fstype = NULL; return 0; -} +#else + return -EOPNOTSUPP; #endif +} int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) { @@ -949,7 +951,7 @@ int dissected_image_decrypt( * * = 0 → There was nothing to decrypt * > 0 → Decrypted successfully - * -ENOKEY → There's some to decrypt but no key was supplied + * -ENOKEY → There's something to decrypt but no key was supplied * -EKEYREJECTED → Passed key was not correct */ diff --git a/src/test/test-exec-util.c b/src/test/test-exec-util.c index 482b0751b9..30c92019d9 100644 --- a/src/test/test-exec-util.c +++ b/src/test/test-exec-util.c @@ -223,7 +223,7 @@ static int gather_stdout_three(int fd, void *arg) { return 0; } -const gather_stdout_callback_t const gather_stdout[] = { +const gather_stdout_callback_t gather_stdout[] = { gather_stdout_one, gather_stdout_two, gather_stdout_three, diff --git a/units/systemd-networkd.service.m4.in b/units/systemd-networkd.service.m4.in index 5811b00819..15e6ad99d8 100644 --- a/units/systemd-networkd.service.m4.in +++ b/units/systemd-networkd.service.m4.in @@ -42,6 +42,7 @@ ReadWritePaths=/run/systemd [Install] WantedBy=multi-user.target Also=systemd-networkd.socket +Alias=dbus-org.freedesktop.network1.service # We want to enable systemd-networkd-wait-online.service whenever this service # is enabled. systemd-networkd-wait-online.service has |