Blob Blame History Raw
https://bugs.gentoo.org/779445

commit ed1030d9b6a98e06aa293d18c49da18169918b8b
Author: orbea <orbea@riseup.net>
Date:   Tue Mar 30 18:57:37 2021 -0700

    Fix the build with parallel make and slibtool.
    
    There is no dependency on the $(OBJECTS) files on the 'build'
    directory which causes slibtool to fail when the directory
    does not yet exist. GNU libtool avoids this by being slower
    than mkdir(1).

diff --git a/Makefile.in b/Makefile.in
index ab51035..90940d4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -51,7 +51,7 @@ LT_RELEASE  = @LT_RELEASE@
 LT_REVISION = @LT_REVISION@
 LT_LDFLAGS  = -no-undefined -rpath $(DESTDIR)$(libdir) -release $(LT_RELEASE) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
 
-all: $(srcdir)/configure Makefile $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
+all: $(srcdir)/configure Makefile $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
 
 $(srcdir)/configure: $(srcdir)/configure.in
 	@echo "Warning, configure.in is out of date"
@@ -61,8 +61,9 @@ $(srcdir)/configure: $(srcdir)/configure.in
 Makefile: $(srcdir)/Makefile.in
 	$(SHELL) config.status $@
 
-$(objects):
-	$(SHELL) $(auxdir)/mkinstalldirs $@
+$(objects)/.created:
+	$(SHELL) $(auxdir)/mkinstalldirs $(objects)
+	touch $@
 
 .PHONY: all depend install install-bin install-hdrs install-lib install-data install-man uninstall uninstall-bin uninstall-hdrs uninstall-lib uninstall-data uninstall-man clean distclean dist
 depend:
@@ -71,6 +72,8 @@ depend:
 
 include $(depend)
 
+$(OBJECTS) $(SDLMAIN_OBJECTS): $(objects)/.created
+
 $(objects)/$(TARGET): $(OBJECTS)
 	$(LIBTOOL) --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LT_LDFLAGS)
 
@@ -88,7 +91,7 @@ install-hdrs:
 	    $(INSTALL) -m 644 $(srcdir)/include/$$file $(DESTDIR)$(includedir)/SDL/$$file; \
 	done
 	$(INSTALL) -m 644 include/SDL_config.h $(DESTDIR)$(includedir)/SDL/SDL_config.h
-install-lib: $(objects) $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
+install-lib: $(objects)/$(TARGET) $(objects)/$(SDLMAIN_TARGET)
 	$(SHELL) $(auxdir)/mkinstalldirs $(DESTDIR)$(libdir)
 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(TARGET) $(DESTDIR)$(libdir)/$(TARGET)
 	$(LIBTOOL) --mode=install $(INSTALL) $(objects)/$(SDLMAIN_TARGET) $(DESTDIR)$(libdir)/$(SDLMAIN_TARGET)
diff -ru SDL-1.2.15.orig/configure.in SDL-1.2.15/configure.in
--- SDL-1.2.15.orig/configure.in	2012-01-19 07:30:05.000000000 +0100
+++ SDL-1.2.15/configure.in	2019-11-08 11:00:50.134023690 +0100
@@ -453,39 +453,6 @@
     fi
 }
 
-dnl Find the ESD includes and libraries
-CheckESD()
-{
-    AC_ARG_ENABLE(esd,
-AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
-                  , enable_esd=yes)
-    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
-        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
-        if test x$have_esd = xyes; then
-            AC_ARG_ENABLE(esd-shared,
-AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
-                          , enable_esd_shared=yes)
-            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
-
-            AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
-            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
-            if test x$have_loadso != xyes && \
-               test x$enable_esd_shared = xyes; then
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
-            fi
-            if test x$have_loadso = xyes && \
-               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
-                echo "-- dynamic libesd -> $esd_lib"
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
-            else
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
-            fi
-            have_audio=yes
-        fi
-    fi
-}
-
 dnl Find PulseAudio
 CheckPulseAudio()
 {
@@ -2357,7 +2324,6 @@
         CheckMME
         CheckALSA
         CheckARTSC
-        CheckESD
         CheckPulseAudio
         CheckNAS
         CheckX11
@@ -2494,6 +2460,43 @@
             have_timers=yes
         fi
         ;;
+    *-*-midipix*)
+        ARCH=midipix
+
+        # Set up files for the timer library
+        if test x$enable_timers = xyes; then
+            AC_DEFINE(SDL_TIMER_UNIX)
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+            have_timers=yes
+        fi
+
+        CheckDummyVideo
+        CheckDiskAudio
+        CheckWIN32
+        #CheckWIN32GL
+        CheckNASM
+        CheckPTHREAD
+        CheckClockGettime
+        CheckVisibilityHidden
+        CheckDLOPEN
+
+        if test x$enable_audio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
+            SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+            have_audio=yes
+        fi
+        # Set up files for the cdrom library
+        if test x$enable_cdrom = xyes; then
+            $as_echo "#define SDL_CDROM_WIN32 1" >>confdefs.h
+
+            SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
+            have_cdrom=yes
+        fi
+
+        # Set up the system libraries we need
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -lkernel32"
+
+        ;;
     *-*-cygwin* | *-*-mingw32*)
         ARCH=win32
         if test "$build" != "$host"; then # cross-compiling
diff -ru SDL-1.2.15.orig/src/audio/windib/SDL_dibaudio.c SDL-1.2.15/src/audio/windib/SDL_dibaudio.c
--- SDL-1.2.15.orig/src/audio/windib/SDL_dibaudio.c	2012-01-19 07:30:06.000000000 +0100
+++ SDL-1.2.15/src/audio/windib/SDL_dibaudio.c	2019-11-08 12:49:20.451023616 +0100
@@ -35,6 +35,35 @@
 #include "win_ce_semaphore.h"
 #endif
 
+/* FIXME: temporary */
+#ifndef WOM_DONE
+#define WOM_DONE 0x3BD
+#endif
+
+#ifndef MAXERRORLENGTH
+#define MAXERRORLENGTH 256
+#endif
+
+#ifndef THREAD_PRIORITY_HIGHEST
+#define THREAD_PRIORITY_HIGHEST 2
+#endif
+
+#ifndef INFINITE
+#define INFINITE 0xffffffff
+#endif
+
+#ifndef WAVE_FORMAT_PCM
+#define WAVE_FORMAT_PCM 1
+#endif
+
+#ifndef WAVE_MAPPER
+#define WAVE_MAPPER ((UINT)-1)
+#endif
+
+#ifndef CALLBACK_FUNCTION
+#define CALLBACK_FUNCTION (int32_t)(0x00030000)
+#endif
+
 
 /* Audio driver functions */
 static int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec);
@@ -132,7 +161,7 @@
 	waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len);
 	WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL);
 #else
-	waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
+	waveOutGetErrorTextA(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
 #endif
 
 	SDL_SetError("%s",errbuf);
@@ -290,7 +319,7 @@
 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
 	audio_sem = CreateSemaphoreCE(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
 #else
-	audio_sem = CreateSemaphore(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
+	audio_sem = CreateSemaphoreA(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
 #endif
 	if ( audio_sem == NULL ) {
 		SDL_SetError("Couldn't create semaphore");
diff -ru SDL-1.2.15.orig/src/video/wincommon/SDL_lowvideo.h SDL-1.2.15/src/video/wincommon/SDL_lowvideo.h
--- SDL-1.2.15.orig/src/video/wincommon/SDL_lowvideo.h	2012-01-19 07:30:06.000000000 +0100
+++ SDL-1.2.15/src/video/wincommon/SDL_lowvideo.h	2019-11-08 11:58:43.821344665 +0100
@@ -140,7 +140,7 @@
    GDL_CreateWindow as well */
 LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
 
-#ifdef _WIN64
+#if defined(_WIN64) || defined(__midipix__)
 #define SDL_ToUnicode  ToUnicode
 #else
 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
diff -ru SDL-1.2.15.orig/src/video/wincommon/SDL_sysevents.c SDL-1.2.15/src/video/wincommon/SDL_sysevents.c
--- SDL-1.2.15.orig/src/video/wincommon/SDL_sysevents.c	2012-01-19 07:30:06.000000000 +0100
+++ SDL-1.2.15/src/video/wincommon/SDL_sysevents.c	2019-11-08 11:14:47.506238807 +0100
@@ -95,7 +95,7 @@
 extern void DIB_SwapGamma(_THIS);
 
 #ifndef NO_GETKEYBOARDSTATE
-#ifndef _WIN64
+#if !defined(_WIN64) && !defined(__midipix__)
 /* Variables and support functions for SDL_ToUnicode() */
 static int codepage;
 static int Is9xME();
@@ -669,7 +669,7 @@
 
 #ifndef NO_GETKEYBOARDSTATE
 		case WM_INPUTLANGCHANGE:
-#ifndef _WIN64
+#if !defined(_WIN64) && !defined(__midipix__)
 			codepage = GetCodePage();
 #endif
 		return(TRUE);
@@ -779,7 +779,7 @@
 #endif /* WM_MOUSELEAVE */
 
 #ifndef NO_GETKEYBOARDSTATE
-#ifndef _WIN64
+#if !defined(_WIN64) && !defined(__midipix__)
 	/* Initialise variables for SDL_ToUnicode() */
 	codepage = GetCodePage();
 
@@ -814,7 +814,7 @@
 }
 
 #ifndef NO_GETKEYBOARDSTATE
-#ifndef _WIN64
+#if !defined(_WIN64) && !defined(__midipix__)
 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
 
 static int Is9xME()
diff -ru SDL-1.2.15.orig/src/video/windib/SDL_dibvideo.c SDL-1.2.15/src/video/windib/SDL_dibvideo.c
--- SDL-1.2.15.orig/src/video/windib/SDL_dibvideo.c	2012-01-19 07:30:06.000000000 +0100
+++ SDL-1.2.15/src/video/windib/SDL_dibvideo.c	2019-11-08 11:17:09.328149984 +0100
@@ -822,9 +822,15 @@
 				video->flags |= SDL_RESIZABLE;
 			}
 		}
+
+/* FIXME: the heck? */
+#ifdef __midipix__
+		if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
+#else
 #if WS_MAXIMIZE && !defined(_WIN32_WCE)
 		if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
 #endif
+#endif
 	}
 
 	/* DJM: Don't piss of anyone who has setup his own window */