]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Set LLONG_MAX for C89 test.
authorDarren Tucker <dtucker@dtucker.net>
Thu, 31 Aug 2023 13:02:35 +0000 (23:02 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 31 Aug 2023 13:02:35 +0000 (23:02 +1000)
If we don't have LLONG_MAX, configure will figure out that it can get it
by setting -std=gnu99, at which point we won't be testing C89 any more.
To avoid this, feed it in via CFLAGS.

.github/configs

index 66cb2d0e8e2b2f8d2896e7e403a75c1ac7ee1ea7..c7d6a55ab962f54b9e08c348b7e8a291590baa9e 100755 (executable)
@@ -30,6 +30,13 @@ case "$config" in
     default|sol64)
        ;;
     c89)
+       # If we don't have LLONG_MAX, configure will figure out that it can
+       # get it by setting -std=gnu99, at which point we won't be testing
+       # C89 any more.  To avoid this, feed it in via CFLAGS.
+       llong_max=`gcc -E -dM - </dev/null | \
+           awk '$2=="__LONG_LONG_MAX__"{print $3}'`
+       CPPFLAGS="-DLLONG_MAX=${llong_max}"
+
        CC="gcc"
        CFLAGS="-Wall -std=c89 -pedantic -Werror=vla"
        CONFIGFLAGS="--without-zlib"