summaryrefslogtreecommitdiffstats
path: root/src/sdl2.mk
diff options
context:
space:
mode:
Diffstat (limited to 'src/sdl2.mk')
-rw-r--r--src/sdl2.mk33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/sdl2.mk b/src/sdl2.mk
new file mode 100644
index 0000000..f9b6902
--- /dev/null
+++ b/src/sdl2.mk
@@ -0,0 +1,33 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := sdl2
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 2.0.3
+$(PKG)_CHECKSUM := 21c45586a4e94d7622e371340edec5da40d06ecc
+$(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)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+ $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
+ ln -sf '$(PREFIX)/$(TARGET)/bin/sdl2-config' '$(PREFIX)/bin/$(TARGET)-sdl2-config'
+endef
+
+# MinGW32 does not have dxgi.h...
+$(PKG)_BUILD_i686-pc-mingw32 =