]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix dependencies
authorAlan T. DeKok <aland@freeradius.org>
Fri, 23 Oct 2015 14:51:38 +0000 (10:51 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 23 Oct 2015 16:40:24 +0000 (12:40 -0400)
Simplify the dependencies and the build.

scripts/boiler.mk
src/all.mk
src/include/all.mk
src/include/build.h

index 5d3c0cab02c1ec21cd11741c3595856df8b3be1b..6205904f52dc0cddfc11ee2af72ffb0edcfc50c5 100644 (file)
@@ -128,7 +128,7 @@ endef
 #
 ifeq "${CPP_MAKEDEPEND}" "yes"
 define ADD_OBJECT_RULE
-$${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} ${JLIBTOOL}
+$${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} | ${BOOTSTRAP_BUILD}
        ${2}
        $${CPP} $${CPPFLAGS} $$(addprefix -I,$${SRC_INCDIRS}) $${SRC_DEFS} $$< | sed \
          -n 's,^\# *[0-9][0-9]* *"\([^"]*\)".*,$$@: \1,p' > $${BUILD_DIR}/objs/$$*.d
@@ -137,14 +137,14 @@ endef
 
 else
 define ADD_OBJECT_RULE
-$${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} ${JLIBTOOL}
+$${BUILD_DIR}/objs/%.${OBJ_EXT} $${BUILD_DIR}/objs/%.d: ${1} | ${BOOTSTRAP_BUILD}
        ${2}
 ${FILTER_DEPENDS}
 endef
 endif
 
 define ADD_ANALYZE_RULE
-$${BUILD_DIR}/plist/%.plist: ${1} ${JLIBTOOL}
+$${BUILD_DIR}/plist/%.plist: ${1}
        ${2}
 endef
 
@@ -591,6 +591,7 @@ endif
 
 # Define compilers and linkers
 #
+BOOTSTRAP_BUILD = 
 COMPILE.c = ${CC}
 COMPILE.cxx = ${CXX}
 CPP = cc -E
index b3dfdbd71c451b441082a4a17b06c956a5fc86fe..d7a8a4ff21f7d4d177796e0a6c5b3322728d0180 100644 (file)
@@ -1,15 +1,4 @@
 # add this dependency BEFORE including the other submakefiles.
 all:
 
-#
-#  This nonsense is here because pattern rules don't work if you have
-#  multiple of them.  If you try to run the shell script by assigning
-#  it to a variable, GNU Make notices that the variable isn't used...
-#  and doesn't run the shell script.  This crap below seems to bypass
-#  Make's optimization.
-#
-ifeq "$(shell [ -e src/freeradius-devel ] || ln -s include src/freeradius-devel)" ""
-# do nothing
-endif
-
 SUBMAKEFILES := include/all.mk lib/all.mk modules/all.mk main/all.mk tests/all.mk
index 08c5668de48760de4814b700a634eff9f3072ef6..d298b8b7bb4e0cf37cd454d203b11247deadd1ae 100644 (file)
@@ -2,27 +2,35 @@
 # Version:     $Id$
 #
 
+#
+#  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.
+#
+#  The RFC headers are dynamic, too.
+#
+#  The rest of the headers are static.
+#
+
+HEADERS_DY = attributes.h features.h radpaths.h tls.h
+
 HEADERS        = \
-       attributes.h \
        build.h \
        conf.h \
        conffile.h \
        detail.h \
        event.h \
-       features.h \
        hash.h \
        heap.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 \
@@ -31,16 +39,8 @@ HEADERS      = \
        token.h \
        udpfromto.h \
        base64.h \
-       map.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_DY = src/include/features.h src/include/missing.h src/include/tls.h \
-       src/include/radpaths.h src/include/attributes.h
+       map.h \
+       $(HEADERS_DY)
 
 #
 #  Solaris awk doesn't recognise [[:blank:]] hence [\t ]
@@ -63,6 +63,7 @@ src/include/autoconf.sed: src/include/autoconf.h
 
 RFC_DICTS := $(filter-out %~,$(wildcard share/dictionary.rfc*))
 RFC_HEADERS := $(patsubst share/dictionary.%,src/include/%.h,$(RFC_DICTS))
+HEADERS        += $(notdir ${RFC_HEADERS})
 
 src/include/attributes.h: share/dictionary.freeradius.internal
        @$(ECHO) HEADER $@
@@ -74,15 +75,6 @@ src/include/%.h: share/dictionary.% share/dictionary.vqp
        @$(ECHO) HEADER $@
        @grep ^ATTRIBUTE $<  | awk '{print "PW_"$$2 " " $$3 "   //!< AUTOGENERATED ATTRIBUTE DEFINITION"}' | tr '[:lower:]' '[:upper:]' | tr -- - _ | sed 's/^/#define /' > $@
 
-src/include/radius.h: | src/include/attributes.h $(RFC_HEADERS) src/include/vqp.h
-
-#
-#  So the headers are created before we compile anything
-#
-$(JLIBTOOL): src/include/radius.h
-
-src/freeradius-devel/features.h: src/include/features.h src/freeradius-devel
-
 #
 #  Build features.h by copying over WITH_* and RADIUSD_VERSION_*
 #  preprocessor macros from autoconf.h
@@ -97,8 +89,6 @@ src/include/features.h: src/include/features-h src/include/autoconf.h
        @grep "^#define[ ]*WITH_" src/include/autoconf.h >> $@
        @grep "^#define[ ]*RADIUSD_VERSION" src/include/autoconf.h >> $@
 
-src/freeradius-devel/missing.h: src/include/missing.h src/freeradius-devel
-
 #
 #  Use the SED script we built earlier to make permanent substitutions
 #  of definitions in missing-h to build missing.h
@@ -107,19 +97,24 @@ src/include/missing.h: src/include/missing-h src/include/autoconf.sed
        @$(ECHO) HEADER $@
        @sed -f src/include/autoconf.sed < $< > $@
 
-src/freeradius-devel/tls.h: src/include/tls.h src/freeradius-devel
-
 src/include/tls.h: src/include/tls-h src/include/autoconf.sed
        @$(ECHO) HEADER $@
        @sed -f src/include/autoconf.sed < $< > $@
 
-src/freeradius-devel/radpaths.h: src/include/radpaths.h src/freeradius-devel
-
 src/include/radpaths.h: src/include/build-radpaths-h
        @$(ECHO) HEADER $@
        @cd src/include && /bin/sh build-radpaths-h
 
-${BUILD_DIR}/make/jlibtool: $(HEADERS_DY)
+#
+#  Create the soft link for the fake include file path.
+#
+src/freeradius-devel:
+       @[ -e $@ ] || ln -s include $@
+
+#
+#  Ensure we set up the build environment
+#
+BOOTSTRAP_BUILD += src/freeradius-devel $(addprefix src/include/,$(HEADERS_DY))
 
 ######################################################################
 #
@@ -152,7 +147,7 @@ install: install.src.include
 #
 .PHONY: clean.src.include distclean.src.include
 clean.src.include:
-       @rm -f $(HEADERS_DY)
+       @rm -f $(addprefix src/include/,$(HEADERS_DY))
 
 clean: clean.src.include
 
index 2d80039b09572b3c64837e154db6e5d98e095054..d9c8c7f38971c078ee31c72a2ec7f1bfb40bb5c1 100644 (file)
@@ -10,7 +10,6 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-#include <freeradius-devel/autoconf.h> /* Needed for endian macros */
 
 /*
  *     The ubiquitous stringify macros