Skip to content

Commit

Permalink
Use autoconf macro
Browse files Browse the repository at this point in the history
  • Loading branch information
rfomin committed Nov 24, 2023
1 parent 4986518 commit 0e26c4a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 2 additions & 0 deletions pkg/config.make.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
3 changes: 1 addition & 2 deletions pkg/win32/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ include ../config.make

TOPLEVEL=../..

SYS:=$(shell uname)
ifneq (, $(findstring MINGW64, $(SYS)))
ifeq ($(TARGET_OS),64)
POSTFIX=win64
else
POSTFIX=win32
Expand Down

0 comments on commit 0e26c4a

Please sign in to comment.