asterisk-15.x: speed up menuselect calls
authorSebastian Kemper <sebastian_ml@gmx.net>
Tue, 5 Dec 2017 20:03:50 +0000 (21:03 +0100)
committerSebastian Kemper <sebastian_ml@gmx.net>
Tue, 5 Dec 2017 20:04:05 +0000 (21:04 +0100)
Currently the menuselect calls, for each category or item, step into a
directory and call menuselect once. So if all packages are build
menuselect will be called hundreds of times and as many directory
changes will be done.

Instead step into the directory only once, then generate the argument
string by iteratively adding to it and then call menuselect once. The
speedup is big.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
net/asterisk-15.x/Makefile

index c4783a3a10b37498f5bc84e50cd8e6aa7617f63e..c191231055636bc9bbc6d6a96f0823eaeec0dbc3 100644 (file)
@@ -401,18 +401,20 @@ define Build/Compile
        LDFLAGS="$(HOST_LDFLAGS) -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib" \
        $(MAKE) -C "$(PKG_BUILD_DIR)/menuselect"
        $(MAKE) -C "$(PKG_BUILD_DIR)" menuselect-tree
-       for cat in $(MENUSELECT_CATEGORIES); do \
-               cd "$(PKG_BUILD_DIR)" && \
+       cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \
+               for cat in $(MENUSELECT_CATEGORIES); do \
+                       MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --disable-category $$$$cat"; \
+               done; \
                ./menuselect/menuselect \
-               --disable-category $$$$cat \
-               menuselect.makeopts; \
-       done
-       for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \
-               cd "$(PKG_BUILD_DIR)" && \
+                       $$$$MENUSELECT_ARGS \
+                       menuselect.makeopts
+       cd "$(PKG_BUILD_DIR)" && MENUSELECT_ARGS= && \
+               for item in $(AST_EMB_MODULES) $$(AST_ENABLE); do \
+                       MENUSELECT_ARGS="$$$$MENUSELECT_ARGS --enable $$$$item"; \
+               done; \
                ./menuselect/menuselect \
-               --enable $$$$item \
-               menuselect.makeopts; \
-       done
+                       $$$$MENUSELECT_ARGS \
+                       menuselect.makeopts
        cd "$(PKG_BUILD_DIR)" && \
                ./menuselect/menuselect \
                        --disable BUILD_NATIVE \