diff options
author | Tony Theodore <tonyt@logyst.com> | 2014-04-03 22:37:24 (GMT) |
---|---|---|
committer | Tony Theodore <tonyt@logyst.com> | 2014-04-03 22:37:24 (GMT) |
commit | 2b8ec6f00903acbbbcd7cd26dd8012daf5d7263b (patch) | |
tree | 7c05c279e6ef142bc8051cc305d16b65d3d4fa91 | |
parent | b06d382dff9eaff226af9300efb23ba2fb79a326 (diff) | |
parent | 47990df1d70b555f68bccdf3aa67527ece38aeae (diff) | |
download | mxe-2b8ec6f00903acbbbcd7cd26dd8012daf5d7263b.zip mxe-2b8ec6f00903acbbbcd7cd26dd8012daf5d7263b.tar.gz mxe-2b8ec6f00903acbbbcd7cd26dd8012daf5d7263b.tar.bz2 |
Merge pull request #363 from TobiX/sdl2-shared
Sdl2 shared
-rw-r--r-- | src/sdl2-2-dxgi.patch | 18 | ||||
-rw-r--r-- | src/sdl2-2-libtool.patch | 94 | ||||
-rw-r--r-- | src/sdl2.mk | 12 | ||||
-rw-r--r-- | src/sdl2_image.mk | 12 | ||||
-rw-r--r-- | src/sdl2_net.mk | 4 |
5 files changed, 107 insertions, 33 deletions
diff --git a/src/sdl2-2-dxgi.patch b/src/sdl2-2-dxgi.patch deleted file mode 100644 index 9b1b924..0000000 --- a/src/sdl2-2-dxgi.patch +++ /dev/null @@ -1,18 +0,0 @@ -This file is part of MXE. -See index.html for further information. - -This patch has been taken from: -https://bugzilla.libsdl.org/show_bug.cgi?id=2440 - -diff -u tmp-sdl2/SDL2-2.0.2/src/video/windows/SDL_windowsvideo.c SDL2-2.0.2/src/video/windows/SDL_windowsvideo.c ---- a/src/video/windows/SDL_windowsvideo.c 2014-03-09 09:20:03.133800102 +0100 -+++ b/src/video/windows/SDL_windowsvideo.c 2014-03-08 05:36:50.000000000 +0100 -@@ -247,7 +247,7 @@ - - #define CINTERFACE - #define COBJMACROS --#include <DXGI.h> -+#include <dxgi.h> - - SDL_bool - DXGI_LoadDLL( void **pDXGIDLL , IDXGIFactory **pDXGIFactory ) diff --git a/src/sdl2-2-libtool.patch b/src/sdl2-2-libtool.patch new file mode 100644 index 0000000..bc759b9 --- /dev/null +++ b/src/sdl2-2-libtool.patch @@ -0,0 +1,94 @@ +This file is part of MXE. +See index.html for further information. + +This patch is a combination of 2 patches from: +https://bugzilla.libsdl.org/show_bug.cgi?id=1431 + +- Use libtool everywhere (by john) +- MingW fixes for "Use libtool everywhere" (by Daniel Scharrer) + +These fix compiles in a strictly shared build (with --disable-static) by always +building libSDL2main.a and libSDL2_test.a staticly. + +diff -Naur SDL2-2.0.3.orig/configure.in SDL2-2.0.3/configure.in +--- SDL2-2.0.3.orig/configure.in 2014-03-16 03:31:42.000000000 +0100 ++++ SDL2-2.0.3/configure.in 2014-03-30 21:30:22.905372035 +0200 +@@ -3136,23 +3136,23 @@ + + VERSION_OBJECTS=`echo $VERSION_SOURCES` + VERSION_DEPENDS=`echo $VERSION_SOURCES` +-VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.o,g'` ++VERSION_OBJECTS=`echo "$VERSION_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.rc,$(objects)/\1.lo,g'` + VERSION_DEPENDS=`echo "$VERSION_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.rc,\\\\ +-\\$(objects)/\\2.o: \\1/\\2.rc\\\\ +- \\$(WINDRES) \\$< \\$@,g"` ++\\$(objects)/\\2.lo: \\1/\\2.rc\\\\ ++ \\$(LIBTOOL) --mode=compile --tag=RC \\$(WINDRES) -i \\$< -o \\$@,g"` + + SDLMAIN_OBJECTS=`echo $SDLMAIN_SOURCES` + SDLMAIN_DEPENDS=`echo $SDLMAIN_SOURCES` +-SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` ++SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` + SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\ +-\\$(objects)/\\2.o: \\1/\\2.c\\\\ ++\\$(objects)/\\2.lo: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` + + SDLTEST_OBJECTS=`echo $SDLTEST_SOURCES` + SDLTEST_DEPENDS=`echo $SDLTEST_SOURCES` +-SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'` ++SDLTEST_OBJECTS=`echo "$SDLTEST_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'` + SDLTEST_DEPENDS=`echo "$SDLTEST_DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.c,\\\\ +-\\$(objects)/\\2.o: \\1/\\2.c\\\\ ++\\$(objects)/\\2.lo: \\1/\\2.c\\\\ + \\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"` + + # Set runtime shared library paths as needed +diff -Naur SDL2-2.0.3.orig/Makefile.in SDL2-2.0.3/Makefile.in +--- SDL2-2.0.3.orig/Makefile.in 2014-03-16 03:31:41.000000000 +0100 ++++ SDL2-2.0.3/Makefile.in 2014-03-30 21:32:03.241200584 +0200 +@@ -33,10 +33,10 @@ + OBJECTS = @OBJECTS@ + VERSION_OBJECTS = @VERSION_OBJECTS@ + +-SDLMAIN_TARGET = libSDL2main.a ++SDLMAIN_TARGET = libSDL2main.la + SDLMAIN_OBJECTS = @SDLMAIN_OBJECTS@ + +-SDLTEST_TARGET = libSDL2_test.a ++SDLTEST_TARGET = libSDL2_test.la + SDLTEST_OBJECTS = @SDLTEST_OBJECTS@ + + SRC_DIST = *.txt acinclude Android.mk autogen.sh android-project build-scripts cmake configure configure.in debian include Makefile.* sdl2-config.in sdl2.m4 sdl2.pc.in SDL2.spec.in src test VisualC.html VisualC Xcode Xcode-iOS +@@ -123,15 +123,13 @@ + .PHONY: all update-revision install install-bin install-hdrs install-lib install-data uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data clean distclean dist $(OBJECTS:.lo=.d) + + $(objects)/$(TARGET): $(OBJECTS) $(VERSION_OBJECTS) +- $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJECTS) $(VERSION_OBJECTS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) ++ $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) + + $(objects)/$(SDLMAIN_TARGET): $(SDLMAIN_OBJECTS) +- $(AR) cru $@ $(SDLMAIN_OBJECTS) +- $(RANLIB) $@ ++ $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static + + $(objects)/$(SDLTEST_TARGET): $(SDLTEST_OBJECTS) +- $(AR) cru $@ $(SDLTEST_OBJECTS) +- $(RANLIB) $@ ++ $(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS) -all-static + + install: all install-bin install-hdrs install-lib install-data + install-bin: +@@ -152,10 +150,8 @@ + install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET) $(objects)/$(SDLTEST_TARGET) + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir) + $(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET) +- $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) +- $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) +- $(RANLIB) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) ++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET) ++ $(LIBTOOL) --mode=install $(INSTALL) -m 644 $(objects)/$(SDLTEST_TARGET) $(DESTDIR)$(libdir)/$(SDLTEST_TARGET) + install-data: + $(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(datadir)/aclocal + $(INSTALL) -m 644 $(srcdir)/sdl2.m4 $(DESTDIR)$(datadir)/aclocal/sdl2.m4 diff --git a/src/sdl2.mk b/src/sdl2.mk index 3d0aeba..f9b6902 100644 --- a/src/sdl2.mk +++ b/src/sdl2.mk @@ -3,8 +3,8 @@ PKG := sdl2 $(PKG)_IGNORE := -$(PKG)_VERSION := 2.0.2 -$(PKG)_CHECKSUM := 304c7cd3dddca98724a3e162f232a8a8f6e1ceb3 +$(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) @@ -17,11 +17,8 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - $(SED) -i 's,-mwindows,-lwinmm -mwindows,' '$(1)/configure' cd '$(1)' && aclocal -I acinclude && autoconf && ./configure \ - --host='$(TARGET)' \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ + $(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' @@ -31,3 +28,6 @@ define $(PKG)_BUILD $(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 = diff --git a/src/sdl2_image.mk b/src/sdl2_image.mk index d3e259b..e8e17d9 100644 --- a/src/sdl2_image.mk +++ b/src/sdl2_image.mk @@ -17,17 +17,17 @@ define $(PKG)_UPDATE endef define $(PKG)_BUILD - $(SED) -i 's,^\(Requires:.*\),\1 libtiff-4 libpng,' '$(1)/SDL2_image.pc.in' + $(SED) -i 's,^\(Requires:.*\),\1\nRequires.private: libtiff-4 libpng,' '$(1)/SDL2_image.pc.in' cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ + $(MXE_CONFIGURE_OPTS) \ --with-sdl-prefix='$(PREFIX)/$(TARGET)' \ --disable-sdltest \ --disable-jpg-shared \ --disable-webp-shared \ --disable-png-shared \ - --disable-tif-shared \ - LIBS='-lz' + --disable-tif-shared $(MAKE) -C '$(1)' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= endef + +# Disable until sdl2 can be built on MinGW32 +$(PKG)_BUILD_i686-pc-mingw32 = diff --git a/src/sdl2_net.mk b/src/sdl2_net.mk index 759cb8f..dce9518 100644 --- a/src/sdl2_net.mk +++ b/src/sdl2_net.mk @@ -18,9 +18,7 @@ endef define $(PKG)_BUILD cd '$(1)' && ./configure \ - --host='$(TARGET)' \ - --disable-shared \ - --prefix='$(PREFIX)/$(TARGET)' \ + $(MXE_CONFIGURE_OPTS) \ --with-sdl-prefix='$(PREFIX)/$(TARGET)' \ --disable-sdltest \ --disable-gui |