aboutsummaryrefslogtreecommitdiff
path: root/packages/patches/mingw_fixes-0.40-1.patch
blob: f5fe84bfecc8b73d2dc055b9a8392f6bb0139907 (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
Index: configure.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/configure.in,v
retrieving revision 1.15
diff -u -w -r1.15 configure.in
--- configure.in	16 Aug 2005 04:06:28 -0000	1.15
+++ configure.in	22 Feb 2006 05:41:08 -0000
@@ -19,6 +19,7 @@
 AC_SUBST(GUIFLAGS)
 AC_SUBST(OSNUMBER)
 AC_SUBST(EXTERNTARGET)
+AC_SUBST(ASIOSRC)
 
 dnl other defaults
 
@@ -77,7 +78,10 @@
 
 dnl Checking for `pthread_create' function in -pthread
 AC_CHECK_LIB(pthread, pthread_create,PDLIB="$PDLIB -lpthread",
-         echo "pthreads required" || exit 1)
+    AC_CHECK_LIB(pthreadGC2, pthread_create, PDLIB="$PDLIB -lpthreadGC2",
+        AC_CHECK_LIB(pthreadGC1, pthread_create, PDLIB="$PDLIB -lpthreadGC1",
+            AC_CHECK_LIB(pthreadGC, pthread_create, PDLIB="$PDLIB -lpthreadGC",
+         echo "pthreads required"; exit 1))))
 
 dnl look for tcl 8.x... do I really have to go through all this!?
 
@@ -108,6 +112,11 @@
 fi
 if test $foundit == "no";
 then
+    AC_CHECK_HEADER(tcl8.4/tcl.h,
+    	GUIFLAGS="$GUIFLAGS -I/usr/local/include/tcl8.4";foundit=yes,)
+fi
+if test $foundit == "no";
+then
     AC_CHECK_HEADER(tcl8.3/tcl.h,
     	GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.3";foundit=yes,)
 fi
@@ -119,27 +128,30 @@
 if test $foundit == "no";
 then
     echo no tcl header found
-    exit -1
+	 echo bolding trying without...
+#    exit -1
 fi
 
-AC_CHECK_LIB(tcl8.7, main,,
-    AC_CHECK_LIB(tcl8.6, main,,
+AC_CHECK_LIB(tcl85, main,,
 	AC_CHECK_LIB(tcl8.5, main,,
+        AC_CHECK_LIB(tcl84, main,,
 	    AC_CHECK_LIB(tcl8.4, main,,
 		AC_CHECK_LIB(tcl8.3, main,,
 		    AC_CHECK_LIB(tcl8.2, main,,
-        		AC_CHECK_LIB(tcl8.0, main,,echo no tcl library found || exit 1)))))))
+        		            AC_CHECK_LIB(tcl8.0, main,,
+                            echo no tcl library found; exit 1)))))))
 
-AC_CHECK_LIB(tk8.7, main,,
-    AC_CHECK_LIB(tk8.6, main,,
+AC_CHECK_LIB(tk85, main,,
 	AC_CHECK_LIB(tk8.5, main,,
+       AC_CHECK_LIB(tk84, main,,
 	    AC_CHECK_LIB(tk8.4, main,,
 		AC_CHECK_LIB(tk8.3, main,,
 		    AC_CHECK_LIB(tk8.2, main,,
-        		AC_CHECK_LIB(tk8.0, main,,echo no tk library found || exit 1)))))))
+        		            AC_CHECK_LIB(tk8.0, main,,
+                            echo no tk library found; exit 1)))))))
 
 
-if test `uname -s` = Linux;
+if test `uname -s` == Linux;
 then
     dnl Ckecking for ALSA
     echo .................... alsa= $alsa
@@ -254,7 +266,7 @@
         LDFLAGS=$LDFLAGS" -lrt -ljack"
 fi
 
-if test `uname -s` = Darwin;
+if test `uname -s` == Darwin;
 then
     LDFLAGS="-Wl -framework CoreAudio \
         -framework AudioUnit -framework AudioToolbox \
@@ -324,6 +336,39 @@
     fi
 fi
 
+# only Windows uses ASIO, for the rest, set to blank
+ASIOSRC=
+
+if test `uname -s` == MINGW32_NT-5.0;
+then
+    EXT=dll
+    MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -DPD_INTERNAL \
+        -I../portaudio/pa_common -I../portaudio/pablio \
+        -mwindows -mms-bitfields "$MORECFLAGS
+    PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++"
+
+    SYSSRC="s_audio_pa.c s_audio_pablio.c s_audio_paring.c \
+        s_audio_mmio.c s_midi_mmio.c \
+        ../portaudio/pa_common/pa_allocation.c  \
+        ../portaudio/pa_common/pa_converters.c  \
+        ../portaudio/pa_common/pa_cpuload.c     \
+        ../portaudio/pa_common/pa_dither.c      \
+        ../portaudio/pa_common/pa_front.c       \
+        ../portaudio/pa_common/pa_process.c     \
+        ../portaudio/pa_common/pa_skeleton.c    \
+        ../portaudio/pa_common/pa_stream.c      \
+        ../portaudio/pa_common/pa_trace.c       \
+        ../portaudio/pa_win/pa_win_util.c       \
+        ../portaudio/pa_win/pa_win_hostapis.c   \
+        ../portaudio/pa_win_wmme/pa_win_wmme.c"
+	 ASIOSRC="../portaudio/pa_asio/iasiothiscallresolver.cpp \
+	 ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \
+	 ../asio/asiodrivers.cpp ../asio/asiolist.cpp"
+    STRIPFLAG="--strip-unneeded"
+    GUINAME="pdtcl.dll"
+    GUIFLAGS=
+fi
+
 # support for jack, on either linux or darwin:
 
 if test x$jack == "xyes";
Index: makefile.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile.in,v
retrieving revision 1.8
diff -u -w -r1.8 makefile.in
--- makefile.in	24 Jul 2005 19:41:14 -0000	1.8
+++ makefile.in	22 Feb 2006 05:41:08 -0000
@@ -30,6 +30,10 @@
 
 SYSSRC += @SYSSRC@
 
+ASIOSRC = @ASIOSRC@
+
+ASIOOBJ = $(ASIOSRC:.cpp=.o)
+
 SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
     g_scalar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c \
     g_all_guis.c g_bang.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c \
@@ -70,6 +74,9 @@
 $(GOBJ) : %.o : %.c
 	$(CC) $(CFLAGS) $(GFLAGS) $(GINCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c 
 
+$(ASIOOBJ): %.o : %.cpp
+	$(CXX) $(CFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.cpp
+
 pd: $(PDEXEC)
 
 gui: $(BIN_DIR)/$(GUINAME)
@@ -109,6 +116,12 @@
 		 @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \
 		../bin/libPdTcl.dylib
 
+# this is for Windows/MinGW (only?)
+$(BIN_DIR)/pdtcl.dll: $(GOBJ)
+	cd $(BIN_DIR); dllwrap --export-all-symbols --output-def pdtcl.def \
+	--output-lib=pdtcl.a --dllname=$(GUINAME) $(OBJ_DIR)/t_tkcmd.o $(LIB) $(GLIB)
+	strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+
 externs: 
 	cd ../extra/bonk~;make @EXTERNTARGET@
 	cd ../extra/choice;make @EXTERNTARGET@
Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.14
diff -u -w -r1.14 s_inter.c
--- s_inter.c	15 Oct 2005 23:14:28 -0000	1.14
+++ s_inter.c	22 Feb 2006 05:41:08 -0000
@@ -23,16 +23,19 @@
 #ifdef HAVE_BSTRING_H
 #include <bstring.h>
 #endif
-#ifdef MSW
+#ifdef _WIN32
 #include <io.h>
 #include <fcntl.h>
 #include <process.h>
 #include <winsock.h>
 #include <windows.h>
+# ifdef _MSC_VER
 typedef int pid_t;
+# endif
 typedef int socklen_t;
 #define EADDRINUSE WSAEADDRINUSE
 #endif
+
 #include <stdarg.h>
 #include <signal.h>
 #include <fcntl.h>