]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Add option for a quick rebuild of strongSwan
authorTobias Brunner <tobias@strongswan.org>
Thu, 20 Mar 2025 08:23:34 +0000 (09:23 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 4 Apr 2025 10:06:59 +0000 (12:06 +0200)
This shaves off about 1 minute of build time on my machine.  We also
don't need the separate build step and can just run `make install`.

testing/scripts/build-strongswan
testing/scripts/recipes/013_strongswan.mk

index 1956e132d46e0af8b5626061d514b86bf42ae9d0..d51ffddbfbb6592884934d4eb40497d20041d10a 100755 (executable)
@@ -23,6 +23,7 @@ Usage:
     --help            (-h)  show usage information
     --all             (-a)  build/install all software, not only strongSwan
     --clean           (-c)  use a new strongSwan build directory
+    --quick-rebuild   (-q)  skip running autoreconf and configure
     --guest NAME      (-g)  only install in a specific guest image
     --no-guests       (-n)  don't build any guest images after the root image
     --replace         (-r)  replace the root image (implies --all)
@@ -32,6 +33,7 @@ EOF
 
 ALL_RECIPES=
 CLEAN=
+QUICK_REBUILD=
 GUEST=
 NO_GUESTS=
 REPLACE=
@@ -49,6 +51,9 @@ while :; do
        -c|--clean)
                CLEAN=1
                ;;
+       -q|--quick-rebuild)
+               QUICK_REBUILD=1
+               ;;
        -g|--guest)
                if [ "$2" ]; then
                        GUEST=$2
@@ -153,8 +158,10 @@ if [ -z "$TARBALL" ]; then
        echo "$version" > $SHAREDDIR/.strongswan-version
        log_status 0
 
-       log_action "Preparing source tree"
-       execute_chroot 'autoreconf -i /root/strongswan'
+       if [ -z "$QUICK_REBUILD" ]; then
+               log_action "Preparing source tree"
+               execute_chroot 'autoreconf -i /root/strongswan'
+       fi
 fi
 
 RECPDIR=$DIR/recipes
@@ -185,7 +192,7 @@ do
        log_action "Installing from recipe $r"
        if [[ $r == *strongswan.mk && -z "$TARBALL" ]]; then
                cp $RECPDIR/$r $SHAREDDIR/build-strongswan
-               execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan -f /root/shared/build-strongswan/$r"
+               execute_chroot "make SRCDIR=/root/strongswan BUILDDIR=/root/shared/build-strongswan QUICK_REBUILD=$QUICK_REBUILD -f /root/shared/build-strongswan/$r"
        else
                cp $RECPDIR/$r ${LOOPDIR}/root/shared/compile
                execute_chroot "make SWANVERSION=$TARBALL -C /root/shared/compile -f $r"
index ddd96648284564503ed3cab725fb143dbff0b433..003f15203e604bb63280fc9391fd4d92c132a652 100644 (file)
@@ -127,11 +127,8 @@ $(PKG): $(TAR)
        echo "$(SWANVERSION)" > /root/shared/.strongswan-version
 
 configure: $(BUILDDIR)
-       cd $(BUILDDIR) && $(DIR)/configure $(CONFIG_OPTS)
+       [ -n "$(QUICK_REBUILD)" ] || (cd $(BUILDDIR) && $(DIR)/configure $(CONFIG_OPTS))
 
-build: configure
-       cd $(BUILDDIR) && make -j $(NUM_CPUS)
-
-install: build
+install: configure
        cd $(BUILDDIR) && make -j install && \
                cd $(DIR)/src/libcharon/plugins/vici/python && python3 setup.py install