From: Arran Cudbard-Bell Date: Wed, 16 May 2018 15:24:41 +0000 (+0600) Subject: Autolink utility headers X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bb60de9531043f12c25c4bbb225a9db09fc676b;p=thirdparty%2Ffreeradius-server.git Autolink utility headers --- diff --git a/src/include/all.mk b/src/include/all.mk index f5b03732c7a..6516dbec96c 100644 --- a/src/include/all.mk +++ b/src/include/all.mk @@ -134,8 +134,6 @@ src/include/radpaths.h: src/include/build-radpaths-h src/freeradius-devel: ${Q}[ -e $@ ] || ln -s include $@ @echo LN-SF src/include src/freeradius-devel - ${Q}[ -e src/include/io ] || ln -s ${top_srcdir}/src/lib/io ${top_srcdir}/src/include - @echo LN-SF src/include/io src/freeradius-devel/io # # Ensure we set up the build environment diff --git a/src/include/ldap b/src/include/ldap deleted file mode 120000 index 232d4d2f897..00000000000 --- a/src/include/ldap +++ /dev/null @@ -1 +0,0 @@ -../lib/ldap/ \ No newline at end of file diff --git a/src/lib/all.mk b/src/lib/all.mk index c16adf0e0c7..0fe0cf8f26e 100644 --- a/src/lib/all.mk +++ b/src/lib/all.mk @@ -1,6 +1,38 @@ -SUBMAKEFILES := \ - io/all.mk \ - ldap/all.mk \ - soh/all.mk \ - tls/all.mk \ - util/all.mk +# Create the soft link for the protocol-specific include files +# before building the lib. +# +define LIB_INCLUDE +# +# This is a hack to get the include files linked correctly. We would +# LOVE to be able to do: +# +# $${libfreeradius-${1}.la_OBJS}: | src/include/${1} +# +# but GNU Make is too stupid to wait until that variable is defined +# to evaluate the condition. Instead, it evaluates the rule +# immediately, and decides that nothing is there. +# +# So, we instead depend on a targe which has already been defined.t +# - This is a terrible hack +# +src/freeradius-devel: | src/include/${1} + +src/include/${1}: + $${Q}[ -e $$@ ] || ln -sf $${top_srcdir}/src/lib/${1} $$@ + @echo LN-SF src/lib/${1} $$@ + +install.src.include: $(addprefix ${SRC_INCLUDE_DIR}/,${1}/${1}.h) +endef + + +# +# All lib go into subdirectories of the "lib" directory. +# +SUBMAKEFILES := $(wildcard ${top_srcdir}/src/lib/*/all.mk) + +# +# Add library-specific rules to link include files, etc. +# +$(foreach x,$(SUBMAKEFILES), \ + $(eval $(call LIB_INCLUDE,$(subst /all.mk,,$(subst ${top_srcdir}/src/lib/,,$x)))) \ +)