You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mxe/src/sdl2.mk

38 lines
1.3 KiB

# This file is part of MXE. See LICENSE.md for licensing information.
PKG := sdl2
$(PKG)_WEBSITE := http://www.libsdl.org/
$(PKG)_DESCR := SDL2
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.0.5
$(PKG)_CHECKSUM := 442038cf55965969f2ff06d976031813de643af9c9edc9e331bd761c242e8785
$(PKG)_SUBDIR := SDL2-$($(PKG)_VERSION)
$(PKG)_FILE := SDL2-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := http://www.libsdl.org/release/$($(PKG)_FILE)
$(PKG)_DEPS := gcc libiconv
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://hg.libsdl.org/SDL/tags' | \
$(SED) -n 's,.*release-\([0-9][^<]*\).*,\1,p' | \
head -1
endef
define $(PKG)_BUILD
cd '$(1)' && aclocal -I acinclude && autoconf && ./configure \
$(MXE_CONFIGURE_OPTS) \
--enable-threads \
--enable-directx
$(SED) -i 's,defined(__MINGW64_VERSION_MAJOR),defined(__MINGW64_VERSION_MAJOR) \&\& defined(_WIN64),' '$(1)/include/SDL_cpuinfo.h'
$(SED) -i 's,-XCClinker,,' '$(1)/sdl2.pc'
$(SED) -i 's,-XCClinker,,' '$(1)/sdl2-config'
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
ln -sf '$(PREFIX)/$(TARGET)/bin/sdl2-config' '$(PREFIX)/bin/$(TARGET)-sdl2-config'
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-sdl2.exe' \
`'$(TARGET)-pkg-config' sdl2 --cflags --libs`
endef