From 787dc260a8a788a0d2319fe76f7756e0bc607e03 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 24 Jun 2022 20:37:20 +0300 Subject: [PATCH] autotools: properly enable the version static assertions SDL doesn't use automake, therefore instead of AC_DEFINE_UNQUOTED manually add the defines to EXTRA_CFLAGS. --- configure | 10 +--------- configure.ac | 5 ++--- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 1c1ac2d20..560739fa9 100755 --- a/configure +++ b/configure @@ -18394,15 +18394,7 @@ printf "%s\n" "#define SDL_DEFAULT_ASSERT_LEVEL 3" >>confdefs.h ;; esac - -printf "%s\n" "#define SDL_BUILD_MAJOR_VERSION $SDL_MAJOR_VERSION" >>confdefs.h - - -printf "%s\n" "#define SDL_BUILD_MINOR_VERSION $SDL_MINOR_VERSION" >>confdefs.h - - -printf "%s\n" "#define SDL_BUILD_MICRO_VERSION $SDL_MICRO_VERSION" >>confdefs.h - +EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_BUILD_MAJOR_VERSION=$SDL_MAJOR_VERSION -DSDL_BUILD_MINOR_VERSION=$SDL_MINOR_VERSION -DSDL_BUILD_MICRO_VERSION=$SDL_MICRO_VERSION" # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} diff --git a/configure.ac b/configure.ac index 4420359cf..0b2c7c722 100644 --- a/configure.ac +++ b/configure.ac @@ -227,9 +227,8 @@ case "$enable_assertions" in ;; esac -AC_DEFINE_UNQUOTED([SDL_BUILD_MAJOR_VERSION], $SDL_MAJOR_VERSION, [ ]) -AC_DEFINE_UNQUOTED([SDL_BUILD_MINOR_VERSION], $SDL_MINOR_VERSION, [ ]) -AC_DEFINE_UNQUOTED([SDL_BUILD_MICRO_VERSION], $SDL_MICRO_VERSION, [ ]) +dnl For use in static assertions +EXTRA_CFLAGS="$EXTRA_CFLAGS -DSDL_BUILD_MAJOR_VERSION=$SDL_MAJOR_VERSION -DSDL_BUILD_MINOR_VERSION=$SDL_MINOR_VERSION -DSDL_BUILD_MICRO_VERSION=$SDL_MICRO_VERSION" dnl See whether we can use gcc style dependency tracking AC_ARG_ENABLE(dependency-tracking,