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: d_mayer_fft.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_mayer_fft.c,v retrieving revision 1.3 diff -u -w -r1.3 d_mayer_fft.c --- d_mayer_fft.c 18 May 2005 04:28:50 -0000 1.3 +++ d_mayer_fft.c 22 Feb 2006 05:41:08 -0000 @@ -48,7 +48,8 @@ * of work. -msp */ -#ifdef MSW +/* These pragmas are only used for MSVC, not MinGW or Cygwin */ +#ifdef _MSC_VER #pragma warning( disable : 4305 ) /* uncast const double to float */ #pragma warning( disable : 4244 ) /* uncast double to float */ #pragma warning( disable : 4101 ) /* unused local variables */ Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.8 diff -u -w -r1.8 m_pd.h --- m_pd.h 19 Aug 2005 23:28:03 -0000 1.8 +++ m_pd.h 22 Feb 2006 05:41:08 -0000 @@ -17,15 +17,16 @@ #define MSW #endif -#ifdef MSW +/* These pragmas are only used for MSVC, not MinGW or Cygwin */ +#ifdef _MSC_VER /* #pragma warning( disable : 4091 ) */ #pragma warning( disable : 4305 ) /* uncast const double to float */ #pragma warning( disable : 4244 ) /* uncast float/int conversion etc. */ #pragma warning( disable : 4101 ) /* unused automatic variables */ -#endif /* MSW */ +#endif /* _MSC_VER */ /* the external storage class is "extern" in UNIX; in MSW it's ugly. */ -#ifdef MSW +#ifdef _WIN32 #ifdef PD_INTERNAL #define EXTERN __declspec(dllexport) extern #else @@ -33,7 +34,7 @@ #endif /* PD_INTERNAL */ #else #define EXTERN extern -#endif /* MSW */ +#endif /* _WIN32 */ /* and depending on the compiler, hidden data structures are declared differently: */ 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) @@ -77,16 +84,16 @@ pd-watchdog: $(BIN_DIR)/pd-watchdog $(BIN_DIR)/pd-watchdog: s_watchdog.c - $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c + $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c $(LIB) $(BIN_DIR)/pdsend: u_pdsend.c - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c $(LIB) $(BIN_DIR)/pdreceive: u_pdreceive.c - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c $(LIB) -$(PDEXEC): $(OBJ) - cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ +$(PDEXEC): $(OBJ) $(ASIOOBJ) + cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(ASIOOBJ) $(OBJ) \ $(LIB) $(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC) @@ -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@ @@ -144,8 +157,9 @@ chmod 644 $(MANINSTDIR)/man1/pdreceive.1.gz local-clean: - -rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \ - $(BIN_DIR)/pdreceive $(BIN_DIR)/pd-watchdog m_stamp.c + -rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend* \ + $(BIN_DIR)/pdreceive* $(BIN_DIR)/pd-watchdog* m_stamp.c \ + $(BIN_DIR)/pd.exe $(BIN_DIR)/pdtcl.* $(BIN_DIR)/pd.tk -rm -f `find ../portaudio ../portaudio_v18 -name "*.o"` -rm -f *~ -(cd ../doc/6.externs; rm -f *.pd_linux) Index: s_entry.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_entry.c,v retrieving revision 1.3 diff -u -w -r1.3 s_entry.c --- s_entry.c 11 Nov 2004 04:58:21 -0000 1.3 +++ s_entry.c 22 Feb 2006 05:41:08 -0000 @@ -3,7 +3,11 @@ int sys_main(int argc, char **argv); -#ifdef MSW +/* + * gcc does not support the __try stuff, only MSVC. Also, MinGW allows you to + * use main() instead of WinMain(). + */ +#ifdef _MSC_VER #include #include @@ -21,11 +25,11 @@ } } -#else /* not MSW */ +#else /* not _MSC_VER */ int main(int argc, char **argv) { return (sys_main(argc, argv)); } -#endif +#endif /* _MSC_VER */ 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 @@ -9,7 +9,7 @@ #include "s_stuff.h" #include "m_imp.h" #include "g_canvas.h" /* for GUI queueing stuff */ -#ifndef MSW +#ifndef _WIN32 #include #include #include @@ -23,16 +23,19 @@ #ifdef HAVE_BSTRING_H #include #endif -#ifdef MSW +#ifdef _WIN32 #include #include #include #include #include +# ifdef _MSC_VER typedef int pid_t; +# endif typedef int socklen_t; #define EADDRINUSE WSAEADDRINUSE #endif + #include #include #include @@ -100,7 +103,7 @@ /* ----------- functions for timing, signals, priorities, etc --------- */ -#ifdef MSW +#ifdef _WIN32 static LARGE_INTEGER nt_inittime; static double nt_freq = 0; @@ -129,13 +132,13 @@ return (((double)(dumbass->QuadPart - nt_inittime.QuadPart)) / nt_freq); } #endif -#endif /* MSW */ +#endif /* _WIN32 */ /* get "real time" in seconds; take the first time we get called as a reference time of zero. */ double sys_getrealtime(void) { -#ifndef MSW +#ifndef _WIN32 static struct timeval then; struct timeval now; gettimeofday(&now, 0); @@ -165,11 +168,11 @@ FD_ZERO(&exceptset); for (fp = sys_fdpoll, i = sys_nfdpoll; i--; fp++) FD_SET(fp->fdp_fd, &readset); -#ifdef MSW +#ifdef _WIN32 if (sys_maxfd == 0) Sleep(microsec/1000); else -#endif +#endif /* _WIN32 */ select(sys_maxfd+1, &readset, &writeset, &exceptset, &timout); for (i = 0; i < sys_nfdpoll; i++) if (FD_ISSET(sys_fdpoll[i].fdp_fd, &readset)) @@ -187,11 +190,11 @@ } else { -#ifdef MSW +#ifdef _WIN32 if (sys_maxfd == 0) Sleep(microsec/1000); else -#endif +#endif /* _WIN32 */ select(0, 0, 0, 0, &timout); return (0); } @@ -335,7 +338,7 @@ void sys_sockerror(char *s) { -#ifdef MSW +#ifdef _WIN32 int err = WSAGetLastError(); if (err == 10054) return; else if (err == 10044) @@ -346,7 +349,7 @@ } #else int err = errno; -#endif +#endif /* _WIN32 */ fprintf(stderr, "%s: %s (%d)\n", s, strerror(err), err); } @@ -549,9 +552,9 @@ #ifdef UNISTD close(fd); #endif -#ifdef MSW +#ifdef _WIN32 closesocket(fd); -#endif +#endif /* _WIN32 */ } /* ---------------------- sending messages to the GUI ------------------ */ @@ -856,10 +859,10 @@ int len = sizeof(server); int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; -#ifdef MSW +#ifdef _WIN32 short version = MAKEWORD(2, 0); WSADATA nobby; -#endif +#endif /* _WIN32 */ #ifdef UNISTD int stdinpipe[2]; #endif @@ -884,9 +887,9 @@ signal(SIGSTKFLT, sys_exithandler); #endif #endif -#ifdef MSW +#ifdef _WIN32 if (WSAStartup(version, &nobby)) sys_sockerror("WSAstartup"); -#endif +#endif /* _WIN32 */ if (sys_nogui) { @@ -894,10 +897,10 @@ skip starting the GUI up. */ t_atom zz[19]; int i; -#ifdef MSW +#ifdef _WIN32 if (GetCurrentDirectory(MAXPDSTRING, cmdbuf) == 0) strcpy(cmdbuf, "."); -#endif +#endif /* _WIN32 */ #ifdef UNISTD if (!getcwd(cmdbuf, MAXPDSTRING)) strcpy(cmdbuf, "."); @@ -944,16 +947,16 @@ } else /* default behavior: start up the GUI ourselves. */ { -#ifdef MSW +#ifdef _WIN32 char scriptbuf[MAXPDSTRING+30], wishbuf[MAXPDSTRING+30], portbuf[80]; int spawnret; -#endif -#ifdef MSW +#endif /* _WIN32 */ +#ifdef WIN32 char intarg; #else int intarg; -#endif +#endif /* _WIN32 */ /* create a socket */ xsock = socket(AF_INET, SOCK_STREAM, 0); @@ -971,9 +974,9 @@ intarg = 1; if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY, &intarg, sizeof(intarg)) < 0) -#ifndef MSW +#ifndef _WIN32 post("setsockopt (TCP_NODELAY) failed\n") -#endif +#endif /* not _WIN32 */ ; @@ -986,11 +989,11 @@ /* name the socket */ while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0) { -#ifdef MSW +#ifdef _WIN32 int err = WSAGetLastError(); #else int err = errno; -#endif +#endif /* _WIN32 */ if ((ntry++ > 20) || (err != EADDRINUSE)) { perror("bind"); @@ -1102,8 +1105,8 @@ } #endif /* UNISTD */ -#ifdef MSW - /* in MSW land "guipath" is unused; we just do everything from +#ifdef _WIN32 + /* in WIN32 land "guipath" is unused; we just do everything from the libdir. */ /* fprintf(stderr, "%s\n", sys_libdir->s_name); */ @@ -1126,7 +1129,7 @@ exit(1); } -#endif /* MSW */ +#endif /* _WIN32 */ } #if defined(__linux__) || defined(IRIX) @@ -1198,10 +1201,10 @@ seteuid(getuid()); /* lose setuid priveliges */ #endif /* __linux__ */ -#ifdef MSW +#ifdef _WIN32 if (!SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS)) fprintf(stderr, "pd: couldn't set high priority class\n"); -#endif +#endif /* _WIN32 */ #ifdef MACOSX if (sys_hipriority) { Index: s_watchdog.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_watchdog.c,v retrieving revision 1.2 diff -u -w -r1.2 s_watchdog.c --- s_watchdog.c 6 Sep 2004 20:20:36 -0000 1.2 +++ s_watchdog.c 22 Feb 2006 05:41:08 -0000 @@ -8,8 +8,13 @@ #include #include +#ifdef _WIN32 +#include +#include +#else #include #include +#endif /* _WIN32 */ #include int main(int argc, char **argv) @@ -41,7 +46,9 @@ else continue; } happy = 0; +#ifndef _WIN32 kill(getppid(), SIGHUP); +#endif /* _WIN32 */ fprintf(stderr, "watchdog: signaling pd...\n"); } } Index: t_tkcmd.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v retrieving revision 1.6 diff -u -w -r1.6 t_tkcmd.c --- t_tkcmd.c 15 Oct 2005 23:14:28 -0000 1.6 +++ t_tkcmd.c 22 Feb 2006 05:41:08 -0000 @@ -30,7 +30,7 @@ #include #include #endif -#ifdef MSW +#ifdef _MSC_VER #pragma warning( disable : 4305 ) /* uncast const double to float */ #pragma warning( disable : 4244 ) /* uncast double to float */ #pragma warning( disable : 4101 ) /* unused local variables */