summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--am-pat-rules.mk15
-rw-r--r--am-tools.mk11
-rwxr-xr-xautogen.sh2
-rw-r--r--automake.head.mk56
-rw-r--r--automake.tail.mk139
-rw-r--r--automake.txt164
-rw-r--r--common.each.head.mk0
-rw-r--r--common.each.tail.mk1
-rw-r--r--common.once.head.mk15
-rw-r--r--config.mk294
-rw-r--r--config.mk.in9
-rw-r--r--configure.ac5
-rw-r--r--src/kernel-install/Makefile4
-rw-r--r--src/libbasic/Makefile48
-rw-r--r--src/libbasic/btrfs-util.h2
-rw-r--r--src/libbasic/fdset.c2
-rw-r--r--src/libbasic/log.c2
-rw-r--r--src/libbasic/log.h2
-rw-r--r--src/libcore/loopback-setup.c2
-rw-r--r--src/libfirewall/Makefile1
-rw-r--r--src/libshared/Makefile14
-rw-r--r--src/libshared/bus-util.h6
-rw-r--r--src/libshared/efivars.c2
-rw-r--r--src/libshared/efivars.h2
-rw-r--r--src/libshared/gpt.h2
-rw-r--r--src/libshared/ptyfwd.h2
-rw-r--r--src/systemd-nspawn/.gitignore4
-rw-r--r--src/systemd-nspawn/Makefile34
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.c2
-rw-r--r--src/systemd-nspawn/nspawn-expose-ports.h4
-rw-r--r--src/systemd-nspawn/nspawn-network.c7
-rw-r--r--src/systemd-nspawn/nspawn-register.c2
-rw-r--r--src/systemd-nspawn/nspawn-register.h2
-rw-r--r--src/systemd-nspawn/nspawn.c5
34 files changed, 813 insertions, 49 deletions
diff --git a/am-pat-rules.mk b/am-pat-rules.mk
new file mode 100644
index 0000000000..fe44940103
--- /dev/null
+++ b/am-pat-rules.mk
@@ -0,0 +1,15 @@
+$(outdir)/%.o: $(srcdir)/%.c | $(outdir)/.deps
+ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Po
+
+$(outdir)/%.lo: $(srcdir)/%.c | $(outdir)/.deps
+ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+ $(am__mv) $$depbase.Tpo $$depbase.Plo
+
+$(outdir)/.deps:
+ $(AM_V_at)$(MKDIR_P) $@
+
+$(outdir)/%.la:
+ $(AM_V_CCLD)$(LINK) $^
diff --git a/am-tools.mk b/am-tools.mk
new file mode 100644
index 0000000000..d012b69cae
--- /dev/null
+++ b/am-tools.mk
@@ -0,0 +1,11 @@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
diff --git a/autogen.sh b/autogen.sh
index 607a9682dd..bf08658f1a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -28,7 +28,7 @@ if [ -f .git/hooks/pre-commit.sample ] && [ ! -f .git/hooks/pre-commit ]; then
echo "Activated pre-commit hook." || :
fi
-intltoolize --force --automake
+intltoolize --force
autoreconf --force --install --symlink
libdir() {
diff --git a/automake.head.mk b/automake.head.mk
new file mode 100644
index 0000000000..431f14da2b
--- /dev/null
+++ b/automake.head.mk
@@ -0,0 +1,56 @@
+# Copyright (C) 2015-2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+_am = am_
+
+_am_noslash = $(patsubst %/.,%,$(patsubst %/,%,$1))
+# These are all $(call _am_func,parent,child)
+#_am_relto = $(if $2,$(shell realpath -sm --relative-to='$1' $2))
+_am_is_subdir = $(filter $(abspath $1)/%,$(abspath $2)/.)
+_am_relto_helper = $(if $(call _am_is_subdir,$1,$2),$(patsubst $1/%,%,$(addsuffix /.,$2)),$(addprefix ../,$(call _am_relto_helper,$(patsubst %/,%,$(dir $1)),$2)))
+_am_relto = $(call _am_noslash,$(call _am_relto_helper,$(call _am_noslash,$(abspath $1)),$(call _am_noslash,$(abspath $2))))
+# Note that _am_is_subdir says that a directory is a subdirectory of
+# itself.
+_am_path = $(call _am_relto,.,$1)
+am_path = $(foreach p,$1,$(call _am_relto,.,$p))
+
+## Declare the default target
+all: build
+.PHONY: all
+
+## Set outdir and srcdir (assumes that topoutdir and topsrcdir are
+## already set)
+outdir := $(call _am_path,$(dir $(lastword $(filter-out %.mk,$(MAKEFILE_LIST)))))
+srcdir := $(call _am_path,$(topsrcdir)/$(call _am_relto,$(topoutdir),$(outdir)))
+
+_am_included_makefiles := $(_am_included_makefiles) $(call _am_path,$(outdir)/Makefile)
+
+## Empty variables for use by each Makefile
+$(_am)subdirs =
+$(_am)depdirs =
+
+$(_am)src_files =
+$(_am)gen_files =
+$(_am)cfg_files =
+$(_am)out_files =
+$(_am)sys_files =
+
+$(_am)clean_files =
+$(_am)slow_files =
+
+ifeq ($(_am_NO_ONCE),)
+include $(topsrcdir)/common.once.head.mk
+endif
+include $(topsrcdir)/common.each.head.mk
diff --git a/automake.tail.mk b/automake.tail.mk
new file mode 100644
index 0000000000..a24820b71c
--- /dev/null
+++ b/automake.tail.mk
@@ -0,0 +1,139 @@
+# Copyright (C) 2015-2016 Luke Shumaker
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+include $(topsrcdir)/common.each.tail.mk
+
+
+# Aggregate variables
+
+# Add some more defaults to the *_files variables
+$(_am)clean_files += $($(_am)gen_files) $($(_am)cfg_files) $($(_am)out_files)
+
+# Now namespace the *_files variables
+define _am_save_variables
+_am_src_files/$(outdir) = $(addprefix $(srcdir)/,$($(_am)src_files))
+_am_gen_files/$(outdir) = $(addprefix $(srcdir)/,$($(_am)gen_files))
+_am_cfg_files/$(outdir) = $(addprefix $(outdir)/,$($(_am)cfg_files))
+_am_out_files/$(outdir) = $(addprefix $(outdir)/,$($(_am)out_files))
+_am_sys_files/$(outdir) = $(addprefix $(DESTDIR),$($(_am)sys_files))
+_am_clean_files/$(outdir) = $(addprefix $(outdir)/,$($(_am)clean_files))
+_am_slow_files/$(outdir) = $(addprefix $(outdir)/,$($(_am)slow_files))
+_am_subdirs/$(outdir) = $($(_am)subdirs)
+endef
+$(eval $(_am_save_variables))
+
+# And add them to the $(parent)_*_files variables (if applicable)
+define _am_add_subdir
+_am_src_files/%(outdir) += $(_am_src_files/%(subdir))
+_am_gen_files/%(outdir) += $(_am_gen_files/%(subdir))
+_am_cfg_files/%(outdir) += $(_am_cfg_files/%(subdir))
+_am_out_files/%(outdir) += $(_am_out_files/%(subdir))
+_am_sys_files/%(outdir) += $(_am_sys_files/%(subdir))
+_am_clean_files/%(outdir) += $(_am_clean_files/%(subdir))
+_am_slow_files/%(outdir) += $(_am_slow_files/%(subdir))
+endef
+$(foreach subdir,$(call _am_path,$(addprefix $(outdir)/,$($(_am)subdirs))),$(eval $(subst %(outdir),$(outdir),$(subst %(subdir),$(subdir),$(value _am_add_subdir)))))
+
+_am_outdirs := $(_am_outdirs) $(outdir)
+
+
+# Do some per-directory magic
+
+_am_phony = build install uninstall mostlyclean clean distclean maintainer-clean check
+
+.PHONY: $(addprefix $(outdir)/,$(_am_phony))
+
+$(addprefix $(outdir)/,uninstall mostlyclean clean distclean maintainer-clean)::
+ $(RM) -- $(sort $(_am_$(@F)/$(@D)))
+ $(RMDIRS) $(sort $(dir $(_am_$(@F)/$(@D)))) 2>/dev/null || $(TRUE)
+
+# 'build' and 'install' must be defined later, because the
+# am_*_files/* variables might not be complete yet.
+
+
+# Include Makefiles from other directories
+
+define _am_nl
+
+
+endef
+
+$(foreach _am_NO_ONCE,y,\
+ $(foreach makefile,$(foreach dir,$($(_am)subdirs) $($(_am)depdirs),$(call _am_path,$(outdir)/$(dir)/Makefile)),\
+ $(eval include $(filter-out $(_am_included_makefiles),$(makefile)))))
+
+
+# This only gets evaluated once, after all of the other Makefiles are read
+ifeq ($(_am_NO_ONCE),)
+# Empty directory-level variables
+outdir = /bogus
+srcdir = /bogus
+
+$(_am)subdirs =
+$(_am)depdirs =
+
+$(_am)src_files =
+$(_am)gen_files =
+$(_am)cfg_files =
+$(_am)out_files =
+$(_am)sys_files =
+$(_am)clean_files =
+$(_am)slow_files =
+
+_am_clean_files/$(topoutdir) += $(topoutdir)/$(PACKAGE)-$(VERSION).tar.gz
+$(addprefix $(topoutdir)/,mostlyclean clean distclean maintainer-clean) ::
+ $(RM) -r -- $(topoutdir)/$(PACKAGE)-$(VERSION)
+
+define _am_directory_rules
+# Constructive phony targets
+$(outdir)/build : $(_am_out_files/%(outdir))
+$(outdir)/install: $(_am_sys_files/%(outdir))
+# Destructive phony targets
+_am_uninstall/%(outdir) = $(_am_sys_files/%(outdir))
+_am_mostlyclean/%(outdir) = $(filter-out $(_am_slow_files/%(outdir)) $(_am_cfg_files/%(outdir)) $(_am_gen_files/%(outdir)) $(_am_src_files/%(outdir)),$(_am_clean_files/%(outdir)))
+_am_clean/%(outdir) = $(filter-out $(_am_cfg_files/%(outdir)) $(_am_gen_files/%(outdir)) $(_am_src_files/%(outdir)),$(_am_clean_files/%(outdir)))
+_am_distclean/%(outdir) = $(filter-out $(_am_gen_files/%(outdir)) $(_am_src_files/%(outdir)),$(_am_clean_files/%(outdir)))
+_am_maintainer-clean/%(outdir) = $(filter-out $(_am_src_files/%(outdir)),$(_am_clean_files/%(outdir)))
+endef
+$(foreach outdir,$(_am_outdirs),$(eval $(subst %(outdir),$(outdir),$(value _am_directory_rules))))
+
+# Add the `dist` target
+.PHONY: dist
+dist: $(topoutdir)/$(PACKAGE)-$(VERSION).tar.gz
+$(topoutdir)/$(PACKAGE)-$(VERSION).tar.gz: $(topoutdir)/$(PACKAGE)-$(VERSION)
+ $(TAR) czf $@ -C $(<D) $(<F)
+_am_copyfile = $(MKDIRS) $(dir $2) && $(CP) -T $1 $2
+_am_addfile = $(call _am_copyfile,$3,$2/$(call _am_relto,$1,$3))
+$(topoutdir)/$(PACKAGE)-$(VERSION): $(_am_src_files/$(topoutdir)) $(_am_gen_files/$(topoutdir))
+ $(RM) -r $@
+ @PS4='' && set -x && \
+ $(MKDIR) $(@D)/tmp.$(@F).$$$$ && \
+ $(foreach f,$^,$(call _am_addfile,$(topsrcdir),$(@D)/tmp.$(@F).$$$$,$f) &&) \
+ $(MV) $(@D)/tmp.$(@F).$$$$ $@ || $(RM) -r $(@D)/tmp.$(@F).$$$$
+
+include $(topsrcdir)/common.once.tail.mk
+
+# For some reason I can't explain, RM doesn't really get set with ?=
+CP ?= cp
+MKDIR ?= mkdir
+MKDIRS ?= mkdir -p
+MV ?= mv
+RM = rm -f
+RMDIRS ?= rmdir -p
+TAR ?= tar
+TRUE ?= true
+
+.PHONY: noop
+endif
diff --git a/automake.txt b/automake.txt
new file mode 100644
index 0000000000..935af5f5a9
--- /dev/null
+++ b/automake.txt
@@ -0,0 +1,164 @@
+Luke's AutoMake
+===============
+
+Yo, this document is incomplete. It describes the magical
+automake.{head,tail}.mk Makefiles and how to use them, kinda.
+
+I wrote a "clone" of automake. I say clone, because it works
+differently. Yeah, I need a new name for it.
+
+High-level overview
+-------------------
+
+Now, what this does for you is:
+
+It makes it _easy_ to write non-recursive Makefiles--and ones that are
+similar to plain recursive Makefiles, at that! (search for the paper
+"Recursive Make Considered Harmful") As harmful as recursive make is,
+it's historically been difficult to to write non-recursive Makefiles.
+This makes it easy.
+
+It also makes it easy to follow the GNU standards for your makefiles:
+it takes care of this entire table of .PHONY targets for you:
+
+| this | and this | are aliases for this |
+|------+------------------+--------------------------------------------------------|
+| all | build | $(outdir)/build |
+| | install | $(outdir)/install |
+| | uninstall | $(outdir)/uninstall |
+| | mostlyclean | $(outdir)/mostlyclean |
+| | clean | $(outdir)/clean |
+| | distclean | $(outdir)/distclean |
+| | maintainer-clean | $(outdir)/maintainer-clean |
+| | check | $(outdir)/check (not implemented for you) |
+| | dist | $(topoutdir)/$(PACKAGE)-$(VERSION).tar.gz (not .PHONY) |
+
+(You are still responsible for implementing the `$(outdir)/check`
+target in each of your Makefiles.)
+
+What you have to do is:
+
+In each source directory, you write a `Makefile`, very similarly to if
+you were writing for plain GNU Make, with
+
+ topoutdir ?= ...
+ topsrcdir ?= ...
+ include $(topsrcdir)/automake.head.mk
+
+ # your makefile
+
+ include $(topsrcdir)/automake.tail.mk
+
+And in the top-level source directory, Write your own helper makefiles
+that get included:
+ - `common.once.head.mk`: before parsing any of your Makefiles
+ - `common.each.head.mk`: before parsing each of your Makefiles
+ - `common.each.tail.mk`: after parsing each of your Makefiles
+ - `common.each.tail.mk`: after parsing all of your Makefiles
+
+The `common.*.mk` makefiles are nice for including generic pattern
+rules and variables that aren't specific to a directory.
+
+You're probably thinking that this sounds too good to be true!
+Unfortunately, there are two major deviations from writing a plain
+recursive Makefile:
+
+ 1. all targets and prerequisites (including .PHONY targets!) need to
+ be prefixed with
+ `$(srcdir)`/`$(outdir)`/`$(topsrcdir)`/`$(topoutdir)`.
+ * sub-gotcha: this means that if a pattern rule has a
+ prerequisite that may be in srcdir or outdir, then it must be
+ specified twice, once for each case.
+ 2. if a prerequisite is in a directory "owned" by another Makefile,
+ you must filter the pathname through `am_path`:
+ `$(call am_path,YOUR_PATH)`. Further, that path must NOT contain
+ a `..` segment; if you need to refer to a sibling directory, do it
+ relative to `$(topoutdir)` or `$(topsrcdir)`.
+
+Telling automake about your program
+-----------------------------------
+
+You tell automake what to do for you by setting some variables. They
+are all prefixed with `am_`; this prefix may be changed by editing the
+`_am` variable at the top of `automake.head.mk`.
+
+The exception to this is the `am_path` variable, which is a macro that
+is used to make a list of filenames relative to the appropriate
+directory, because unlike normal GNU (Auto)Make, `$(outdir)` isn't
+nescessarily equal to `.`. See above.
+
+There are several commands that generate files; simply record the list
+of files that each command generates as the following variable
+variables:
+
+| Variable | Create Command | Delete Command | Description | Relative to |
+|--------------+----------------+-----------------------------+-----------------------------------+-------------|
+| am_src_files | emacs | rm -rf . | Files that the developer writes | srcdir |
+| am_gen_files | ??? | make maintainer-clean | Files the developer compiles | srcdir |
+| am_cfg_files | ./configure | make distclean | Users' compile-time configuration | outdir |
+| am_out_files | make all | make mostlyclean/make clean | Files the user compiles | outdir |
+| am_sys_files | make install | make uninstall | Files the user installs | DESTDIR |
+
+In addition, there are two more variables that control not how files
+are created, but how they are deleted:
+
+| Variable | Affected command | Description | Relative to |
+|----------------+------------------+------------------------------------------------+-------------|
+| am_clean_files | make clean | A list of things to `rm` in addition to the | outdir |
+| | | files in `$(am_out_files)`. (Example: `*.o`) | |
+|----------------+------------------+------------------------------------------------+-------------|
+| am_slow_files | make mostlyclean | A list of things that (as an exception) should | outdir |
+| | | _not_ be deleted. (otherwise, `mostlyclean` | |
+| | | is the same as `clean`) | |
+
+Finally, there are two variables that express the relationships
+between directories:
+
+| Variable | Description |
+|------------+---------------------------------------------------------|
+| am_subdirs | A list of other directories (containing Makefiles) that |
+| | may be considered "children" of this |
+| | directory/Makefile; building a phony target in this |
+| | directory should also build it in the subdirectory. |
+| | They are not necesarily actually subdirectories of this |
+| | directory in the filesystem. |
+|------------+---------------------------------------------------------|
+| am_depdirs | A list of other directories (containing Makefiles) that |
+| | contain or generate files that are dependencies of |
+| | targets in this directory. They are not necesarily |
+| | actually subdirectories of this directory in the |
+| | filesystem. Except for files that are dependencies of |
+| | files in this directory, things in the dependency |
+| | directory will not be built. |
+
+Tips, notes
+-----------
+
+I like to have the first (non-comment) line in a Makefile be:
+
+ include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+
+(adjusting the number of `../` sequences as nescessary). Then, my
+(user-editable) `config.mk` is of the form:
+
+ ifeq ($(topsrcdir),)
+ topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+ topsrcdir := $(topoutdir)
+
+ # your configuration
+
+ endif
+
+If the package has a `./configure` script, then I have it modifiy
+topsrcdir as necessary, as well as modifying whatever other parts of
+the configuration. All of the configuration lives in `config.mk`;
+`./configure` doesn't modify any `Makefile`s, it just generates
+`config.mk`, and copies (or (sym?)link?) every `$(srcdir)/Makefile` to
+`$(outdir)/Makefile`.
+
+----
+Copyright (C) 2016 Luke Shumaker
+
+This documentation file is placed into the public domain. If that is
+not possible in your legal system, I grant you permission to use it in
+absolutely every way that I can legally grant to you.
diff --git a/common.each.head.mk b/common.each.head.mk
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/common.each.head.mk
diff --git a/common.each.tail.mk b/common.each.tail.mk
new file mode 100644
index 0000000000..d9f9e4f35c
--- /dev/null
+++ b/common.each.tail.mk
@@ -0,0 +1 @@
+include $(topsrcdir)/am-pat-rules.mk
diff --git a/common.once.head.mk b/common.once.head.mk
index 0f07c88147..d0b72a4b92 100644
--- a/common.once.head.mk
+++ b/common.once.head.mk
@@ -20,6 +20,8 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+MAKEFLAGS += --no-builtin-rules
+
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
AM_MAKEFLAGS = --no-print-directory
AUTOMAKE_OPTIONS = color-tests parallel-tests
@@ -29,6 +31,8 @@ export GCC_COLORS
SUBDIRS = . po
+CPPFLAGS += -include $(topoutdir)/config.h
+
# remove targets if the command fails
.DELETE_ON_ERROR:
@@ -58,3 +62,14 @@ define generate-sym-test
$(AM_V_at)printf 'return 0; }\n' >> $@
endef
+# from GNU automake
+
+DEFAULT_INCLUDES = -I.
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__depfiles_maybe = depfiles
+DEPDIR = .deps
+
+am__mv = mv -f
+
+include $(topsrcdir)/am-pretty.mk
+include $(topsrcdir)/am-tools.mk
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000000..d4d543c677
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,294 @@
+# -*- Mode: makefile; indent-tabs-mode: t -*-
+#
+# This file is part of systemd.
+#
+# Copyright 2010-2012 Lennart Poettering
+# Copyright 2010-2012 Kay Sievers
+# Copyright 2013 Zbigniew Jędrzejewski-Szmek
+# Copyright 2013 David Strauss
+# Copyright 2016 Luke Shumaker
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# systemd is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+ifeq ($(topsrcdir),)
+topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+abs_topsrcdir := /home/luke/src/parabola/systemd
+topsrcdir = $(if $(am_path),$(call am_path,$(abs_topsrcdir)),$(abs_topsrcdir))
+
+GZIP_ENV = --best
+DIST_ARCHIVES = $(distdir).tar.xz
+DIST_TARGETS = dist-xz
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+pkgincludedir = $(includedir)/systemd
+ACLOCAL = ${SHELL} /home/luke/src/3rd-party/systemd/build-aux/missing aclocal-1.15
+ACL_LIBS = -lacl
+ALL_LINGUAS =
+AMTAR = $${TAR-tar}
+AM_DEFAULT_VERBOSITY = 0
+APPARMOR_CFLAGS =
+APPARMOR_LIBS =
+AR = gcc-ar
+AUDIT_LIBS =
+AUTOCONF = ${SHELL} /home/luke/src/3rd-party/systemd/build-aux/missing autoconf
+AUTOHEADER = ${SHELL} /home/luke/src/3rd-party/systemd/build-aux/missing autoheader
+AUTOMAKE = ${SHELL} /home/luke/src/3rd-party/systemd/build-aux/missing automake-1.15
+AWK = gawk
+BLKID_CFLAGS = -I/usr/include/blkid -I/usr/include/uuid
+BLKID_LIBS = -lblkid
+CAP_LIBS = -lcap
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CERTIFICATEROOT = /etc/ssl
+CFLAGS = -g -O2
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DBUS_CFLAGS = -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
+DBUS_LIBS = -ldbus-1
+DEBUGTTY = /dev/tty9
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = false
+DNS_SERVERS = 8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
+DSYMUTIL =
+DUMPBIN =
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EFI_ARCH = x86_64
+EFI_CC = gcc
+EFI_INC_DIR = /usr/include
+EFI_LDS_DIR = /usr/lib
+EFI_LIB_DIR = /usr/lib
+EFI_MACHINE_TYPE_NAME = x64
+EGREP = /usr/bin/grep -E
+ELFUTILS_LIBS = -lelf -ldw
+EXEEXT =
+FGREP = /usr/bin/grep -F
+GCRYPT_CFLAGS =
+GCRYPT_LIBS = -lgcrypt -lgpg-error -lgpg-error
+GETTEXT_PACKAGE = systemd
+GMSGFMT = /usr/bin/msgfmt
+GNUTLS_CFLAGS = -I/usr/include/p11-kit-1
+GNUTLS_LIBS = -lgnutls
+GPERF = gperf
+GPG_ERROR_CFLAGS =
+GPG_ERROR_CONFIG = /usr/bin/gpg-error-config
+GPG_ERROR_LIBS = -lgpg-error
+GPG_ERROR_MT_CFLAGS =
+GPG_ERROR_MT_LIBS = -lgpg-error -lpthread
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INTLTOOL_EXTRACT = /usr/bin/intltool-extract
+INTLTOOL_MERGE = /usr/bin/intltool-merge
+INTLTOOL_PERL = /usr/bin/perl
+INTLTOOL_UPDATE = /usr/bin/intltool-update
+INTLTOOL_V_MERGE = $(INTLTOOL__v_MERGE_$(V))
+INTLTOOL_V_MERGE_OPTIONS = $(intltool__v_merge_options_$(V))
+INTLTOOL__v_MERGE_ = $(INTLTOOL__v_MERGE_$(AM_DEFAULT_VERBOSITY))
+INTLTOOL__v_MERGE_0 = @echo " ITMRG " $@;
+KBD_LOADKEYS = /usr/bin/loadkeys
+KBD_SETFONT = /usr/bin/setfont
+KEXEC = /usr/sbin/kexec
+KILL = /usr/bin/kill
+KMOD = /usr/bin/kmod
+KMOD_CFLAGS =
+KMOD_LIBS = -lkmod
+LD = /usr/bin/ld -m elf_x86_64
+LDFLAGS =
+LIBCRYPTSETUP_CFLAGS =
+LIBCRYPTSETUP_LIBS = -lcryptsetup
+LIBCURL_CFLAGS =
+LIBCURL_LIBS = -lcurl
+LIBGCRYPT_CFLAGS =
+LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config
+LIBGCRYPT_LIBS = -lgcrypt -lgpg-error
+LIBIDN_CFLAGS =
+LIBIDN_LIBS = -lidn
+LIBIPTC_CFLAGS =
+LIBIPTC_LIBS = -lip4tc -lip6tc
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(topoutdir)/libtool
+LIPO =
+LN_S = ln -s
+LTLIBOBJS =
+LT_SYS_LIBRARY_PATH =
+LZ4_CFLAGS =
+LZ4_LIBS = -llz4
+M4 = /usr/bin/m4
+M4_DEFINES = -DHAVE_SECCOMP -DHAVE_PAM -DHAVE_ACL -DHAVE_SMACK -DHAVE_MICROHTTPD -DHAVE_LIBCURL -DHAVE_LIBIDN -DHAVE_LIBIPTC -DENABLE_TIMESYNCD -DENABLE_COREDUMP -DENABLE_RESOLVED -DENABLE_NETWORKD -DENABLE_KDBUS
+MAINT =
+MAKEINFO = ${SHELL} /home/luke/src/3rd-party/systemd/build-aux/missing makeinfo
+MANIFEST_TOOL = :
+MICROHTTPD_CFLAGS = -I/usr/include/libmicrohttpd -I/usr/include/p11-kit-1
+MICROHTTPD_LIBS = -lmicrohttpd
+MKDIR_P = /usr/bin/mkdir -p
+MOUNT_CFLAGS = -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid
+MOUNT_LIBS = -lmount
+MOUNT_PATH = /usr/bin/mount
+MSGFMT = /usr/bin/msgfmt
+MSGMERGE = /usr/bin/msgmerge
+NM = gcc-nm
+NMEDIT =
+NTP_SERVERS = 0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
+OBJCOPY = objcopy
+OBJDUMP = objdump
+OBJEXT = o
+OTOOL =
+OTOOL64 =
+OUR_CFLAGS = -pipe -Wall -Wextra -Wundef -Wformat=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wmissing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Wno-format-signedness -Werror=overflow -Wdate-time -Wnested-externs -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -Werror=shadow -flto -ffunction-sections -fdata-sections
+OUR_CPPFLAGS = -Wp,-D_FORTIFY_SOURCE=2
+OUR_LDFLAGS = -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined -Wl,-z,relro -Wl,-z,now -pie -Wl,-fuse-ld=gold
+PACKAGE = systemd
+PACKAGE_BUGREPORT = http://github.com/systemd/systemd/issues
+PACKAGE_NAME = systemd
+PACKAGE_STRING = systemd 229
+PACKAGE_TARNAME = systemd
+PACKAGE_URL = http://www.freedesktop.org/wiki/Software/systemd
+PACKAGE_VERSION = 229
+PAM_LIBS = -lpam -lpam_misc
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR =
+PKG_CONFIG_PATH = /home/luke/.prefix/lib/pkgconfig
+PYTHON = /usr/bin/python
+PYTHON_EXEC_PREFIX = ${exec_prefix}
+PYTHON_PLATFORM = linux
+PYTHON_PREFIX = ${prefix}
+PYTHON_VERSION = 3.5
+QEMU = /usr/bin/qemu-system-x86_64
+QEMU_BIOS =
+QRENCODE_CFLAGS =
+QRENCODE_LIBS =
+QUOTACHECK = /usr/bin/quotacheck
+QUOTAON = /usr/bin/quotaon
+RANLIB = gcc-ranlib
+RC_LOCAL_SCRIPT_PATH_START = /etc/rc.local
+RC_LOCAL_SCRIPT_PATH_STOP = /usr/sbin/halt.local
+SECCOMP_CFLAGS =
+SECCOMP_LIBS = -lseccomp
+SED = /usr/bin/sed
+SELINUX_CFLAGS =
+SELINUX_LIBS =
+SETCAP = /usr/bin/setcap
+SET_MAKE =
+SHELL = /bin/sh
+STRINGS = strings
+STRIP = strip
+SULOGIN = /usr/bin/sulogin
+SUSHELL = /bin/sh
+SYSTEM_GID_MAX = 999
+SYSTEM_SYSVINIT_PATH =
+SYSTEM_SYSVRCND_PATH =
+SYSTEM_UID_MAX = 999
+TELINIT = /lib/sysvinit/telinit
+TTY_GID = 5
+UMOUNT_PATH = /usr/bin/umount
+USE_NLS = yes
+VERSION = 229
+XGETTEXT = /usr/bin/xgettext
+XKBCOMMON_CFLAGS =
+XKBCOMMON_LIBS = -lxkbcommon
+XSLTPROC = /usr/bin/xsltproc
+XZ_CFLAGS =
+XZ_LIBS = -llzma
+ZLIB_CFLAGS =
+ZLIB_LIBS = -lz
+abs_builddir = /home/luke/src/3rd-party/systemd
+abs_srcdir = /home/luke/src/3rd-party/systemd
+abs_top_builddir = /home/luke/src/3rd-party/systemd
+abs_top_srcdir = /home/luke/src/3rd-party/systemd
+ac_ct_AR = gcc-ar
+ac_ct_CC = gcc
+ac_ct_DUMPBIN =
+ac_ct_NM = gcc-nm
+ac_ct_RANLIB = gcc-ranlib
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = tar --format=posix -chf - "$$tardir"
+am__untar = tar -xf -
+bashcompletiondir = /usr/share/bash-completion/completions
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-linux-gnu
+build_alias =
+build_cpu = x86_64
+build_os = linux-gnu
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+
+# Dirs of external packages
+dbuspolicydir=${prefix}/etc/dbus-1/system.d
+dbussessionservicedir=${datarootdir}/dbus-1/services
+dbussystemservicedir=${datarootdir}/dbus-1/system-services
+pamlibdir=${exec_prefix}/lib/security
+pamconfdir=${prefix}/etc/pam.d
+pkgconfigdatadir=$(datadir)/pkgconfig
+pkgconfiglibdir=$(libdir)/pkgconfig
+polkitpolicydir=$(datadir)/polkit-1/actions
+bashcompletiondir=/usr/share/bash-completion/completions
+zshcompletiondir=${datarootdir}/zsh/site-functions
+rpmmacrosdir=$(prefix)/lib/rpm/macros.d
+sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
+sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
+varlogdir=$(localstatedir)/log
+systemdstatedir=$(localstatedir)/lib/systemd
+catalogstatedir=$(systemdstatedir)/catalog
+xinitrcdir=$(sysconfdir)/X11/xinit/xinitrc.d
+
+# Our own, non-special dirs
+pkgsysconfdir=$(sysconfdir)/systemd
+userunitdir=$(prefix)/lib/systemd/user
+userpresetdir=$(prefix)/lib/systemd/user-preset
+tmpfilesdir=$(prefix)/lib/tmpfiles.d
+sysusersdir=$(prefix)/lib/sysusers.d
+sysctldir=$(prefix)/lib/sysctl.d
+binfmtdir=$(prefix)/lib/binfmt.d
+modulesloaddir=$(prefix)/lib/modules-load.d
+networkdir=$(rootprefix)/lib/systemd/network
+pkgincludedir=$(includedir)/systemd
+systemgeneratordir=$(rootlibexecdir)/system-generators
+usergeneratordir=$(prefix)/lib/systemd/user-generators
+systemshutdowndir=$(rootlibexecdir)/system-shutdown
+systemsleepdir=$(rootlibexecdir)/system-sleep
+systemunitdir=$(rootprefix)/lib/systemd/system
+systempresetdir=$(rootprefix)/lib/systemd/system-preset
+udevlibexecdir=$(rootprefix)/lib/udev
+udevhomedir=$(udevlibexecdir)
+udevrulesdir=$(udevlibexecdir)/rules.d
+udevhwdbdir=$(udevlibexecdir)/hwdb.d
+catalogdir=$(prefix)/lib/systemd/catalog
+kernelinstalldir = $(prefix)/lib/kernel/install.d
+factory_etcdir = $(datadir)/factory/etc
+factory_pamdir = $(datadir)/factory/etc/pam.d
+bootlibdir = $(prefix)/lib/systemd/boot/efi
+
+# And these are the special ones for /
+rootprefix=/usr
+rootbindir=$(rootprefix)/bin
+rootlibexecdir=$(rootprefix)/lib/systemd
+
+AM_DEFAULT_VERBOSITY = 0
+
+endif
diff --git a/config.mk.in b/config.mk.in
index 92d5ac420d..0c7ba33c72 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -20,6 +20,12 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+
+ifeq ($(topsrcdir),)
+topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
+abs_topsrcdir := @abs_top_srcdir@
+topsrcdir = $(if $(am_path),$(call am_path,$(abs_topsrcdir)),$(abs_topsrcdir))
+
# Dirs of external packages
dbuspolicydir=@dbuspolicydir@
dbussessionservicedir=@dbussessionservicedir@
@@ -71,3 +77,6 @@ rootprefix=@rootprefix@
rootbindir=$(rootprefix)/bin
rootlibexecdir=$(rootprefix)/lib/systemd
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+
+endif
diff --git a/configure.ac b/configure.ac
index 5fd73c59f1..2139966a43 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,7 @@ AC_INIT([systemd],
[systemd],
[http://www.freedesktop.org/wiki/Software/systemd])
-AC_CONFIG_SRCDIR([src/core/main.c])
+AC_CONFIG_SRCDIR([src/systemd/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
@@ -34,7 +34,6 @@ AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_PREFIX_DEFAULT([/usr])
AM_MAINTAINER_MODE([enable])
-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
@@ -1503,7 +1502,7 @@ AC_SUBST([rootprefix], [$with_rootprefix])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_CONFIG_FILES([
- Makefile
+ config.mk
po/Makefile.in
])
diff --git a/src/kernel-install/Makefile b/src/kernel-install/Makefile
index 9e6def1a29..9518ba1283 100644
--- a/src/kernel-install/Makefile
+++ b/src/kernel-install/Makefile
@@ -20,6 +20,9 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/automake.head.mk
+
dist_bin_SCRIPTS = \
src/kernel-install/kernel-install
@@ -27,3 +30,4 @@ dist_kernelinstall_SCRIPTS = \
src/kernel-install/50-depmod.install \
src/kernel-install/90-loaderentry.install
+include $(topsrcdir)/automake.tail.mk
diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile
index 64971e0423..c115b2fe8e 100644
--- a/src/libbasic/Makefile
+++ b/src/libbasic/Makefile
@@ -20,6 +20,9 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/automake.head.mk
+
noinst_LTLIBRARIES += \
libbasic.la
@@ -238,50 +241,53 @@ libbasic_la_LIBADD = \
-lrt \
-lm
-src/basic/errno-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+am_out_files = libbasic.la
+CFLAGS += $(libbasic_la_CFLAGS)
+CPPFLAGS += -I$(topsrcdir)/src/libsystemd/include
+CPPFLAGS += -I$(topoutdir)/src/libsystemd/include
+CPPFLAGS += -include $(topoutdir)/config.h
+$(outdir)/libbasic.la: $(patsubst src/basic/%.c,$(outdir)/%.lo,$(filter %.c,$(libbasic_la_SOURCES))) $(libbasic_la_LIBADD)
+
+$(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
+
+$(outdir)/errno-list.txt:
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include errno.h - </dev/null | $(AWK) '/^#define[ \t]+E[^ _]+[ \t]+/ { print $$2; }' >$@
-src/basic/errno-to-name.h: src/basic/errno-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(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 "};"}' <$< >$@
-src/basic/af-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/af-list.txt:
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(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; }' >$@
-src/basic/af-to-name.h: src/basic/af-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(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 "};"}' <$< >$@
-src/basic/arphrd-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/arphrd-list.txt:
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include net/if_arp.h - </dev/null | $(AWK) '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $$2; }' | sed -e 's/ARPHRD_//' >$@
-src/basic/arphrd-to-name.h: src/basic/arphrd-list.txt
+$(outdir)/arphrd-to-name.h: $(outdir)/arphrd-list.txt
$(AM_V_at)$(MKDIR_P) $(dir $@)
$(AM_V_GEN)$(AWK) 'BEGIN{ print "static const char* const arphrd_names[] = { "} !/CISCO/ { printf "[ARPHRD_%s] = \"%s\",\n", $$1, $$1 } END{print "};"}' <$< >$@
-src/basic/arphrd-from-name.gperf: src/basic/arphrd-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(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 }' <$< >$@
-src/basic/cap-list.txt:
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/cap-list.txt:
$(AM_V_GEN)$(CPP) $(CFLAGS) $(AM_CPPFLAGS) $(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 >$@
-src/basic/cap-to-name.h: src/basic/cap-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(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 "};"}' <$< >$@
-src/basic/cap-from-name.gperf: src/basic/cap-list.txt
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(outdir)/cap-from-name.gperf: $(outdir)/cap-list.txt
$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct capability_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, %s\n", $$1, $$1 }' <$< >$@
-src/basic/cap-from-name.h: src/basic/cap-from-name.gperf
- $(AM_V_at)$(MKDIR_P) $(dir $@)
+$(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 <$< >$@
+include $(topsrcdir)/automake.tail.mk
diff --git a/src/libbasic/btrfs-util.h b/src/libbasic/btrfs-util.h
index 37802c2565..29f8ba63d3 100644
--- a/src/libbasic/btrfs-util.h
+++ b/src/libbasic/btrfs-util.h
@@ -23,7 +23,7 @@
#include <stdint.h>
#include <sys/types.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
#include "time-util.h"
diff --git a/src/libbasic/fdset.c b/src/libbasic/fdset.c
index 3674d3ed9d..da1162991f 100644
--- a/src/libbasic/fdset.c
+++ b/src/libbasic/fdset.c
@@ -23,7 +23,7 @@
#include <fcntl.h>
#include <stddef.h>
-#include "sd-daemon.h"
+#include <systemd/sd-daemon.h>
#include "fd-util.h"
#include "fdset.h"
diff --git a/src/libbasic/log.c b/src/libbasic/log.c
index d89e6f7274..f625e3bd95 100644
--- a/src/libbasic/log.c
+++ b/src/libbasic/log.c
@@ -33,7 +33,7 @@
#include <time.h>
#include <unistd.h>
-#include "sd-messages.h"
+#include <systemd/sd-messages.h>
#include "alloc-util.h"
#include "fd-util.h"
diff --git a/src/libbasic/log.h b/src/libbasic/log.h
index 60ddead74c..8ccbf8ed70 100644
--- a/src/libbasic/log.h
+++ b/src/libbasic/log.h
@@ -27,7 +27,7 @@
#include <sys/socket.h>
#include <syslog.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
#include "macro.h"
diff --git a/src/libcore/loopback-setup.c b/src/libcore/loopback-setup.c
index 04062a7910..d56bbfa6fc 100644
--- a/src/libcore/loopback-setup.c
+++ b/src/libcore/loopback-setup.c
@@ -20,7 +20,7 @@
#include <net/if.h>
#include <stdlib.h>
-#include "sd-netlink.h"
+#include <systemd/sd-netlink.h>
#include "loopback-setup.h"
#include "missing.h"
diff --git a/src/libfirewall/Makefile b/src/libfirewall/Makefile
index 0171d35acd..f0697f1513 100644
--- a/src/libfirewall/Makefile
+++ b/src/libfirewall/Makefile
@@ -36,3 +36,4 @@ libfirewall_la_LIBADD = \
$(LIBIPTC_LIBS)
endif
+include $(topsrcdir)/automake.tail.mk
diff --git a/src/libshared/Makefile b/src/libshared/Makefile
index 0986c817f5..ebaa1a2e33 100644
--- a/src/libshared/Makefile
+++ b/src/libshared/Makefile
@@ -20,6 +20,9 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/automake.head.mk
+
noinst_LTLIBRARIES += \
libshared.la
@@ -134,3 +137,14 @@ libshared_la_LIBADD = \
$(LIBIDN_LIBS) \
$(SECCOMP_LIBS)
+am_out_files += libshared.la
+CPPFLAGS += -I$(topsrcdir)/src/libsystemd/include
+CPPFLAGS += -I$(topoutdir)/src/libsystemd/include
+CPPFLAGS += -I$(topsrcdir)/src/libbasic
+CPPFLAGS += -I$(topoutdir)/src/libbasic
+CPPFLAGS += -DPKGSYSCONFDIR=\"$(pkgsysconfdir)\"
+CPPFLAGS += -DPOLKIT_AGENT_BINARY_PATH=\"$(bindir)/pkttyagent\" \
+$(outdir)/libshared.la: \
+ $(patsubst src/shared/%.c,$(outdir)/%.lo,$(filter %.c,$(libshared_la_SOURCES)))
+
+include $(topsrcdir)/automake.tail.mk
diff --git a/src/libshared/bus-util.h b/src/libshared/bus-util.h
index 204da55682..77474522be 100644
--- a/src/libshared/bus-util.h
+++ b/src/libshared/bus-util.h
@@ -24,9 +24,9 @@
#include <stdint.h>
#include <sys/types.h>
-#include "sd-bus-vtable.h"
-#include "sd-bus.h"
-#include "sd-event.h"
+#include <systemd/sd-bus-vtable.h>
+#include <systemd/sd-bus.h>
+#include <systemd/sd-event.h>
#include "hashmap.h"
#include "install.h"
diff --git a/src/libshared/efivars.c b/src/libshared/efivars.c
index 8631a5a5d9..5073c61740 100644
--- a/src/libshared/efivars.c
+++ b/src/libshared/efivars.c
@@ -27,7 +27,7 @@
#include <sys/stat.h>
#include <unistd.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
#include "alloc-util.h"
#include "dirent-util.h"
diff --git a/src/libshared/efivars.h b/src/libshared/efivars.h
index b61d14c4ec..243151f922 100644
--- a/src/libshared/efivars.h
+++ b/src/libshared/efivars.h
@@ -23,7 +23,7 @@
#include <stddef.h>
#include <stdint.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
#include "time-util.h"
diff --git a/src/libshared/gpt.h b/src/libshared/gpt.h
index 52ab29ed5f..9b8f59abee 100644
--- a/src/libshared/gpt.h
+++ b/src/libshared/gpt.h
@@ -21,7 +21,7 @@
#include <endian.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
/* We only support root disk discovery for x86, x86-64, Itanium and ARM for
* now, since EFI for anything else doesn't really exist, and we only
diff --git a/src/libshared/ptyfwd.h b/src/libshared/ptyfwd.h
index a046eb4e5e..83c1f60970 100644
--- a/src/libshared/ptyfwd.h
+++ b/src/libshared/ptyfwd.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#include "sd-event.h"
+#include <systemd/sd-event.h>
#include "macro.h"
diff --git a/src/systemd-nspawn/.gitignore b/src/systemd-nspawn/.gitignore
index 85c81fff24..b1ba4fd9af 100644
--- a/src/systemd-nspawn/.gitignore
+++ b/src/systemd-nspawn/.gitignore
@@ -1 +1,5 @@
/nspawn-gperf.c
+/loopback-setup.c
+/loopback-setup.h
+/mount-setup.c
+/mount-setup.h
diff --git a/src/systemd-nspawn/Makefile b/src/systemd-nspawn/Makefile
index e6b1e8e765..e485cac514 100644
--- a/src/systemd-nspawn/Makefile
+++ b/src/systemd-nspawn/Makefile
@@ -20,6 +20,9 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
+include $(dir $(lastword $(MAKEFILE_LIST)))/../../config.mk
+include $(topsrcdir)/automake.head.mk
+
systemd_nspawn_SOURCES = \
src/nspawn/nspawn.c \
src/nspawn/nspawn-settings.c \
@@ -43,6 +46,36 @@ systemd_nspawn_SOURCES = \
src/core/loopback-setup.c \
src/core/loopback-setup.h
+am_out_files = systemd-nspawn
+CPPFLAGS += -I$(topsrcdir)/src/libbasic
+CPPFLAGS += -I$(topoutdir)/src/libbasic
+CPPFLAGS += -I$(topsrcdir)/src/libshared
+CPPFLAGS += -I$(topoutdir)/src/libshared
+CPPFLAGS += -I$(topsrcdir)/src/libsystemd/include
+CPPFLAGS += -I$(topoutdir)/src/libsystemd/include
+CPPFLAGS += -I$(topsrcdir)/src/libudev/include
+CPPFLAGS += -I$(topoutdir)/src/libudev/include
+$(outdir)/systemd-nspawn: \
+ $(outdir)/nspawn.o \
+ $(outdir)/nspawn-settings.o \
+ $(outdir)/nspawn-mount.o \
+ $(outdir)/nspawn-network.o \
+ $(outdir)/nspawn-expose-ports.o \
+ $(outdir)/nspawn-cgroup.o \
+ $(outdir)/nspawn-register.o \
+ $(outdir)/nspawn-setuid.o \
+ $(outdir)/nspawn-stub-pid1.o \
+ $(outdir)/mount-setup.o \
+ $(outdir)/loopback-setup.o \
+ $(topsrcdir)/libshared/libshared.la $(BLKID_LIBS)
+
+$(outdir)/mount-setup.c: $(topsrcdir)/src/libcore/mount-setup.c; $(CP) $< $@
+$(outdir)/mount-setup.h: $(topsrcdir)/src/libcore/mount-setup.h; $(CP) $< $@
+$(outdir)/loopback-setup.c: $(topsrcdir)/src/libcore/loopback-setup.c; $(CP) $< $@
+$(outdir)/loopback-setup.h: $(topsrcdir)/src/libcore/loopback-setup.h; $(CP) $< $@
+
+$(outdir)/nspawn.o: $(outdir)/loopback-setup.h
+
nodist_systemd_nspawn_SOURCES = \
src/nspawn/nspawn-gperf.c
@@ -63,3 +96,4 @@ systemd_nspawn_LDADD += \
libfirewall.la
endif
+include $(topsrcdir)/automake.tail.mk
diff --git a/src/systemd-nspawn/nspawn-expose-ports.c b/src/systemd-nspawn/nspawn-expose-ports.c
index 86124b8779..8122a14f7b 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.c
+++ b/src/systemd-nspawn/nspawn-expose-ports.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-netlink.h"
+#include <systemd/sd-netlink.h>
#include "alloc-util.h"
#include "fd-util.h"
diff --git a/src/systemd-nspawn/nspawn-expose-ports.h b/src/systemd-nspawn/nspawn-expose-ports.h
index 741ad9765c..0e9f8f7e88 100644
--- a/src/systemd-nspawn/nspawn-expose-ports.h
+++ b/src/systemd-nspawn/nspawn-expose-ports.h
@@ -21,8 +21,8 @@
#include <inttypes.h>
-#include "sd-event.h"
-#include "sd-netlink.h"
+#include <systemd/sd-event.h>
+#include <systemd/sd-netlink.h>
#include "in-addr-util.h"
#include "list.h"
diff --git a/src/systemd-nspawn/nspawn-network.c b/src/systemd-nspawn/nspawn-network.c
index fcb1efaa74..970eba3ae1 100644
--- a/src/systemd-nspawn/nspawn-network.c
+++ b/src/systemd-nspawn/nspawn-network.c
@@ -20,13 +20,12 @@
#include <linux/veth.h>
#include <net/if.h>
-#include "libudev.h"
-#include "sd-id128.h"
-#include "sd-netlink.h"
+#include <libudev.h>
+#include <systemd/sd-id128.h>
+#include <systemd/sd-netlink.h>
#include "alloc-util.h"
#include "ether-addr-util.h"
-#include "netlink-util.h"
#include "nspawn-network.h"
#include "siphash24.h"
#include "string-util.h"
diff --git a/src/systemd-nspawn/nspawn-register.c b/src/systemd-nspawn/nspawn-register.c
index 760861089d..3b0d778f43 100644
--- a/src/systemd-nspawn/nspawn-register.c
+++ b/src/systemd-nspawn/nspawn-register.c
@@ -17,7 +17,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
+#include <systemd/sd-bus.h>
#include "bus-error.h"
#include "bus-util.h"
diff --git a/src/systemd-nspawn/nspawn-register.h b/src/systemd-nspawn/nspawn-register.h
index 304c5a485b..c7a50f7477 100644
--- a/src/systemd-nspawn/nspawn-register.h
+++ b/src/systemd-nspawn/nspawn-register.h
@@ -21,7 +21,7 @@
#include <sys/types.h>
-#include "sd-id128.h"
+#include <systemd/sd-id128.h>
#include "nspawn-mount.h"
diff --git a/src/systemd-nspawn/nspawn.c b/src/systemd-nspawn/nspawn.c
index ef348c335b..1de527b57b 100644
--- a/src/systemd-nspawn/nspawn.c
+++ b/src/systemd-nspawn/nspawn.c
@@ -41,8 +41,8 @@
#include <sys/types.h>
#include <unistd.h>
-#include "sd-daemon.h"
-#include "sd-id128.h"
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-id128.h>
#include "alloc-util.h"
#include "barrier.h"
@@ -69,7 +69,6 @@
#include "missing.h"
#include "mkdir.h"
#include "mount-util.h"
-#include "netlink-util.h"
#include "nspawn-cgroup.h"
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"