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