From: Arran Cudbard-Bell Date: Wed, 7 Nov 2012 13:01:03 +0000 (+0000) Subject: Update boiler make build system to generate dynamic headers X-Git-Tag: release_3_0_0_beta1~1596 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6f5e26d72e0e4935b0365bd86b6586dce8845bd;p=thirdparty%2Ffreeradius-server.git Update boiler make build system to generate dynamic headers --- diff --git a/src/include/all.mk b/src/include/all.mk index e5e2bd25c1e..fce253f45d6 100644 --- a/src/include/all.mk +++ b/src/include/all.mk @@ -4,18 +4,52 @@ # Version: $Id$ # -HEADERS = autoconf.h conf.h conffile.h detail.h dhcp.h event.h hash.h heap.h \ +HEADERS = conf.h conffile.h detail.h dhcp.h event.h features.h hash.h heap.h \ ident.h libradius.h md4.h md5.h missing.h modcall.h modules.h \ packet.h rad_assert.h radius.h radiusd.h radpaths.h \ radutmp.h realms.h sha1.h stats.h sysutmp.h token.h \ udpfromto.h vmps.h vqp.h base64.h -# Our target -TARGET := src/include/radpaths.h +TARGET := src/include/radpaths.h src/include/radpaths.h: src/include/build-radpaths-h cd src/include && /bin/sh build-radpaths-h +# +# Build dynamic headers by substituting various values from autoconf.h, these +# get installed with the library files, so external programs can tell what +# the server library was built with. +# + +HEADERS_AC = src/include/missing.h src/include/tls.h +HEADERS_DY = src/include/autoconf.sed src/include/features.h $(HEADERS_AC) + +define clean_others +@rm -f $(HEADERS_DY) +endef + +TGT_POSTCLEAN := ${clean_others} + +all: $(HEADERS_DY) + +src/include/features.h: + @cp src/include/features-h src/include/features.h + @grep -o "^\#define\s*WITH_.*" src/include/autoconf.h >> src/include/features.h + +src/include/autoconf.sed: + @grep ^#define src/include/autoconf.h | sed 's,/\*\*/,1,;' | awk '{print "\ + s,#[[:blank:]]*ifdef[[:blank:]]*" $$2 ",#if "$$3 ",g;\ + s,#[[:blank:]]*ifndef[[:blank:]]*" $$2 ",#if !"$$3 ",g;\ + s,defined(" $$2 ")," $$3 ",g;\ + s," $$2 ","$$3 ",g;"}' > src/include/autoconf.sed + +$(HEADERS_AC): src/include/autoconf.sed + @sed -f src/include/autoconf.sed < `echo $@ | sed 's/\\./-/'` > $@ + +# +# Installation +# + # global install depends on the local rule install: install.src.include diff --git a/src/modules/all.mk b/src/modules/all.mk index fb414963429..9aa303d1956 100644 --- a/src/modules/all.mk +++ b/src/modules/all.mk @@ -1 +1,7 @@ +# +# Changes the behaviour of autoconf.h to undef definitions that would conflict +# with module config.h files. +# +CFLAGS += -DIS_MODULE=1 + SUBMAKEFILES := $(wildcard ${top_srcdir}/src/modules/rlm_*/all.mk)