]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
configure: Abort if gperf is not found but generated files don't exist
authorTobias Brunner <tobias@strongswan.org>
Thu, 5 Dec 2019 14:46:15 +0000 (15:46 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 6 Dec 2019 09:30:52 +0000 (10:30 +0100)
When building from a tarball gperf is not required as the generated
files already exist, however, when building from the repository that's
not the case, so warn the user if gperf is not found.

configure.ac

index 329739d8d89c0aa68f9c1c70b7980458ff39087a..83918ad3e0529db1a5bc60f64e2cee127c3cdbcc 100644 (file)
@@ -378,7 +378,7 @@ AC_ARG_VAR([PERL], [the Perl interpreter])
 AC_PATH_PROG([GPERF], [gperf], [], [$PATH:/bin:/usr/bin:/usr/local/bin])
 AC_ARG_VAR([GPERF], [the GNU gperf program])
 
-# because gperf is not needed by end-users we just report it but do not abort on failure
+# because gperf is not needed by end-users we only abort if generated files don't exist
 AC_MSG_CHECKING([gperf version >= 3.0.0])
 if test -x "$GPERF"; then
        if test "`$GPERF --version | $AWK -F' ' '/^GNU gperf/ { print $3 }' | $AWK -F. '{ print $1 }'`" -ge "3"; then
@@ -403,6 +403,10 @@ if test -x "$GPERF"; then
        fi
 else
        AC_MSG_RESULT([not found])
+       GPERF_TEST_FILE="$srcdir/src/libstrongswan/crypto/proposal/proposal_keywords_static.c"
+       if test ! -f "$GPERF_TEST_FILE"; then
+               AC_MSG_ERROR([GNU gperf required to generate e.g. $GPERF_TEST_FILE])
+       fi
 fi
 
 # ========================