From bcf1acd2a33706c296339f5627eb4070fdda2ecd Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 1 Jun 2016 17:18:06 -0400 Subject: get libbasic to build again --- autoconf.mk.in | 2 ++ build-aux/Makefile.each.tail/20-systemd.mk | 4 ++-- build-aux/Makefile.once.head/20-systemd.mk | 35 ++++++++++++++++++++++-------- build-aux/Makefile.once.tail/20-systemd.mk | 2 ++ config.mk.in | 9 ++++---- src/libbasic/Makefile | 11 +--------- 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/autoconf.mk.in b/autoconf.mk.in index 2a5dc6053c..94dfca0b54 100644 --- a/autoconf.mk.in +++ b/autoconf.mk.in @@ -1,3 +1,5 @@ +top_builddir = $(topoutdir) + PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_NAME = @PACKAGE_NAME@ diff --git a/build-aux/Makefile.each.tail/20-systemd.mk b/build-aux/Makefile.each.tail/20-systemd.mk index 8f2f612273..fa0bd9ec2a 100644 --- a/build-aux/Makefile.each.tail/20-systemd.mk +++ b/build-aux/Makefile.each.tail/20-systemd.mk @@ -2,10 +2,10 @@ std.clean_files += *.o *.lo .deps/ .libs/ -$(outdir)/%.o: $(srcdir)/%.c | $(outdir)/.deps +$(outdir)/%.o: $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps $(AM_V_CC)$(COMPILE) -c -o $@ $< -$(outdir)/%.lo: $(srcdir)/%.c | $(outdir)/.deps +$(outdir)/%.lo: $(srcdir)/%.c $(topoutdir)/config.h | $(outdir)/.deps $(AM_V_CC)$(LTCOMPILE) -c -o $@ $< $(outdir)/.deps: diff --git a/build-aux/Makefile.once.head/20-systemd.mk b/build-aux/Makefile.once.head/20-systemd.mk index 4fd092c3b4..7358649809 100644 --- a/build-aux/Makefile.once.head/20-systemd.mk +++ b/build-aux/Makefile.once.head/20-systemd.mk @@ -21,20 +21,14 @@ # You should have received a copy of the GNU Lesser General Public License # along with systemd; If not, see . -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} -AM_MAKEFLAGS = --no-print-directory -AUTOMAKE_OPTIONS = color-tests parallel-tests - -GCC_COLORS ?= 'ooh, shiny!' -export GCC_COLORS - -SUBDIRS = . po - OUR_CPPFLAGS += -MT $@ -MD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).P$(patsubst .%,%,$(suffix $(@F))) +OUR_CPPFLAGS += -include $(topoutdir)/config.h +at.dirlocal += AM_CFLAGS AM_CPPFLAGS AM_LDFLAGS AM_LIBTOOLFLAGS ALL_CFLAGS = $(OUR_CFLAGS) $(AM_CFLAGS/$(@D)) $(CFLAGS) ALL_CPPFLAGS = $(OUR_CPPFLAGS) $(AM_CPPFLAGS/$(@D)) $(CPPFLAGS) ALL_LDFLAGS = $(OUR_LDFLAGS) $(AM_LDFLAGS/$(@D)) $(LDFLAGS) +ALL_LIBTOOLFLAGS = $(OUR_LIBTOOLFLAGS) $(AM_LIBTOOLFLAGS/$(@D)) $(LIBTOOLFLAGS) COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(ALL_LIBTOOLFLAGS) --mode=compile $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) @@ -131,3 +125,26 @@ define generate-sym-test $(AM_V_at)printf 'unsigned i; for (i=0;i> $@ $(AM_V_at)printf 'return 0; }\n' >> $@ endef + +at.dirlocal += noinst_LTLIBRARIES +automake_name = $(subst -,_,$(subst .,_,$1)) +automake_sources = $(addprefix $(outdir)/,$(notdir $($(automake_name)_SOURCES) $(nodist_$(automake_name)_SOURCES))) +automake_lo = $(patsubst %.c,%.lo,$(filter %.c,$(automake_sources))) +automake_o = $(patsubst %.c,%.o,$(filter %.c,$(automake_sources))) +automake_libs = $($(automake_name)_LIBADD) + +define automake2autothing +std.out_files += $(noinst_LTLIBRARIES) +$(foreach n,$(call automake_name,$(std.out_files)),\ + $(eval $n_SOURCES ?=)\ + $(eval nodist_$n_SOURCES ?=)\ + $(eval $n_CFLAGS ?=)\ + $(eval $n_CPPFLAGS ?=)\ + $(eval $n_LDFLAGS ?=)\ + $(eval $n_LIBADD ?=)) +$(foreach t,$(filter %.la,$(std.out_files)),\ + $(eval $(outdir)/$t: $(call automake_lo,$t) $(call automake_libs,$t) )\ + $(eval AM_CFLAGS += $($(call automake_name,$t)_CFLAGS) )\ + $(eval AM_CPPFLAGS += $($(call automake_name,$t)_CPPFLAGS) )\ + $(eval AM_LDFLAGS += $($(call automake_name,$t)_LDFLAGS) )) +endef diff --git a/build-aux/Makefile.once.tail/20-systemd.mk b/build-aux/Makefile.once.tail/20-systemd.mk index 7e18da1449..ea0e341c2d 100644 --- a/build-aux/Makefile.once.tail/20-systemd.mk +++ b/build-aux/Makefile.once.tail/20-systemd.mk @@ -27,6 +27,8 @@ $(topoutdir)/config.status: $(topsrcdir)/configure cd $(@D) && $(abspath $<) $(addprefix $(topoutdir)/,config.mk automake.mk autoconf.mk gnustandards.mk po/Makefile.in): $(topoutdir)/%: $(topoutdir)/config.status $(topsrcdir)/%.in cd $(topoutdir) && ./config.status --file=$* +$(addprefix $(topoutdir)/,config.h): $(topoutdir)/%: $(topoutdir)/config.status $(topsrcdir)/%.in + cd $(topoutdir) && ./config.status --file=$* # Let's run all tests of the test suite, but under valgrind. Let's # exclude perl/python/shell scripts we have in there diff --git a/config.mk.in b/config.mk.in index 5033d634cb..1e25255175 100644 --- a/config.mk.in +++ b/config.mk.in @@ -23,14 +23,14 @@ ifeq ($(topsrcdir),) -MAKEFLAGS += --warn-undefined-variables -include $(topsrcdir)/build-aux/no-builtin-variables.mk -.LIBPATTERNS = lib%.so lib%.a - topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) abs_topsrcdir := @abs_top_srcdir@ topsrcdir = $(if $(value am_path),$(call am_path,$(abs_topsrcdir)),$(abs_topsrcdir)) +MAKEFLAGS += --warn-undefined-variables +include $(topsrcdir)/build-aux/no-builtin-variables.mk +.LIBPATTERNS = lib%.so lib%.a + include $(topsrcdir)/gnustandards.mk include $(topsrcdir)/autoconf.mk @@ -39,6 +39,7 @@ CCLD = $(CC) OUR_CPPFLAGS = @OUR_CPPFLAGS@ OUR_CFLAGS = @OUR_CFLAGS@ OUR_LDFLAGS = @OUR_LDFLAGS@ +OUR_LIBTOOLFLAGS = # Dirs of external packages dbuspolicydir=@dbuspolicydir@ diff --git a/src/libbasic/Makefile b/src/libbasic/Makefile index 83ed2355ad..8e76a01c8a 100644 --- a/src/libbasic/Makefile +++ b/src/libbasic/Makefile @@ -277,16 +277,7 @@ $(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 <$< >$@ - -std.out_files = libbasic.la -CFLAGS += -pthread -CPPFLAGS += $(libsystemd.CPPFLAGS) $(libselinux.CPPFLAGS) $(libcap.CPPFLAGS) -$(outdir)/libbasic.la: \ - $(patsubst src/basic/%.c,$(outdir)/%.lo,$(filter %.c,$(libbasic_la_SOURCES))) \ - $(libselinux.DEPENDS) $(libcap.DEPENDS) -lrt -lm - -std.gen_files += *-to-name.h *-from-name.h *-from-name.gperf *-list.txt - +$(eval $(value automake2autothing)) $(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 -- cgit v1.2.3-54-g00ecf