summaryrefslogtreecommitdiffhomepage
path: root/patches/sdl1-1.2.15_pre.local.patch
blob: 6d2a5c8499fc84503064fd3c66bc5d0ae51caa32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
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,46 @@
             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_DUMMY 1" >>confdefs.h
+            SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
+
+            #$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 */