From 0e26c4a2d6d91f3a8bedb205ffbc6179537ecbc9 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Fri, 24 Nov 2023 22:03:09 +0700 Subject: [PATCH] Use autoconf macro --- configure.ac | 13 +++++++++++++ pkg/config.make.in | 2 ++ pkg/win32/GNUmakefile | 3 +-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b6810d0010..ed8a38c180 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,19 @@ then CFLAGS="-O$OPT_LEVEL -g $WARNINGS $orig_CFLAGS" fi +AC_CANONICAL_TARGET +TARGET_OS="" +AS_CASE([$target_cpu], + [x86_64|aarch64*], + [ + TARGET_OS="64" + ], + [i?86|arm*], + [ + TARGET_OS="32" + ]) +AC_SUBST([TARGET_OS]) + PKG_CHECK_MODULES(SDL, [sdl2 >= 2.0.14]) # Check for SDL2_mixer AC_ARG_ENABLE([sdl2mixer], diff --git a/pkg/config.make.in b/pkg/config.make.in index b08a2f9787..972be10e46 100644 --- a/pkg/config.make.in +++ b/pkg/config.make.in @@ -19,6 +19,8 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +TARGET_OS = @TARGET_OS@ + # Documentation files to distribute with packages. DOC_FILES = README.md \ diff --git a/pkg/win32/GNUmakefile b/pkg/win32/GNUmakefile index d2b7591011..e14f564ec1 100644 --- a/pkg/win32/GNUmakefile +++ b/pkg/win32/GNUmakefile @@ -3,8 +3,7 @@ include ../config.make TOPLEVEL=../.. -SYS:=$(shell uname) -ifneq (, $(findstring MINGW64, $(SYS))) +ifeq ($(TARGET_OS),64) POSTFIX=win64 else POSTFIX=win32