I've found some hints in here:
http://lists.puredata.info/pipermail/pd-cvs/2004-10/001658.html
and it resolves many problems (Thanks to Thomas Grill), why those modifications have been removed?
I've built many modules but compilation has stopped with an error on s_midi.c, there are indefined references to "sys_putmidibyte" and other stuff from s_stuff.h, why s_stuff.h isn't included?
Here is the begining of s_midi.c I've modified:
#include "m_pd.h" #include "s_stuff.h" #include "m_imp.h" #if defined(UNISTD) || defined (_CYGWIN_) #include <unistd.h> #include <sys/time.h> #ifdef HAVE_BSTRING_H #include <bstring.h> #endif #endif #ifdef MSW #include <winsock.h> #include <sys/types.h> #include <sys/timeb.h> #include <wtypes.h> #endif #include <string.h> #include <stdio.h> #include <signal.h>
----snip----
and here is the begining of the successfully compiled s_file.c I've also modified:
#include "m_pd.h" #include "s_stuff.h" #include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #if defined(UNIX) || defined(__CYGWIN__) #include <sys/types.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #endif #ifdef MSW #include <windows.h> #include <tchar.h> #endif
int sys_defeatrt; t_symbol *sys_flags = &s_; void sys_doflags( void);
#if defined(UNIX) || defined(__CYGWIN__)
static char *sys_prefbuf;
---snip---
Thanks for any hint.
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff -uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
.hc
On Nov 29, 2007, at 6:13 PM, Patrice Colet wrote:
I've found some hints in here:
http://lists.puredata.info/pipermail/pd-cvs/2004-10/001658.html
and it resolves many problems (Thanks to Thomas Grill), why those modifications have been removed?
I've built many modules but compilation has stopped with an error on s_midi.c, there are indefined references to "sys_putmidibyte" and other stuff from s_stuff.h, why s_stuff.h isn't included?
Here is the begining of s_midi.c I've modified:
#include "m_pd.h" #include "s_stuff.h" #include "m_imp.h" #if defined(UNISTD) || defined (_CYGWIN_) #include <unistd.h> #include <sys/time.h> #ifdef HAVE_BSTRING_H #include <bstring.h> #endif #endif #ifdef MSW #include <winsock.h> #include <sys/types.h> #include <sys/timeb.h> #include <wtypes.h> #endif #include <string.h> #include <stdio.h> #include <signal.h>
----snip----
and here is the begining of the successfully compiled s_file.c I've also modified:
#include "m_pd.h" #include "s_stuff.h" #include <string.h> #include <stdlib.h> #include <stdio.h> #include <errno.h> #if defined(UNIX) || defined(__CYGWIN__) #include <sys/types.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #endif #ifdef MSW #include <windows.h> #include <tchar.h> #endif
int sys_defeatrt; t_symbol *sys_flags = &s_; void sys_doflags( void);
#if defined(UNIX) || defined(__CYGWIN__)
static char *sys_prefbuf;
---snip---
Thanks for any hint.
------------------------------------------------------------------------ ----
Terrorism is not an enemy. It cannot be defeated. It's a tactic. It's about as sensible to say we declare war on night attacks and expect we're going to win that war. We're not going to win the war on terrorism. - retired U.S. Army general, William Odom
Hans-Christoph Steiner a écrit :
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff -uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
Okay, let's start with these diff (I might have reversed the new and the old file, sorry for that, also I'll make separated diff files when make will run smoothly) and after that, there is my last error message (I didn't go further because s_inter.c seems linked to s_midi.c by the sys_close_midi() function, and I don't get how to deal with it) :
$ diff -uw d_osc.c d_osc.c.old --- d_osc.c 2007-12-01 06:02:38.218750000 +0100 +++ d_osc.c.old 2007-01-19 07:37:56.000000000 +0100 @@ -7,9 +7,7 @@
#include "m_pd.h" #include "math.h" -#ifdef __CYGWIN__ -#include <sys/param.h> -#endif + #define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
/* machine-dependent definitions. These ifdefs really @@ -21,7 +19,7 @@ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */
-#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<d_array.c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$ diff -uw d_array.c d_array.c.old --- d_array.c 2007-11-29 22:55:59.826500000 +0100 +++ d_array.c.old 2007-11-04 23:08:24.000000000 +0100 @@ -496,7 +496,6 @@
/******************** tabosc4~ ***********************/
-/* this is all copied from d_osc.c... what include file could this go in? */ #define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
/* machine-dependent definitions. These ifdefs really @@ -506,53 +505,38 @@ #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #define int32 long /* a data type that has 32 bits */ -#else -#if defined(MSW) || defined(__CYGWIN__) +#endif /* IRIX */ + +#ifdef MSW /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 #define int32 long -#else -#ifdef __FreeBSD__ +#endif + +#if defined(__FreeBSD__) || defined(__APPLE__) #include <machine/endian.h> -#if BYTE_ORDER == LITTLE_ENDIAN -#define HIOFFSET 1 -#define LOWOFFSET 0 -#else -#define HIOFFSET 0 /* word offset to find MSB */ -#define LOWOFFSET 1 /* word offset to find LSB */ -#endif /* BYTE_ORDER */ -#include <sys/types.h> -#define int32 int32_t #endif
#ifdef __linux__ #include <endian.h> -#if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN)
+#endif + +#if defined(__unix__) || defined(__APPLE__) +#if !defined(BYTE_ORDER) || !defined(LITTLE_ENDIAN) #error No byte order defined
#endif
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN #define HIOFFSET 1
#define LOWOFFSET 0
#else
#define HIOFFSET 0 /* word offset to find MSB */
#define LOWOFFSET 1 /* word offset to find LSB */
#endif /* __BYTE_ORDER */
- #include <sys/types.h> #define int32 int32_t - -#else -#ifdef MACOSX -#define HIOFFSET 0 /* word offset to find MSB */ -#define LOWOFFSET 1 /* word offset to find LSB */ -#define int32 int /* a data type that has 32 bits */ - -#endif /* MACOSX */ -#endif /* __linux__ */ -#endif /* MSW */ -#endif /* SGI */ +#endif /* __unix__ or __APPLE__*/
union tabfudge {
<<<<<<<<<<<<<<<<<<<<<< s_stuff.h
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$ diff -uw s_stuff.h s_stuff.h.old --- s_stuff.h 2007-11-30 00:39:16.404625000 +0100 +++ s_stuff.h.old 2007-11-04 23:08:24.000000000 +0100 @@ -181,7 +181,7 @@ #define API_DEFAULT API_OSS #define API_DEFSTRING "OSS" #endif -#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW #define API_DEFAULT API_MMIO #define API_DEFSTRING "MMIO" #endif @@ -201,7 +201,7 @@ #define DEFMIDIDEV 0
#define DEFAULTSRATE 44100 -#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW #define DEFAULTADVANCE 70 #else #define DEFAULTADVANCE 50
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< s_main.c >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
$ diff -uw s_main.c s_main.c.old --- s_main.c 2007-11-29 23:00:13.467125000 +0100 +++ s_main.c.old 2007-11-27 02:01:31.000000000 +0100 @@ -22,8 +22,6 @@ #include <winbase.h> #endif
- - char *pd_version; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; @@ -267,7 +265,7 @@ noprefs = 1; if (!noprefs) sys_loadpreferences(); /* load default settings */ -#if defined(MSW) || defined(__CYGWIN__) +#ifndef MSW sys_rcfile(); /* parse the startup file */ #endif if (sys_argparse(argc-1, argv+1)) /* parse cmd line */ @@ -347,7 +345,7 @@ #endif
#ifdef USEAPI_PORTAUDIO -#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW "-asio -- use ASIO audio driver (via Portaudio)\n", "-pa -- synonym for -asio\n", #else @@ -447,7 +445,6 @@ sbuf2[MAXPDSTRING-1] = 0; sys_unbashfilename(sbuf2, sbuf); #endif /* MSW */ - #ifdef UNISTD strncpy(sbuf, progname, MAXPDSTRING); sbuf[MAXPDSTRING-1] = 0; @@ -493,7 +490,7 @@ .../bin/wish80.exe .../doc */ -#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW sys_libdir = gensym(sbuf2); sys_guidir = &s_; /* in MSW the guipath just depends on the libdir */ #else @@ -647,7 +644,7 @@ #endif #ifdef USEAPI_PORTAUDIO else if (!strcmp(*argv, "-pa") || !strcmp(*argv, "-portaudio") -#if defined(MSW) || defined(__CYGWIN__) +#ifdef MSW || !strcmp(*argv, "-asio") #endif ) <<<<<<<<<<<<<<< end of diff >>>>>>>>>>>>>>>>
$ ./configure && make checking for gcc... gcc checking for C compiler default output file name... a.exe checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... .exe checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking how to run the C preprocessor... gcc -E checking for an ANSI C-conforming const... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for pid_t... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking bstring.h usability... no checking bstring.h presence... no checking for bstring.h... no checking whether gcc needs -traditional... no checking return type of signal handlers... void checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for select... yes checking for socket... yes checking for strerror... yes checking for working alloca.h... yes checking for alloca... yes checking for dlopen in -ldl... yes checking for sin in -lffm... no checking for sin in -lm... yes checking for pthread_create in -lpthread... no checking for pthread_create in -lpthreadGC2... yes checking tcl.h usability... yes checking tcl.h presence... yes checking for tcl.h... yes checking for main in -ltcl85... no checking for main in -ltcl8.5... no checking for main in -ltcl84... yes checking for main in -ltk85... no checking for main in -ltk8.5... no checking for main in -ltk84... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no configure: creating ./config.status config.status: creating makefile config.status: WARNING: makefile.in seems to ignore the --datarootdir setting cc -M g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c g_s calar.c g_traversal.c g_guiconnect.c g_readwrite.c g_editor.c g_all_guis.c g_ban g.c g_hdial.c g_hslider.c g_mycanvas.c g_numbox.c g_toggle.c g_vdial.c g_vslider .c g_vumeter.c m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c m_conf.c m_glob.c m_sched.c s_main.c s_inter.c s_file.c s_print.c s_loader.c s_path.c s_e ntry.c s_audio.c s_midi.c d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_d ac.c d_misc.c d_math.c d_fft.c d_array.c d_global.c d_delay.c d_resample.c x_ari thmetic.c x_connective.c x_interface.c x_midi.c x_misc.c x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c d_soundfile.c d_fft_mayer.c d_fftroutine.c > makefile.dependencies cd ../obj; cc -o ../bin/pd g_canvas.o g_graph.o g_text.o g_rtext.o g_array.o g_template.o g_io.o g_scalar.o g_traversal.o g_guiconnect.o g_readwrite.o g_edit or.o g_all_guis.o g_bang.o g_hdial.o g_hslider.o g_mycanvas.o g_numbox.o g_toggl e.o g_vdial.o g_vslider.o g_vumeter.o m_pd.o m_class.o m_obj.o m_atom.o m_memory .o m_binbuf.o m_conf.o m_glob.o m_sched.o s_main.o s_inter.o s_file.o s_print.o s_loader.o s_path.o s_entry.o s_audio.o s_midi.o d_ugen.o d_ctl.o d_arithmetic.o d_osc.o d_filter.o d_dac.o d_misc.o d_math.o d_fft.o d_array.o d_global.o d_del ay.o d_resample.o x_arithmetic.o x_connective.o x_interface.o x_midi.o x_misc.o x_time.o x_acoustics.o x_net.o x_qlist.o x_gui.o x_list.o d_soundfile.o d_fft_ma yer.o d_fftroutine.o \ -ldl -lm -lpthreadGC2 s_inter.o: dans la fonction << sys_bail >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_inter.c:1276: r'ef'erence ind'efinie vers << _sys_close_midi >> s_file.o: dans la fonction << sys_loadpreferences >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:292: r'ef'erence in d'efinie vers << _sys_initloadpreferences >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:294: r'ef'erence in d'efinie vers << _sys_getpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:297: r'ef'erence in d'efinie vers << _sys_getpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:305: r'ef'erence in d'efinie vers << _sys_getpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:315: r'ef'erence in d'efinie vers << _sys_getpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:332: r'ef'erence in d'efinie vers << _sys_getpreference >> s_file.o:/home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:334: encor e plus de r'ef'erences ind'efinies suivent vers << _sys_getpreference >> s_file.o: dans la fonction << glob_savepreferences >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:425: r'ef'erence in d'efinie vers << _sys_initsavepreferences >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:430: r'ef'erence in d'efinie vers << _sys_putpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:435: r'ef'erence in d'efinie vers << _sys_putpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:440: r'ef'erence in d'efinie vers << _sys_putpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:442: r'ef'erence in d'efinie vers << _sys_putpreference >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:447: r'ef'erence in d'efinie vers << _sys_putpreference >> s_file.o:/home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:451: encor e plus de r'ef'erences ind'efinies suivent vers << _sys_putpreference >> s_file.o: dans la fonction << glob_savepreferences >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:504: r'ef'erence in d'efinie vers << _sys_donesavepreferences >> s_midi.o: dans la fonction << sys_putnext >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:117: r'ef'erence in d'efinie vers << _sys_putmidibyte >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:118: r'ef'erence in d'efinie vers << _sys_putmidimess >> s_midi.o: dans la fonction << sys_pollmidiqueue >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:464: r'ef'erence in d'efinie vers << _sys_poll_midi >> s_midi.o: dans la fonction << sys_open_midi >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:539: r'ef'erence in d'efinie vers << _sys_do_open_midi >> s_midi.o: dans la fonction << sys_listmididevs >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:572: r'ef'erence in d'efinie vers << _midi_getdevs >> s_midi.o: dans la fonction << glob_midi_properties >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:653: r'ef'erence in d'efinie vers << _midi_getdevs >> s_midi.o: dans la fonction << glob_midi_setapi >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:619: r'ef'erence in d'efinie vers << _sys_close_midi >> s_midi.o: dans la fonction << glob_midi_dialog >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:746: r'ef'erence in d'efinie vers << _sys_close_midi >> s_midi.o: dans la fonction << glob_midi_setapi >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_midi.c:632: r'ef'erence in d'efinie vers << _sys_close_midi >> x_midi.o: dans la fonction << midiout_float >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/x_midi.c:677: r'ef'erence in d'efinie vers << _sys_putmidibyte >> collect2: ld a retourn'e 1 code d''etat d'ex'ecution make: *** [../bin/pd] Erreur 1
Patrice Colet wrote:
Hans-Christoph Steiner a écrit :
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff -uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
Okay, let's start with these diff (I might have reversed the new and the old file, sorry for that, also I'll make separated diff files when make will run smoothly) and after that, there is my last error message (I didn't go further because s_inter.c seems linked to s_midi.c by the sys_close_midi() function, and I don't get how to deal with it) :
$ diff -uw d_osc.c d_osc.c.old --- d_osc.c 2007-12-01 06:02:38.218750000 +0100 +++ d_osc.c.old 2007-01-19 07:37:56.000000000 +0100
Yes that's a backwards diff...
s_inter.o: dans la fonction << sys_bail >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_inter.c:1276: r'ef'erence ind'efinie vers << _sys_close_midi >>
sys_close_midi has several incarnations but you must choose one. The MSW version uses portmidi, so if you can build portmidi then use s_midi_pm.c by specifying it in the makefile.
s_file.o: dans la fonction << sys_loadpreferences >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:292: r'ef'erence in d'efinie vers << _sys_initloadpreferences >>
sys_initloadpreferences in s_file.c also has a version for each platform. The MSW version looks in the registry for preferences but the unix version just uses the .pdsettings preferences file. I would go for the unix version because I dislike the opaqueness of the registry.
Martin
On Dec 1, 2007, at 10:47 AM, Martin Peach wrote:
Patrice Colet wrote:
Hans-Christoph Steiner a écrit :
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff - uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
Okay, let's start with these diff (I might have reversed the new and the old file, sorry for that, also I'll make separated diff files when make will run smoothly) and after that, there is my last error message (I didn't go further because s_inter.c seems linked to s_midi.c by the sys_close_midi() function, and I don't get how to deal with it) :
$ diff -uw d_osc.c d_osc.c.old --- d_osc.c 2007-12-01 06:02:38.218750000 +0100 +++ d_osc.c.old 2007-01-19 07:37:56.000000000 +0100
Yes that's a backwards diff...
s_inter.o: dans la fonction << sys_bail >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_inter.c: 1276: r'ef'erence ind'efinie vers << _sys_close_midi >>
sys_close_midi has several incarnations but you must choose one. The MSW version uses portmidi, so if you can build portmidi then use s_midi_pm.c by specifying it in the makefile.
s_file.o: dans la fonction << sys_loadpreferences >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_file.c:292: r'ef'erence in d'efinie vers << _sys_initloadpreferences >>
sys_initloadpreferences in s_file.c also has a version for each platform. The MSW version looks in the registry for preferences but the unix version just uses the .pdsettings preferences file. I would go for the unix version because I dislike the opaqueness of the registry.
While the registry is annoying, it is the native Windows way of doing things. So I think it makes sense to use the registry as the default prefs store on any Windows build. That said, the .pdsettings file could be an additional option on Windows.
One, thing "_WIN32" is the preferred macro name for testing for Windows since it is defined automatically by all Windows compilers that I checked (Cygwin, MinGW, MSVC, etc.). "MSW" is a manually defined one that should go away.
.hc
------------------------------------------------------------------------ ----
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
Hans-Christoph Steiner a écrit :
One, thing "_WIN32" is the preferred macro name for testing for Windows since it is defined automatically by all Windows compilers that I checked (Cygwin, MinGW, MSVC, etc.). "MSW" is a manually defined one that should go away.
allright, I was wondering about this, that will eventually make things lighter and less cryptic.
.hc
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli
Is it known whether WIN32 will be automatically defined in 64-bit code on MS Windows?
cheers M
On Sat, Dec 01, 2007 at 10:15:16PM +0100, Patrice Colet wrote:
Hans-Christoph Steiner a ?crit :
One, thing "_WIN32" is the preferred macro name for testing for Windows since it is defined automatically by all Windows compilers that I checked (Cygwin, MinGW, MSVC, etc.). "MSW" is a manually defined one that should go away.
allright, I was wondering about this, that will eventually make things lighter and less cryptic.
.hc
Using ReBirth is like trying to play an 808 with a long stick. -David Zicarelli
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Miller Puckette a écrit :
Is it known whether WIN32 will be automatically defined in 64-bit code on MS Windows?
cheers M
Hello,
here is a kind of answer from MS:
http://msdn2.microsoft.com/en-us/library/aa489554.aspx
apparently using _WIN64 would even be better, if I'm not mistaken.
On Dec 1, 2007, at 6:00 PM, Patrice Colet wrote:
Miller Puckette a écrit :
Is it known whether WIN32 will be automatically defined in 64-bit code on MS Windows?
cheers M
Hello,
here is a kind of answer from MS:
http://msdn2.microsoft.com/en-us/library/aa489554.aspx
apparently using _WIN64 would even be better, if I'm not mistaken.
It says:
"_WIN32 A 32-bit platform. This value is also defined by the 64- bit compiler for backward compatibility."
Also, it's key to point out that the standard macro is NOT "WIN32", but rather "_WIN32". For whatever reason, the leading underscore is needed. Some compilers define WIN32 also, but it's not guaranteed. _WIN32 is the one that is defined everywhere (MSVC, MinGW, Cygwin, Borland, ICC).
.hc
------------------------------------------------------------------------ ----
You can't steal a gift. Bird gave the world his music, and if you can hear it, you can have it. - Dizzy Gillespie
Hans-Christoph Steiner wrote:
Also, it's key to point out that the standard macro is NOT "WIN32", but rather "_WIN32". For whatever reason, the leading underscore is needed.
the leading underscore denotes that this define is "private" by the preprocessor, and thus should NOT be defined manually by the user.
Some compilers define WIN32 also, but it's not guaranteed.
the reverse as above: since preprocessors automatically define names _with_ leading underscores, they "should rather not" define names without leading underscores.
_WIN32 is the one that is defined everywhere (MSVC, MinGW, Cygwin, Borland, ICC).
apart from that, i think it would be ok to use MSW (or any other self-defined word) if the _WIN32, WIN32 and __WIN32 magic is handled in a centralized way (e.g. m_pd.h)
fmga.sdr IOhannes
IOhannes m zmoelnig a écrit :
Hans-Christoph Steiner wrote:
Also, it's key to point out that the standard macro is NOT "WIN32", but rather "_WIN32". For whatever reason, the leading underscore is needed.
the leading underscore denotes that this define is "private" by the preprocessor, and thus should NOT be defined manually by the user.
Some compilers define WIN32 also, but it's not guaranteed.
the reverse as above: since preprocessors automatically define names _with_ leading underscores, they "should rather not" define names without leading underscores.
_WIN32 is the one that is defined everywhere (MSVC, MinGW, Cygwin, Borland, ICC).
apart from that, i think it would be ok to use MSW (or any other self-defined word) if the _WIN32, WIN32 and __WIN32 magic is handled in a centralized way (e.g. m_pd.h)
fmga.sdr IOhannes
Hello, I'm on the last stages of building, it's a matter just of resolving pdtcl.dll enigma, changing some code for ignoring watchdog, and linking wsock32 (I hope it's just that) to pdsend & pdreceive, and I guess it's almost done... Also I've replaced MSW with _WIN32 in source files, but maybe it was not necessary because with the -mno-cygwin flag the compiler reconize MSW as well. Patko
On Dec 3, 2007, at 8:14 AM, Patrice Colet wrote:
IOhannes m zmoelnig a écrit :
Hans-Christoph Steiner wrote:
Also, it's key to point out that the standard macro is NOT "WIN32", but rather "_WIN32". For whatever reason, the leading underscore is needed.
the leading underscore denotes that this define is "private" by the preprocessor, and thus should NOT be defined manually by the user. Some compilers define WIN32 also, but it's not guaranteed. the reverse as above: since preprocessors automatically define names _with_ leading underscores, they "should rather not" define names without leading underscores.
_WIN32 is the one that is defined everywhere (MSVC, MinGW, Cygwin, Borland, ICC).
apart from that, i think it would be ok to use MSW (or any other self-defined word) if the _WIN32, WIN32 and __WIN32 magic is handled in a centralized way (e.g. m_pd.h) fmga.sdr IOhannes
Hello, I'm on the last stages of building, it's a matter just of resolving pdtcl.dll enigma, changing some code for ignoring watchdog, and linking wsock32 (I hope it's just that) to pdsend & pdreceive, and I guess it's almost done... Also I've replaced MSW with _WIN32 in source files, but maybe it was not necessary because with the -mno-cygwin flag the compiler reconize MSW as well. Patko
MSW is manually defined in the makefile.mingw, so that's why it's recognized.
.hc
------------------------------------------------------------------------ ----
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
On Dec 3, 2007, at 4:00 AM, IOhannes m zmoelnig wrote:
Hans-Christoph Steiner wrote:
Also, it's key to point out that the standard macro is NOT "WIN32", but rather "_WIN32". For whatever reason, the leading underscore is needed.
the leading underscore denotes that this define is "private" by the preprocessor, and thus should NOT be defined manually by the user.
Some compilers define WIN32 also, but it's not guaranteed.
the reverse as above: since preprocessors automatically define names _with_ leading underscores, they "should rather not" define names without leading underscores.
_WIN32 is the one that is defined everywhere (MSVC, MinGW, Cygwin, Borland, ICC).
apart from that, i think it would be ok to use MSW (or any other self-defined word) if the _WIN32, WIN32 and __WIN32 magic is handled in a centralized way (e.g. m_pd.h)
Why add something different if _WIN32 already exists and is automatically defined by all the compilers we use?
.hc
------------------------------------------------------------------------ ----
I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers. - General Smedley Butler
Hans-Christoph Steiner wrote:
Why add something different if _WIN32 already exists and is automatically defined by all the compilers we use?
to not have to change code throughout everything?
i totally agree that one should rather use _WIN32 than MSW (or whatever), that is why i have been using it in my code for years.
btw, there seems to be some obfuscation with the _WIN32, since i have seen _a lot_ of projects that perfectly well use "__linux__" but fail to use "_WIN32". these projects are not limited to w32-ports of linux code. it is probably because _WIN32 is one of the worst documented automagic macros... so it is not only pd-code that uses hacks to find out whether it is actually compiled for w32.
furthermore, having _WIN32 defined on w64 is an _ugly_ hack on micro$oft's side, there is no need to support that. MSW (if it is kept) could/should be defined for both w32 and w64, and it should be automatically defined (that is: not within the makefile but within a central place, like m_pd.h)
mfga.sdr IOhannes
IOhannes m zmoelnig a écrit :
Hans-Christoph Steiner wrote:
Why add something different if _WIN32 already exists and is automatically defined by all the compilers we use?
to not have to change code throughout everything?
i totally agree that one should rather use _WIN32 than MSW (or whatever), that is why i have been using it in my code for years.
btw, there seems to be some obfuscation with the _WIN32, since i have seen _a lot_ of projects that perfectly well use "__linux__" but fail to use "_WIN32". these projects are not limited to w32-ports of linux code. it is probably because _WIN32 is one of the worst documented automagic macros... so it is not only pd-code that uses hacks to find out whether it is actually compiled for w32.
furthermore, having _WIN32 defined on w64 is an _ugly_ hack on micro$oft's side, there is no need to support that. MSW (if it is kept) could/should be defined for both w32 and w64, and it should be automatically defined (that is: not within the makefile but within a central place, like m_pd.h)
mfga.sdr IOhannes
Good, then the source wouldn't need to be modified at all for -mno-cygwin.
furthermore, having _WIN32 defined on w64 is an _ugly_ hack on micro$oft's side, there is no need to support that. MSW (if it is kept) could/should be defined for both w32 and w64, and it should be automatically defined (that is: not within the makefile but within a central place, like m_pd.h)
mfga.sdr IOhannes
but how could m_pd.h determine its platform without help from the makefile? Especially since there seems to be no guarantee about future presence of macros like _WIN32?
I personally would also prefer to avoid using __linux__ and other such "dark" defines in favor of having the build system take care of figuring the platform out. Unfortunately, I haven't been consistent myself about this (grep #if *.c | fgrep __ | wc returns 40).
cheers Miller
On Dec 4, 2007, at 11:36 AM, Miller Puckette wrote:
furthermore, having _WIN32 defined on w64 is an _ugly_ hack on micro$oft's side, there is no need to support that. MSW (if it is kept) could/should be defined for both w32 and w64, and it should be automatically defined (that is: not within the makefile but within a central place, like m_pd.h)
mfga.sdr IOhannes
but how could m_pd.h determine its platform without help from the makefile? Especially since there seems to be no guarantee about future presence of macros like _WIN32?
There is as much a guarantee that _WIN32 will exist as Windows itself will exist. It is used in Cygwin, MySQL, gcc, etc. For example, _WIN32 has been in gcc since at least '97:
http://gcc.gnu.org/ml/gcc-bugs/1997-12/msg00401.html
I personally would also prefer to avoid using __linux__ and other such "dark" defines in favor of having the build system take care of figuring the platform out. Unfortunately, I haven't been consistent myself about this (grep #if *.c | fgrep __ | wc returns 40).
Using automatic defines like __APPLE__, _WIN32, and __linux__ are the standard practice for basically all coding environments. The make code more readable since you only need to remember the one macro and don't have to learn each person's custom macros. And worst comes to worst, and they somehow vanish, you can just do a -D_WIN32 as easily as you can do a -DMSW.
But really, what should be happening is less reliance on these OS macros throughout the code, and instead using the autoconf HAVE_ENDIAN_H style macros. In the code, it rarely matters what platform it is, the real issue is usually whether a specific feature or header exists.
.hc
------------------------------------------------------------------------ ----
'You people have such restrictive dress for women,’ she said, hobbling away in three inch heels and panty hose to finish out another pink-collar temp pool day. - “Hijab Scene #2", by Mohja Kahf
On Dec 4, 2007, at 3:12 AM, IOhannes m zmoelnig wrote:
Hans-Christoph Steiner wrote:
Why add something different if _WIN32 already exists and is automatically defined by all the compilers we use?
to not have to change code throughout everything?
i totally agree that one should rather use _WIN32 than MSW (or whatever), that is why i have been using it in my code for years.
btw, there seems to be some obfuscation with the _WIN32, since i have seen _a lot_ of projects that perfectly well use "__linux__" but fail to use "_WIN32". these projects are not limited to w32- ports of linux code. it is probably because _WIN32 is one of the worst documented automagic macros... so it is not only pd-code that uses hacks to find out whether it is actually compiled for w32.
furthermore, having _WIN32 defined on w64 is an _ugly_ hack on micro $oft's side, there is no need to support that. MSW (if it is kept) could/should be defined for both w32 and w64, and it should be automatically defined (that is: not within the makefile but within a central place, like m_pd.h)
There is lots of Windows stuff that is ugly hacks, I don't think it is wise in the long run to pick and choose which ones to support and not. The best plan on all platforms is to follow the standard guidelines for how to do such things. That way there is a large, existing body of people who know about them, those methods are documented, etc. Doing custom things means it's undocumented and basically only one or two people know about them.
AFAIK, that means using _WIN32, that means using the registry.
.hc
------------------------------------------------------------------------ ----
You can't steal a gift. Bird gave the world his music, and if you can hear it, you can have it. - Dizzy Gillespie
What a joke!
m_pd.h line 30:
"the external storage class is "extern" in UNIX; in __WIN32 it's ugly"
compilation error:
g_canvas.c:58: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:59: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:574: attention : << canvas_makebindsym >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport.
Hello!
I've added -mno-cygwin and -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib because:
1° The __WIN32 flag doesn't work with cygwin 2° there is a cruel conflict with errno.h cygwin version.
So it's not possible to compile with cygwin without mingw, unless using voodoo...
Also the dllwrap doesn't seem to work good with cygwin, because the built pd.exe is linked to cygwin1.dll (with using cygwin only), else, I suspect that it causes many other errors, see an example of error it might cause below (after the diffs), I just suppose that we can't use both a def file (see dllwrap) and dll<import/export> (see m_pd.h), obviously I might be wrong (it won't be surprising).
===================================================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-03 00:04:37.578125000 +0100 @@ -341,7 +341,7 @@ if test `uname -s` == MINGW32_NT-5.0; then EXT=dll - MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -DPD_INTERNAL \ + MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -368,6 +368,49 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1; +then + EXT=dll + MORECFLAGS="-mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 \ + -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \ + -I../portaudio/pa_common -I../portaudio/pablio \ + -I../portaudio/pa_asio \ + -I../portmidi/pm_common -I../portmidi/porttime \ + -I../portmidi/pm_win -I../portmidi/pm_win_ds \ + -mms-bitfields "$MORECFLAGS + + PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" + + SYSSRC="s_midi_pm.c \ + s_audio_pa.c s_audio_pablio.c s_audio_paring.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 \ + ../portaudio/pa_win_ds/pa_win_ds.c \ + ../portaudio/pa_win_ds/dsound_wrapper.c \ + ../portmidi/pm_common/pmutil.c \ + ../portmidi/pm_common/portmidi.c \ + ../portmidi/pm_win/pmdll.c \ + ../portmidi/pm_win/pmwin.c \ + ../portmidi/pm_win/pmwinmm.c \ + ../portmidi/porttime/ptwinmm.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";
==================================================================== $ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-03 00:54:34.750000000 +0100 @@ -12,6 +12,10 @@ EXT= @EXT@ GUINAME= @GUINAME@
+PDEXEC_WIN = pd.exe +GUINAME_WIN = pdtcl.dll +DLLWRAP= dllwrap + prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -49,6 +53,8 @@
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 \ @@ -147,9 +153,15 @@
@executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?) +# this is for cygwin +#$(BIN_DIR)/pdtcl.dll: $(GOBJ) +# cd $(BIN_DIR); echo EXPORTS > pdtcl.def +# nm pdtcl.dll | grep ' T _' | sed 's/.* T _//' >> pdtcl.def +# dlltool --def pdtcl.def --dllname pdtcl.dll --output-lib pdtcl.a + +# this is for mingw $(BIN_DIR)/pdtcl.dll: $(GOBJ) - cd $(BIN_DIR); dllwrap --export-all-symbols --output-def pdtcl.def \ + dllwrap --export-all-symbol --output-def pdtcl.def \ --output-lib=pdtcl.a --dllname=$(GUINAME) $(OBJ_DIR)/t_tkcmd.o $(LIB) $( GLIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
@@ -203,17 +215,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~ - -(cd ../doc/6.externs; rm -f *.pd_linux) + -(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"` + -rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +242,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile - $(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies + $(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
=======================================================================
$ diff -uw d_array.c.old d_array.c --- d_array.c.old 2007-11-04 23:08:24.000000000 +0100 +++ d_array.c 2007-12-03 00:31:56.453125000 +0100 @@ -507,7 +507,7 @@ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */
-#ifdef MSW +#ifdef __WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 ===================================================================== $ diff -uw d_osc.c.old d_osc.c --- d_osc.c.old 2007-01-19 07:37:56.000000000 +0100 +++ d_osc.c 2007-12-02 22:05:43.343750000 +0100 @@ -7,7 +7,6 @@
#include "m_pd.h" #include "math.h" - #define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
/* machine-dependent definitions. These ifdefs really @@ -19,7 +18,7 @@ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */
-#ifdef MSW +#ifdef __WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 ====================================================================== $ diff -uw g_canvas.c.old g_canvas.c --- g_canvas.c.old 2007-12-02 22:49:55.265625000 +0100 +++ g_canvas.c 2007-12-02 22:50:44.156250000 +0100 @@ -757,7 +757,7 @@ /* test if we're already visible and toplevel */ if (x->gl_editor) { /* just put us in front */ -#ifdef MSW +#ifdef __WIN32 canvas_vis(x, 0); canvas_vis(x, 1); #else ==================================================================== $ diff -uw m_binbuf.c.old m_binbuf.c --- m_binbuf.c.old 2007-12-02 22:27:03.531250000 +0100 +++ m_binbuf.c 2007-12-02 22:27:44.453125000 +0100 @@ -10,7 +10,7 @@ #ifdef UNISTD #include <unistd.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <io.h> #endif #include <fcntl.h> @@ -697,7 +697,7 @@ static int binbuf_doopen(char *s, int mode) { char namebuf[MAXPDSTRING]; -#ifdef MSW +#ifdef __WIN32 mode |= O_BINARY; #endif sys_bashfilename(s, namebuf); ================================================================== $ diff -uw m_glob.c.old m_glob.c --- m_glob.c.old 2007-12-01 20:36:16.671875000 +0100 +++ m_glob.c 2007-12-01 22:32:12.468750000 +0100 @@ -35,7 +35,7 @@ void alsa_resync( void);
-#ifdef MSW +#ifdef _WIN32 void glob_audio(void *dummy, t_floatarg adc, t_floatarg dac); #endif =================================================================== $ diff -uw m_pd.h.old m_pd.h --- m_pd.h.old 2007-12-02 22:43:07.109375000 +0100 +++ m_pd.h 2007-12-03 00:02:57.578125000 +0100 @@ -13,10 +13,10 @@ #define PD_BUGFIX_VERSION 3 #define PD_TEST_VERSION "extended-20071104"
-/* old name for "MSW" flag -- we have to take it for the sake of many old -"nmakefiles" for externs, which will define NT and not MSW */ -#if defined(NT) && !defined(MSW) -#define MSW +/* old name for "__WIN32" flag -- we have to take it for the sake of many old +"nmakefiles" for externs, which will define NT and not __WIN32 */ +#if defined(NT) && !defined(__WIN32) +#define __WIN32 #endif
/* These pragmas are only used for MSVC, not MinGW or Cygwin hans@at.or.at */
@@ -27,8 +27,8 @@ #pragma warning( disable : 4101 ) /* unused automatic variables */ #endif /* _MSC_VER */
- /* the external storage class is "extern" in UNIX; in MSW it's ugly. */ -#ifdef MSW + /* the external storage class is "extern" in UNIX; in __WIN32 it's ugly. */
+#ifdef __WIN32 #ifdef PD_INTERNAL #define EXTERN __declspec(dllexport) extern #else @@ -36,7 +36,7 @@ #endif /* PD_INTERNAL */ #else #define EXTERN extern -#endif /* MSW */ +#endif /* __WIN32 */
/* and depending on the compiler, hidden data structures are declared differently: */ ====================================================================== $ diff -uw s_stuff.h.old s_stuff.h --- s_stuff.h.old 2007-11-04 23:08:24.000000000 +0100 +++ s_stuff.h 2007-12-02 22:34:13.375000000 +0100 @@ -181,7 +181,7 @@ #define API_DEFAULT API_OSS #define API_DEFSTRING "OSS" #endif -#ifdef MSW +#ifdef __WIN32 #define API_DEFAULT API_MMIO #define API_DEFSTRING "MMIO" #endif @@ -201,7 +201,7 @@ #define DEFMIDIDEV 0
#define DEFAULTSRATE 44100 -#ifdef MSW +#ifdef __WIN32 #define DEFAULTADVANCE 70 #else #define DEFAULTADVANCE 50 @@ -282,8 +282,8 @@ typedef void (*t_printhook)(const char *s); extern t_printhook sys_printhook; /* set this to override printing */ extern int sys_printtostderr; -#ifdef MSW -#define vsnprintf _vsnprintf /* jsarlo -- alias this name for msw */ +#ifdef __WIN32 +#define vsnprintf _vsnprintf /* jsarlo -- alias this name for __WIN32 */ #endif
/* jsarlo { */ ======================================================================== $ diff -uw t_tkcmd.c.old t_tkcmd.c --- t_tkcmd.c.old 2007-12-02 03:11:59.500000000 +0100 +++ t_tkcmd.c 2007-12-03 00:52:53.640625000 +0100 @@ -2,7 +2,7 @@ * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-#ifndef MSW /* in unix this only works first; in MSW it only works last. */
+#ifndef __WIN32 /* in unix this only works first; in __WIN32 it only works last. */ #include "tk.h" #endif
@@ -13,7 +13,7 @@ #include <stdarg.h> #include <sys/types.h>
-#ifndef MSW +#ifndef __WIN32 #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> @@ -26,7 +26,7 @@ #include <errno.h> #include <fcntl.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <winsock.h> #include <io.h> #endif @@ -38,7 +38,7 @@ #pragma warning( disable : 4101 ) /* unused local variables */ #endif
-#ifdef MSW +#ifdef __WIN32 #include "tk.h" #endif
@@ -87,10 +87,10 @@
static void pdgui_sockerror(char *s) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); #endif -#ifndef MSW +#ifndef __WIN32 int err = errno; #endif
@@ -229,7 +229,7 @@ } }
-#ifdef MSW +#ifdef __WIN32 /* if we're in Gatesland, we add a tcl command to poll the socket for data. */ static int pd_pollsocketCmd(ClientData cd, Tcl_Interp *interp, @@ -242,7 +242,7 @@
static void pd_sockerror(char *s) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); if (err == 10054) return; else if (err == 10044) @@ -261,12 +261,12 @@ { struct sockaddr_in server; struct hostent *hp; -#ifndef MSW +#ifndef __WIN32 int retry = 10; #else int retry = 1; #endif -#ifdef MSW +#ifdef __WIN32 short version = MAKEWORD(2, 0); WSADATA nobby;
@@ -307,7 +307,7 @@ retry. */ else { -#ifndef MSW +#ifndef __WIN32 fd_set readset, writeset, exceptset; struct timeval timout;
@@ -319,16 +319,16 @@ fprintf(stderr, "retrying connect...\n"); if (select(1, &readset, &writeset, &exceptset, &timout) < 0) perror("select"); -#endif /* !MSW */ +#endif /* !__WIN32 */ } } pdgui_sockerror("connecting stream socket"); gotit: ; -#ifndef MSW - /* normally we ask TK to call us back; but in MSW we have to poll. */ +#ifndef __WIN32 + /* normally we ask TK to call us back; but in __WIN32 we have to poll. */ Tk_CreateFileHandler(sockfd, TK_READABLE | TK_EXCEPTION, pd_readsocket, 0); -#endif /* !MSW */ +#endif /* !__WIN32 */ }
#ifdef STARTGUI @@ -351,7 +351,7 @@ int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; char morebuf[256]; -#ifdef MSW +#ifdef __WIN32 short version = MAKEWORD(2, 0); WSADATA nobby; char scriptbuf[1000], wishbuf[1000], portbuf[80]; @@ -376,7 +376,7 @@ fprintf(stderr, "pdbuf is %s\n", pdbuf); #endif
-#ifdef MSW +#ifdef __WIN32 if (WSAStartup(version, &nobby)) pd_sockerror("WSAstartup"); #endif @@ -398,7 +398,7 @@ /* name the socket */ while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); #else int err = errno; @@ -440,7 +440,7 @@ } #endif /* UNISTD */
-#ifdef MSW +#ifdef __WIN32
#error not yet used.... sys_bashfilename() not filled in here
@@ -458,7 +458,7 @@ return; }
-#endif /* MSW */ +#endif /* __WIN32 */
#ifdef DEBUGCONNECT fprintf(stderr, "Waiting for connection request... \n"); @@ -470,18 +470,18 @@ fprintf(stderr, "... connected\n"); #endif
-#ifndef MSW - /* normally we ask TK to call us back; but in MSW we have to poll. */ +#ifndef __WIN32 + /* normally we ask TK to call us back; but in __WIN32 we have to poll. */ Tk_CreateFileHandler(sockfd, TK_READABLE | TK_EXCEPTION, pd_readsocket, 0); -#endif /* !MSW */ +#endif /* !__WIN32 */ }
#endif /* STARTGUI */
static void pdgui_setupsocket(void) { -#ifdef MSW +#ifdef __WIN32 pdgui_connecttosocket(); #else if (pd_portno) @@ -545,10 +545,10 @@ } }
- /* in linux, we load the tk code from here (in MSW and MACOS, this + /* in linux, we load the tk code from here (in __WIN32 and MACOS, this is done by passing the name of the file as a startup argument to the wish shell.) */ -#if !defined(MSW) && !defined(__APPLE__) +#if !defined(__WIN32) && !defined(__APPLE__) void pdgui_doevalfile(Tcl_Interp *interp, char *s) { char buf[GUISTRING]; @@ -580,18 +580,18 @@ /* add our own TK commands */ Tcl_CreateCommand(interp, "pd", (Tcl_CmdProc*)pdCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); -#ifdef MSW +#ifdef __WIN32 Tcl_CreateCommand(interp, "pd_pollsocket",(Tcl_CmdProc*) pd_pollsocketCmd,
(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); #endif pdgui_setupsocket(); /* read in the startup file */ -#if !defined(MSW) && !defined(__APPLE__) +#if !defined(__WIN32) && !defined(__APPLE__) pdgui_evalfile("pd.tk"); #endif }
-#ifndef MSW +#ifndef __WIN32 void pdgui_setname(char *s) { char *t; @@ -619,11 +619,11 @@ { const char *argv = Tcl_GetVar(interp, "argv", 0); int portno, argno = 0; - /* argument passing seems to be different in MSW as opposed to + /* argument passing seems to be different in __WIN32 as opposed to unix-likes. Here we check if we got sent a "port number" as an argument. If so. we're to connect to a previously running pd (i.e., pd got started first). If not, we start Pd from here. */ -#ifdef MSW +#ifdef __WIN32 if (argv && (portno = atoi(argv)) > 1) #else char *firstspace; ==================================================================== $ diff -uw x_list.c.old x_list.c --- x_list.c.old 2007-12-02 21:47:52.312500000 +0100 +++ x_list.c 2007-12-02 21:47:16.187500000 +0100 @@ -4,7 +4,7 @@
#include "m_pd.h" /* #include <string.h> */ -#ifdef MSW +#ifdef __WIN32 #include <malloc.h> #else #include <alloca.h> ======================================================================= $ diff -uw x_net.c.old x_net.c --- x_net.c.old 2007-12-02 21:37:51.468750000 +0100 +++ x_net.c 2007-12-02 21:45:07.453125000 +0100 @@ -9,7 +9,7 @@
#include <sys/types.h> #include <string.h> -#ifdef MSW +#ifdef __WIN32 #include <winsock.h> #else #include <sys/socket.h> ============================================================= $ diff -uw x_qlist.c.old x_qlist.c --- x_qlist.c.old 2007-12-02 21:48:07.875000000 +0100 +++ x_qlist.c 2007-12-02 21:45:46.921875000 +0100 @@ -7,7 +7,7 @@ #ifdef UNISTD #include <unistd.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <io.h> #endif ===========================================================
$ make distclean && autoconf && ./configure && make rm -f `find ../extra/ -name "*.pd_*"` rm -f tags rm -f ../obj/* ../bin/pd ../bin/pdtcl.dll ../bin/pdsend \ ../bin/pdreceive ../bin/pd-watchdog m_stamp.c rm: ne peut enlever `../obj/CVS': Is a directory make: [local-clean] Erreur 1 (ignor'ee) rm -f `find ../portaudio -name "*.o"` rm -f *~ (cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies rm -f config.cache config.log config.status makefile tags \ autom4te.cache/output.* autom4te.cache/traces.* autom4te.cache/r equests rmdir autom4te.cache rm -rf autom4te-*.cache checking for gcc... gcc checking for C compiler default output file name... a.exe checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... .exe checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking how to run the C preprocessor... gcc -E checking for an ANSI C-conforming const... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for pid_t... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking bstring.h usability... no checking bstring.h presence... no checking for bstring.h... no checking whether gcc needs -traditional... no checking return type of signal handlers... void checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for select... yes checking for socket... yes checking for strerror... yes checking for working alloca.h... yes checking for alloca... yes checking for dlopen in -ldl... yes checking for sin in -lffm... no checking for sin in -lm... yes checking for pthread_create in -lpthread... no checking for pthread_create in -lpthreadGC2... yes checking tcl.h usability... yes checking tcl.h presence... yes checking for tcl.h... yes checking for main in -ltcl85... no checking for main in -ltcl8.5... no checking for main in -ltcl84... yes checking for main in -ltk85... no checking for main in -ltk8.5... no checking for main in -ltk84... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no configure: creating ./config.status config.status: creating makefile config.status: WARNING: makefile.in seems to ignore the --datarootdir setting cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-s witch -mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -I/cygdr ive/c/Mingw/include -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../po rtaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm_common -I../portmidi/po rttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms-bitfields -M g_ca nvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c g_scalar.c g_t raversal.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 g_toggle.c g_vdial.c g_vslider.c g_vumete r.c m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c m_conf.c m_glob.c m_ sched.c s_main.c s_inter.c s_file.c s_print.c s_loader.c s_path.c s_entry.c s_au dio.c s_midi.c d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc .c d_math.c d_fft.c d_array.c d_global.c d_delay.c d_resample.c x_arithmetic.c x _connective.c x_interface.c x_midi.c x_misc.c x_time.c x_acoustics.c x_net.c x_q list.c x_gui.c x_list.c d_soundfile.c s_midi_pm.c s_audio_pa.c s_audio_pab lio.c s_audio_paring.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_c ommon/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_w in/pa_win_util.c ../portaudio/pa_win/pa_win_hostapis.c . ./portaudio/pa_win_wmme/pa_win_wmme.c ../portaudio/pa_win_ds/pa_win_ds. c ../portaudio/pa_win_ds/dsound_wrapper.c ../p ortmidi/pm_common/pmutil.c ../portmidi/pm_common/portmidi.c ../portmidi/pm_win/pmdll.c ../portmidi/pm_win/p mwin.c ../portmidi/pm_win/pmwinmm.c ../p ortmidi/porttime/ptwinmm.c d_fft_mayer.c d_fftroutine.c > makefile.dependencies cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-s witch -mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -I/cygdr ive/c/Mingw/include -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../po rtaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm_common -I../portmidi/po rttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms-bitfields -DINSTA LL_PREFIX="/usr/local" -c -o ../obj/g_canvas.o g_canvas.c g_canvas.c:58: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:59: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:574: attention : << canvas_makebindsym >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:677: attention : << canvas_redraw >> d'efini localement apr`es avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:749: attention : << canvas_vis >> d'efini localement apr`es avoir 'et 'e r'ef'erenc'e avec lien dllimport. g_canvas.c:847: attention : << glist_isvisible >> d'efini localement apr`es avoi r 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:852: attention : << glist_istoplevel >> d'efini localement apr`es avo ir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1043: attention : << canvas_loadbang >> d'efini localement apr`es avo ir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1221: attention : << canvas_isabstraction >> d'efini localement apr`e s avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1252: attention : << canvas_getrootfor >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1344: attention : << canvas_suspend_dsp >> d'efini localement apr`es avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1351: attention : << canvas_resume_dsp >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. make: *** [g_canvas.o] Erreur 1
==========================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Let the sun be with you, Patko.
Patrice Colet wrote:
Hello!
I've added -mno-cygwin and -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib because:
1° The __WIN32 flag doesn't work with cygwin 2° there is a cruel conflict with errno.h cygwin version.
So it's not possible to compile with cygwin without mingw, unless using voodoo...
Well it seems like the Windows API that mingw provides is essential for the audio and midi interfaces, unless you have a precompiled portmidi and portaudio. The rest could be done in cygwin's pseudo-unix, probably not GEM though. I think if there was a tcl/tk for cygwin it would be even more compatible with the unix version. ...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-s witch -mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -I/cygdr ive/c/Mingw/include -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../po rtaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm_common -I../portmidi/po rttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms-bitfields -DINSTA LL_PREFIX="/usr/local" -c -o ../obj/g_canvas.o g_canvas.c g_canvas.c:58: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:59: erreur: un 'el'ement de l'initialisation n'est pas une constante
Line 58: static t_symbol *canvas_newfilename = &s_;
Probably the compiler doesn't like this because _s is declared EXTERN which is configured for MSW instead of just extern.
g_canvas.c:574: attention : << canvas_makebindsym >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport.
It was prototyped in g_canvas.h as EXTERN t_symbol *canvas_makebindsym(t_symbol *s); In m_pd.h EXTERN is defined as: #ifdef MSW #ifdef PD_INTERNAL #define EXTERN __declspec(dllexport) extern #else #define EXTERN __declspec(dllimport) extern #endif /* PD_INTERNAL */ #else #define EXTERN extern #endif /* MSW */ so you probably need to avoid using MSW here for cygwin because the __declspec stuff only works with MSVC. The extern things must be accessible from outside the pd dll so you need to export the symbols somehow. ...
==========================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Oh, too bad... I tried it a couple years ago as well and didn't get it to work either, but I learned a lot about the insides of pd;).
Martin
Martin Peach a écrit :
Patrice Colet wrote:
Hello!
I've added -mno-cygwin and -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib because:
1° The __WIN32 flag doesn't work with cygwin 2° there is a cruel conflict with errno.h cygwin version.
So it's not possible to compile with cygwin without mingw, unless using voodoo...
Well it seems like the Windows API that mingw provides is essential for the audio and midi interfaces, unless you have a precompiled portmidi and portaudio. The rest could be done in cygwin's pseudo-unix, probably not GEM though. I think if there was a tcl/tk for cygwin it would be even more compatible with the unix version.
I'm trying right now the voodoo solution, because magiks are so interesting...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-s witch -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -DPD_INTERNAL -I../por taudio/pa_common -I../portaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm _common -I../portmidi/porttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms-bitfields -M 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 g_toggle.c g_vdia l.c g_vslider.c g_vumeter.c m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbu f.c m_conf.c m_glob.c m_sched.c s_main.c s_inter.c s_file.c s_print.c s_loader.c s_path.c s_entry.c s_audio.c s_midi.c d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d _filter.c d_dac.c d_misc.c d_math.c d_fft.c d_array.c d_global.c d_delay.c d_res ample.c x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c x_time.c x _acoustics.c x_net.c x_qlist.c x_gui.c x_list.c d_soundfile.c s_midi_pm.c s _audio_pa.c s_audio_pablio.c s_audio_paring.c ../portaudio/pa_common/pa_ allocation.c ../portaudio/pa_common/pa_converters.c ../portaud io/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 ../portaud io/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 ../portaud io/pa_win_ds/pa_win_ds.c ../portaudio/pa_win_ds/dsound_wrapper.c ../portmidi/pm_common/pmutil.c ../portmidi/ pm_common/portmidi.c ../portmidi/pm_win/pmdll.c ../portmidi/pm_win/pmwin.c ../portmidi/pm_win/pmwinmm.c ../portmidi/porttime/ptwinmm.c d_fft_mayer.c d_fftroutine.c
makefile.dependencies
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -Wno-s witch -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -DPD_INTERNAL -I../por taudio/pa_common -I../portaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm _common -I../portmidi/porttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms-bitfields -DINSTALL_PREFIX="/usr/local" -c -o ../obj/m_binbuf.o m_binb uf.c m_binbuf.c: In function `binbuf_read': m_binbuf.c:733: attention : d'eclaration implicite de la fonction << lseek >> m_binbuf.c:738: attention : d'eclaration implicite de la fonction << close >> m_binbuf.c:741: attention : d'eclaration implicite de la fonction << read >> cd ../obj; cc -o ../bin/pd g_canvas.o g_graph.o g_text.o g_rtext.o g_array.o g_template.o g_io.o g_scalar.o g_traversal.o g_guiconnect.o g_readwrite.o g_edit or.o g_all_guis.o g_bang.o g_hdial.o g_hslider.o g_mycanvas.o g_numbox.o g_toggl e.o g_vdial.o g_vslider.o g_vumeter.o m_pd.o m_class.o m_obj.o m_atom.o m_memory .o m_binbuf.o m_conf.o m_glob.o m_sched.o s_main.o s_inter.o s_file.o s_print.o s_loader.o s_path.o s_entry.o s_audio.o s_midi.o d_ugen.o d_ctl.o d_arithmetic.o d_osc.o d_filter.o d_dac.o d_misc.o d_math.o d_fft.o d_array.o d_global.o d_del ay.o d_resample.o x_arithmetic.o x_connective.o x_interface.o x_midi.o x_misc.o x_time.o x_acoustics.o x_net.o x_qlist.o x_gui.o x_list.o d_soundfile.o s_midi_p m.o s_audio_pa.o s_audio_pablio.o s_audio_paring.o ../portaudio/pa_common/pa_all ocation.o ../portaudio/pa_common/pa_converters.o ../portaudio/pa_common/pa_cpulo ad.o ../portaudio/pa_common/pa_dither.o ../portaudio/pa_common/pa_front.o ../por taudio/pa_common/pa_process.o ../portaudio/pa_common/pa_skeleton.o ../portaudio/ pa_common/pa_stream.o ../portaudio/pa_common/pa_trace.o ../portaudio/pa_win/pa_w in_util.o ../portaudio/pa_win/pa_win_hostapis.o ../portaudio/pa_win_wmme/pa_win_ wmme.o ../portaudio/pa_win_ds/pa_win_ds.o ../portaudio/pa_win_ds/dsound_wrapper. o ../portmidi/pm_common/pmutil.o ../portmidi/pm_common/portmidi.o ../portmidi/pm _win/pmdll.o ../portmidi/pm_win/pmwin.o ../portmidi/pm_win/pmwinmm.o ../portmidi /porttime/ptwinmm.o d_fft_mayer.o d_fftroutine.o \ -ldl -lm -lpthreadGC2 -lwsock32 -lwinmm -lole32 -lstdc++ m_binbuf.o: dans la fonction << binbuf_read >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/m_binbuf.c:736: r'ef'erence ind'efinie vers << __imp___iob >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/m_binbuf.c:729: r'ef'erence ind'efinie vers << __imp___iob >> /home/pat/pdextended/pd-extended/pd-extended/pd/src/m_binbuf.c:743: r'ef'erence ind'efinie vers << __imp___iob >> m_binbuf.o: dans la fonction << binbuf_write >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/m_binbuf.c:829: r'ef'erence ind'efinie vers << __imp___iob >> s_main.o: dans la fonction << sys_argparse >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_main.c:872: r'ef'erence in d'efinie vers << __imp___iob >> s_main.o:/home/pat/pdextended/pd-extended/pd-extended/pd/src/s_main.c:278: encor e plus de r'ef'erences ind'efinies suivent vers << __imp___iob >> collect2: ld a retourn'e 1 code d''etat d'ex'ecution make: *** [../bin/pd] Erreur 1
The source code modification is a little bit more complicated because cygwin uses headers from both msw and unix.
pa and pm seems to be built :), but I'm stuck on this last error caused by stdio.h, cygwin provides mingw headers, and the _imp____iob stuff is into /usr/include/mingw/stdio.h:
in /usr/include/mingw/stdio.h line 146
#ifndef __DECLSPEC_SUPPORTED
extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#define _iob (*_imp___iob) /* An array of FILE */
so I've included it like this:
#ifdef __CYGWIN__ #include <mingw/stdio.h> #else #include <stdio.h> #endif
This code seems to work for other files (I've tried it on g_canvas.c), but only if I put, like a Sorcerer's Apprentice, _mingw.h into /usr/include. Well, mingw seems not well implemented in cygwin.
I've also tried a turn by removing #ifndef __DECLSPEC_SUPPORTED just to see if it is related, but no luck...
This issue remains mysterious.
Also I'm still optimistic about Gem because ogl and some other graphic stuff are implemented by cygwin.
pa and pm seems to be built :), but I'm stuck on this last error caused by stdio.h, cygwin provides mingw headers, and the _imp____iob stuff is into /usr/include/mingw/stdio.h:
in /usr/include/mingw/stdio.h line 146
#ifndef __DECLSPEC_SUPPORTED
extern FILE (*_imp___iob)[]; /* A pointer to an array of FILE */
#define _iob (*_imp___iob) /* An array of FILE */
so I've included it like this:
#ifdef __CYGWIN__ #include <mingw/stdio.h> #else #include <stdio.h> #endif
This code seems to work for other files (I've tried it on g_canvas.c), but only if I put, like a Sorcerer's Apprentice, _mingw.h into /usr/include. Well, mingw seems not well implemented in cygwin.
The mingw headers are meant to be included by using -I/usr/include/ mingw in CFLAGS, not using #include <mingw/stdio.h> in the source files.
.hc
------------------------------------------------------------------------ ----
Terrorism is not an enemy. It cannot be defeated. It's a tactic. It's about as sensible to say we declare war on night attacks and expect we're going to win that war. We're not going to win the war on terrorism. - retired U.S. Army general, William Odom
Hello,
I'd like to paste s_entry.c into watchdog.c, and then handle PID with one file only, what do you think about this?
What's PID in this context? If you are interested in making Pd build with Cygwin, and having your changes integrated into Pd itself, then you should keep the files as they are.
.hc
On Dec 3, 2007, at 6:44 PM, Patrice Colet wrote:
Hello,
I'd like to paste s_entry.c into watchdog.c, and then handle PID with one file only, what do you think about this?
------------------------------------------------------------------------ ----
News is what people want to keep hidden and everything else is publicity. - Bill Moyers
Patrice Colet a écrit :
Hello,
I'd like to paste s_entry.c into watchdog.c, and then handle PID with one file only, what do you think about this?
Forget this, it seems not possible, as well as it is not possible to use cygwin for building watchdog (I've been able to build it without -mno-cygwin but it wasn't possible to go further), because windows doesn't need/use getppid(), so I suppose there is no hope for using the unix main function into a windows environment.
http://lists.puredata.info/pipermail/pd-list/2005-09/031049.html
By the way, could someone tell what's going wrong with this:
cd ../obj; cc -mwindows -o ../bin/pd s_entry.o \ -L../bin -lpd s_entry.o: dans la fonction << main >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_entry.c:31: r'ef'erence in d'efinie vers << _sys_main >> collect2: ld a retourn'e 1 code d''etat d'ex'ecution make: *** [../bin/pd] Erreur 1
Maybe you would like to get some clues about what I'm doing with the makefile.in and configure.in:
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-04 03:01:38.843750000 +0100 @@ -29,6 +29,7 @@
CPPFLAGS = @CPPFLAGS@ MORECFLAGS = @MORECFLAGS@ +CYGFLAGS = @CYGFLAGS@ GINCLUDE = $(CPPFLAGS) @GUIFLAGS@ GLIB = @LIBS@
@@ -89,15 +90,15 @@ #
.PHONY: pd gui externs all - -all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
+ $(OBJ) : %.o : %.c - $(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c + $(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(GOBJ) : %.o : %.c $(CC) $(CFLAGS) $(GFLAGS) $(GINCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c @@ -114,21 +115,31 @@ $(BIN_DIR): test -d $(BIN_DIR) || mkdir -p $(BIN_DIR)
-$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c +#$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) +# $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c + +$(BIN_DIR)/pd-watchdog: s_entry.o + cd ../obj; $(CC) $(LDFLAGS) -o pd-watchdog.exe s_entry.o $(LIBS) \ + -L$(BIN_DIR) -lpd + $(STRIP) -s $(BIN_DIR)/pd-watchdog.exe
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c @WINSOCK@
$(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c @WIN SOCK@ + +#$(PDEXEC): $(OBJ) $(BIN_DIR) +# cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) $(CYGFLAGS) -o $(PDEXEC) $(OB J) \ +# $(LIB)
$(PDEXEC): $(OBJ) $(BIN_DIR) - cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ - $(LIB) + cd ../obj; $(CC) -mwindows -o $(PDEXEC) s_entry.o $(LIBS) \ + -L$(BIN_DIR) -lpd + $(STRIP) -s $(PDEXEC)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC) - cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ + cd ../obj; $(CC) $(CYGFLAGS) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk @@ -147,11 +158,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 + +# this is for mingw /cygwin +$(BIN_DIR)/$(GUINAME): $(GOBJ) + cd $(BIN_DIR); dllwrap -mno-cygwin --export-all-symbol --output-def pd .def \ + --output-lib=pd.a --dllname=$(GUINAME) $(OBJ_DIR)/t_tkcmd.o $(LIB) $(GLI B) + strip --strip-unneeded $(BIN_DIR)/$(GUINAME)
externs: cd ../extra/bonk~;make @EXTERNTARGET@ @@ -203,17 +215,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~ - -(cd ../doc/6.externs; rm -f *.pd_linux) + -(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"` + -rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean
============================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-03 15:19:11.562500000 +0100 @@ -21,7 +21,8 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) - +AC_SUBST(CYGFLAGS) +AC_SUBST(WINSOCK) dnl other defaults
dnl check for features @@ -231,6 +232,7 @@ binarymode="-m4755" fi STRIPFLAG=-s + WINSOCK="" GUINAME="pd-gui" if test x$USE_DEBUG_CFLAGS == "xyes"; then @@ -299,6 +301,7 @@ ../portmidi/pm_common/portmidi.c \ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG="" + WINSOCK="" GUINAME="libPdTcl.dylib"
# find the Tcl/Tk Frameworks @@ -337,11 +340,12 @@
# only Windows uses ASIO, for the rest, set to blank ASIOSRC= - +# only cygwin needs this flag +CYGFLAGS= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll - MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -DPD_INTERNAL \ + MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -364,10 +368,47 @@ ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \ ../asio/asiodrivers.cpp ../asio/asiolist.cpp" STRIPFLAG="--strip-unneeded" - GUINAME="pdtcl.dll" + WINSOCK=" -lwsock32" + GUINAME="pd.dll" GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1 || test `uname -s` == CYGWIN_NT-5.0 || test `uname -s` == CYGWIN_NT-6.0; +then + EXT=dll + MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \ + -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \ + -I../portaudio/pa_common -I../portaudio/pablio \ + -I../portaudio/pa_asio \ + -mms-bitfields "$MORECFLAGS + CYGFLAGS="-mno-cygwin"$CYGFLAGS + PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \ + ../portaudio/pa_win_ds/pa_win_ds.c \ + ../portaudio/pa_win_ds/dsound_wrapper.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" + WINSOCK="-lwsock32" + GUINAME="pd.dll" + GUIFLAGS= +fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
=============================================================
PS: sorry for french error messages, I've no clue about how to set this to english.
Cygwin1.dll have to be in pd/bin for running, and it require cygwin shell, Puredata into cygwin environment is working greatly even when Gem crashes.
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-06 00:25:36.035890800 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(PID) +AC_SUBST(CYGDLL) +
dnl other defaults
@@ -232,6 +235,7 @@ fi STRIPFLAG=-s GUINAME="pd-gui" + PID="pd-watchdog" if test x$USE_DEBUG_CFLAGS == "xyes"; then MORECFLAGS=$MORECFLAGS" -g" @@ -300,7 +304,7 @@ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG="" GUINAME="libPdTcl.dylib" - + PID="pd-watchdog" # find the Tcl/Tk Frameworks if test -d "../../Frameworks"; then @@ -334,10 +338,9 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi - # only Windows uses ASIO, for the rest, set to blank ASIOSRC= - +EXT= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll @@ -368,6 +371,46 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1 || \ + test `uname -s` == CYGWIN_NT-5.0 || \ + test `uname -s` == CYGWIN_NT-6.0 ; +then + + EXT=".exe" + MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \ + -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \ + -I../portaudio/pa_common -I../portaudio/pablio \ + -I../portaudio/pa_asio -I../asio \ + -mms-bitfields "$MORECFLAGS + + CYGDLL="cygwin1.dll"$CYGDLL + PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \ + ../portaudio/pa_win_ds/pa_win_ds.c \ + ../portaudio/pa_win_ds/dsound_wrapper.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" + PID="pd.com" + GUIFLAGS= +fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
================================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-06 00:50:20.832765800 +0100 @@ -8,9 +8,11 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd EXT= @EXT@ +PDEXEC = $(BIN_DIR)/pd$(EXT) GUINAME= @GUINAME@ +# pd-watchdog or pd.com? +PID= @PID@
prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \ - -Wno-unused -Wno-parentheses -Wno-switch + -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch + ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $(MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff + +PDDLL = pd.dll + +STRIP = strip --strip-unneeded -R .note -R .comment + ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all - -all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(PDEXEC) $(BIN_DIR)/$(PID) $(BIN_DIR)/pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
+ $(OBJ) : %.o : %.c - $(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c + $(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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 + $(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -118,25 +127,26 @@ $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR) - $(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 $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c $(LI B)
-$(PDEXEC): $(OBJ) $(BIN_DIR) +$(BIN_DIR)/pd: $(OBJ) $(BIN_DIR) cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ $(LIB)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC) - cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ + cd $(OBJ_DIR); $(CC) $(CFLAG) $(LIB) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk cp u_main.tk $(BIN_DIR)/pd.tk
+ #this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC) - cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs warning \ + cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +157,33 @@
@executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?) + +# this is for mingw /cygwin +$(BIN_DIR)/pd.com: s_entry.o + cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd.com s_entry.o $(LIBS) \ + -L$(BIN_DIR) -lpd; $(STRIP) -s pd.com + cp $(OBJ_DIR)/pd.com $(BIN_DIR) + $(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) + cd $(BIN_DIR); dllwrap $(CFLAGS) --output-def pdtcl.def \ + --output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/pd.exe: pd.dll pd.exe + +pd.exe: $(OBJ) $(BIN_DIR) + cd $(OBJ_DIR); $(CC) $(CFLAGS) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) s_e ntry.o $(LIB) \ + -L$(BIN_DIR) -lpd + $(STRIP) -s $(BIN_DIR)/pd.exe + + +pd.dll: $(OBJ) $(ASIOOBJ) + cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o pd.dll -mno-cygwin $(OBJ) $( ASIOOBJ) $(LIB) \ + -Wl,--export-all-symbols -Wl,--out-implib=pd.a; + $(STRIP) $(OBJ_DIR)/pd.dll + cp $(OBJ_DIR)/pd.dll $(BIN_DIR) + + externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +234,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~ - -(cd ../doc/6.externs; rm -f *.pd_linux) + -(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"` + -rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +261,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile - $(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies + $(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
Wow, that's awesome! So you are using X11 to display Pd? I am going to try this tonight. Which version of Pd did you try?
.hc
On Dec 5, 2007, at 7:46 PM, Patrice Colet wrote:
Cygwin1.dll have to be in pd/bin for running, and it require cygwin shell, Puredata into cygwin environment is working greatly even when Gem crashes.
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-06 00:25:36.035890800 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(PID) +AC_SUBST(CYGDLL)
dnl other defaults
@@ -232,6 +235,7 @@ fi STRIPFLAG=-s GUINAME="pd-gui"
- PID="pd-watchdog" if test x$USE_DEBUG_CFLAGS == "xyes"; then MORECFLAGS=$MORECFLAGS" -g"
@@ -300,7 +304,7 @@ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG="" GUINAME="libPdTcl.dylib"
- PID="pd-watchdog"
# find the Tcl/Tk Frameworks if test -d "../../Frameworks"; then @@ -334,10 +338,9 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi
# only Windows uses ASIO, for the rest, set to blank ASIOSRC=
+EXT= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll @@ -368,6 +371,46 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1 || \
- test `uname -s` == CYGWIN_NT-5.0 || \
- test `uname -s` == CYGWIN_NT-6.0 ;
+then
- EXT=".exe"
- MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -
DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \
- -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portaudio/pa_asio -I../asio \
- -mms-bitfields "$MORECFLAGS
- CYGDLL="cygwin1.dll"$CYGDLL
- PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \
../portaudio/pa_win_ds/pa_win_ds.c \
../portaudio/pa_win_ds/dsound_wrapper.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"
PID="pd.com"
- GUIFLAGS=
+fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
================================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-06 00:50:20.832765800 +0100 @@ -8,9 +8,11 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd EXT= @EXT@ +PDEXEC = $(BIN_DIR)/pd$(EXT) GUINAME= @GUINAME@ +# pd-watchdog or pd.com? +PID= @PID@
prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
- -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $ (MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff
+PDDLL = pd.dll
+STRIP = strip --strip-unneeded -R .note -R .comment
ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all
-all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(PDEXEC) $(BIN_DIR)/$(PID) $(BIN_DIR)/ pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
$(OBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o
$*.c
$(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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
$(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -118,25 +127,26 @@ $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR)
$(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 $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c $(LI B)
-$(PDEXEC): $(OBJ) $(BIN_DIR) +$(BIN_DIR)/pd: $(OBJ) $(BIN_DIR) cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $ (OBJ) \ $(LIB)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
cd $(OBJ_DIR); $(CC) $(CFLAG) $(LIB) -o $(BIN_DIR)/$
(GUINAME) $(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk cp u_main.tk $(BIN_DIR)/pd.tk
#this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs
warning \
cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -
read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +157,33 @@ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?)
+# this is for mingw /cygwin +$(BIN_DIR)/pd.com: s_entry.o
cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd.com s_entry.o $(LIBS) \
-L$(BIN_DIR) -lpd; $(STRIP) -s pd.com
cp $(OBJ_DIR)/pd.com $(BIN_DIR)
$(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)
cd $(BIN_DIR); dllwrap $(CFLAGS) --output-def pdtcl.def \
--output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/
t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/pd.exe: pd.dll pd.exe
+pd.exe: $(OBJ) $(BIN_DIR)
cd $(OBJ_DIR); $(CC) $(CFLAGS) $(LDFLAGS) $(DBG_CFLAGS) -o $
(PDEXEC) s_e ntry.o $(LIB) \
-L$(BIN_DIR) -lpd
$(STRIP) -s $(BIN_DIR)/pd.exe
+pd.dll: $(OBJ) $(ASIOOBJ)
cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o pd.dll -mno-
cygwin $(OBJ) $( ASIOOBJ) $(LIB) \
-Wl,--export-all-symbols -Wl,--out-implib=pd.a;
$(STRIP) $(OBJ_DIR)/pd.dll
cp $(OBJ_DIR)/pd.dll $(BIN_DIR)
externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +234,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~
-(cd ../doc/6.externs; rm -f *.pd_linux)
-(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"`
-rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +261,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
$(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
------------------------------------------------------------------------ ----
You can't steal a gift. Bird gave the world his music, and if you can hear it, you can have it. - Dizzy Gillespie
Hans-Christoph Steiner a écrit :
Wow, that's awesome! So you are using X11 to display Pd? I am going to try this tonight. Which version of Pd did you try?
.hc
On Dec 5, 2007, at 7:46 PM, Patrice Colet wrote:
Cygwin1.dll have to be in pd/bin for running, and it require cygwin shell, Puredata into cygwin environment is working greatly even when Gem crashes.
I have X11 installed indeed.
I took this version:
rsync -av --delete rsync://128.238.56.50/distros/pd-extended/ pd-extended/
I'm going to try other versions, the gui isn't behaving like the last nightly build, also I'll try to put tcl/tk-8.5 ;).
I think also that the makefile should install pd into cygwin environment, then the additionnal libraries like tkdnd would be in cygwin/lib or cygwin/bin cygwin/usr/pd/lib ?
I couldn't get this patch to apply. I think it got messed up being pasted into the email. Could you attach it as a file? Here's what I have:
.hc
On Dec 5, 2007, at 7:46 PM, Patrice Colet wrote:
Cygwin1.dll have to be in pd/bin for running, and it require cygwin shell, Puredata into cygwin environment is working greatly even when Gem crashes.
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-06 00:25:36.035890800 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(PID) +AC_SUBST(CYGDLL)
dnl other defaults
@@ -232,6 +235,7 @@ fi STRIPFLAG=-s GUINAME="pd-gui"
- PID="pd-watchdog" if test x$USE_DEBUG_CFLAGS == "xyes"; then MORECFLAGS=$MORECFLAGS" -g"
@@ -300,7 +304,7 @@ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG="" GUINAME="libPdTcl.dylib"
- PID="pd-watchdog"
# find the Tcl/Tk Frameworks if test -d "../../Frameworks"; then @@ -334,10 +338,9 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi
# only Windows uses ASIO, for the rest, set to blank ASIOSRC=
+EXT= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll @@ -368,6 +371,46 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1 || \
- test `uname -s` == CYGWIN_NT-5.0 || \
- test `uname -s` == CYGWIN_NT-6.0 ;
+then
- EXT=".exe"
- MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -
DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \
- -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portaudio/pa_asio -I../asio \
- -mms-bitfields "$MORECFLAGS
- CYGDLL="cygwin1.dll"$CYGDLL
- PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \
../portaudio/pa_win_ds/pa_win_ds.c \
../portaudio/pa_win_ds/dsound_wrapper.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"
PID="pd.com"
- GUIFLAGS=
+fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
================================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-06 00:50:20.832765800 +0100 @@ -8,9 +8,11 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd EXT= @EXT@ +PDEXEC = $(BIN_DIR)/pd$(EXT) GUINAME= @GUINAME@ +# pd-watchdog or pd.com? +PID= @PID@
prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
- -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $ (MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff
+PDDLL = pd.dll
+STRIP = strip --strip-unneeded -R .note -R .comment
ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all
-all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(PDEXEC) $(BIN_DIR)/$(PID) $(BIN_DIR)/ pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
$(OBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o
$*.c
$(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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
$(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -118,25 +127,26 @@ $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR)
$(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 $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c $(LI B)
-$(PDEXEC): $(OBJ) $(BIN_DIR) +$(BIN_DIR)/pd: $(OBJ) $(BIN_DIR) cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $ (OBJ) \ $(LIB)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
cd $(OBJ_DIR); $(CC) $(CFLAG) $(LIB) -o $(BIN_DIR)/$
(GUINAME) $(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk cp u_main.tk $(BIN_DIR)/pd.tk
#this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs
warning \
cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -
read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +157,33 @@ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?)
+# this is for mingw /cygwin +$(BIN_DIR)/pd.com: s_entry.o
cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd.com s_entry.o $(LIBS) \
-L$(BIN_DIR) -lpd; $(STRIP) -s pd.com
cp $(OBJ_DIR)/pd.com $(BIN_DIR)
$(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)
cd $(BIN_DIR); dllwrap $(CFLAGS) --output-def pdtcl.def \
--output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/
t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/pd.exe: pd.dll pd.exe
+pd.exe: $(OBJ) $(BIN_DIR)
cd $(OBJ_DIR); $(CC) $(CFLAGS) $(LDFLAGS) $(DBG_CFLAGS) -o $
(PDEXEC) s_e ntry.o $(LIB) \
-L$(BIN_DIR) -lpd
$(STRIP) -s $(BIN_DIR)/pd.exe
+pd.dll: $(OBJ) $(ASIOOBJ)
cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o pd.dll -mno-
cygwin $(OBJ) $( ASIOOBJ) $(LIB) \
-Wl,--export-all-symbols -Wl,--out-implib=pd.a;
$(STRIP) $(OBJ_DIR)/pd.dll
cp $(OBJ_DIR)/pd.dll $(BIN_DIR)
externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +234,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~
-(cd ../doc/6.externs; rm -f *.pd_linux)
-(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"`
-rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +261,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
$(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
------------------------------------------------------------------------ ----
Using ReBirth is like trying to play an 808 with a long stick. - David Zicarelli
Patrice Colet wrote:
Hello,
hi.
I'd like to paste s_entry.c into watchdog.c, and then handle PID with one file only, what do you think about this?
why would you?
modular programming is about reducing the amount of duplicate code instead of increasing it. you could just link s_entry.o and watchdog.o together.
mfga.sdr IOhannes
IOhannes m zmoelnig a écrit :
Patrice Colet wrote:
Hello,
hi.
I'd like to paste s_entry.c into watchdog.c, and then handle PID with one file only, what do you think about this?
why would you?
I seemed interesting to me to have the code grouped in one commented file for a better understanding.
modular programming is about reducing the amount of duplicate code instead of increasing it. you could just link s_entry.o and watchdog.o together.
It sounds better.
Hi!
Martin Peach a écrit :
Patrice Colet wrote:
==========================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Oh, too bad... I tried it a couple years ago as well and didn't get it to work either, but I learned a lot about the insides of pd;).
Martin
I didn't give up finally and have almost something that builds everything (but not the "vanilla" externals because the extra/makefile needs to be modified) on cygwin with ./configure && make, with adding smoothly the stuff from makefile.mingw. The hybrid makefile isn't clean enough for the moment as it can be seen (particulary $(BIN_DIR)/$(PDDLL) in all:) but I'll fix this.
==============================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-04 06:59:31.953125000 +0100 @@ -8,7 +8,8 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd +WINEXE =@WINEXE@ +PDEXEC = $(BIN_DIR)/pd$(WINEXE) EXT= @EXT@ GUINAME= @GUINAME@
@@ -29,6 +30,7 @@
CPPFLAGS = @CPPFLAGS@ MORECFLAGS = @MORECFLAGS@ +CYGFLAGS = @CYGFLAGS@ GINCLUDE = $(CPPFLAGS) @GUIFLAGS@ GLIB = @LIBS@
@@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \ - -Wno-unused -Wno-parentheses -Wno-switch + -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch + ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $(MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff + +PDDLL = pd.dll + +STRIP = strip --strip-unneeded -R .note -R .comment + ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all - -all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/$(PDDLL) $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
+ $(OBJ) : %.o : %.c - $(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c + $(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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 + $(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -114,21 +123,31 @@ $(BIN_DIR): test -d $(BIN_DIR) || mkdir -p $(BIN_DIR)
-$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c +#$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) +# $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c + +$(BIN_DIR)/pd-watchdog: s_entry.o + cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd-watchdog.exe s_entry.o $(LIBS) \ + -L$(BIN_DIR) -lpd; cp $(OBJ_DIR)/pd-watchdog.exe $(BIN_DIR) + $(STRIP) -s $(BIN_DIR)/pd-watchdog.exe
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c @WINSOCK@
$(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR) - $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c + $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c @WIN SOCK@ + +#$(PDEXEC): $(OBJ) $(BIN_DIR) +# cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) $(CYGFLAGS) -o $(PDEXEC) $(OB J) \ +# $(LIB)
$(PDEXEC): $(OBJ) $(BIN_DIR) - cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ - $(LIB) + cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -mwindows $(LDFLAGS) $(DBG_CFLAGS) -o $ (PDEXEC) s_entry.o $(LIB) \ + -L$(BIN_DIR) -lpd + $(STRIP) -s $(PDEXEC)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC) - cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ + cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk @@ -136,7 +155,7 @@
#this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC) - cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs warning \ + cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +166,18 @@
@executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?) + +# this is for mingw /cygwin $(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) + cd $(BIN_DIR); dllwrap -mno-cygwin --export-all-symbol --output-def pd tcl.def \ + --output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/$(PDDLL): $(OBJ) $(ASIOOBJ) + cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o $(PDDLL) $(CYGFLAGS) $(OBJ) $(ASIOOBJ) $(LIB) \ + -Wl,--export-all-symbols -Wl,--out-implib=pd.a; + $(STRIP) $(OBJ_DIR)/$(PDDLL) + cp $(OBJ_DIR)/$(PDDLL) $(BIN_DIR) externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +228,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~ - -(cd ../doc/6.externs; rm -f *.pd_linux) + -(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"` + -rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +255,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile - $(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies + $(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
=======================================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-04 06:54:56.765625000 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(CYGFLAGS) +AC_SUBST(WINSOCK) +AC_SUBST(WINEXE)
dnl other defaults
@@ -179,7 +182,7 @@ AC_CHECK_LIB(jack,jack_set_xrun_callback,LIBS="$LIBS -ljack";jack=xrun, jack=no) AC_CHECK_LIB(jack,jack_set_error_function,LIBS="$LIBS -ljack";jack=yes, jack=no) fi - + PD="pd" LDFLAGS="-Wl,-export-dynamic" if test "$static" = "yes"; then LDFLAGS="$LDFLAGS -static" @@ -231,6 +234,7 @@ binarymode="-m4755" fi STRIPFLAG=-s + WINSOCK="" GUINAME="pd-gui" if test x$USE_DEBUG_CFLAGS == "xyes"; then @@ -299,6 +303,7 @@ ../portmidi/pm_common/portmidi.c \ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG="" + WINSOCK="" GUINAME="libPdTcl.dylib"
# find the Tcl/Tk Frameworks @@ -334,14 +339,16 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi - +WINEXE= # only Windows uses ASIO, for the rest, set to blank ASIOSRC= - +# only cygwin needs this flag +CYGFLAGS= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll - MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -DPD_INTERNAL \ + WINEXE=".exe" + MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -364,10 +371,48 @@ ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \ ../asio/asiodrivers.cpp ../asio/asiolist.cpp" STRIPFLAG="--strip-unneeded" - GUINAME="pdtcl.dll" + WINSOCK=" -lwsock32" + GUINAME="pd.dll" GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1 || test `uname -s` == CYGWIN_NT-5.0 || test `uname -s` == CYGWIN_NT-6.0; +then + EXT=dll + WINEXE=".exe" + MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \ + -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \ + -I../portaudio/pa_common -I../portaudio/pablio \ + -I../portaudio/pa_asio -I../asio \ + -mms-bitfields "$MORECFLAGS + CYGFLAGS="-mno-cygwin"$CYGFLAGS + PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \ + ../portaudio/pa_win_ds/pa_win_ds.c \ + ../portaudio/pa_win_ds/dsound_wrapper.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" + WINSOCK="-lwsock32" + GUINAME="pdtcl.dll" + GUIFLAGS= +fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
======================================================================
Now the problem is the one I've described before, pd.exe is mysteriously linked to cygwin1.dll, if I rename pdtcl.dll, an error message pops up to say something like it couldn't find "pthread_cond_destroy".
======================================================================
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -M g_canvas.c
...*snip*....
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX="/usr/loca l" -c -o ../obj/t_main.o t_main.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_main.c:18: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX="/usr/loca l" -c -o ../obj/t_tkcmd.o t_tkcmd.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_tkcmd.c:42: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cd ../bin; dllwrap -mno-cygwin --export-all-symbol --output-def pdtcl.def \ --output-lib=pdtcl.a --dllname=pdtcl.dll ../obj/t_tkcmd.o -ldl -lm -lpth readGC2 -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -lstdc++ -ltk84 -ltcl84 dllwrap: aucun fichier d'exportation de d'efinitions fourni. Cr'eation du fichier, mais il ne correspondra pas n'ecessairement `a ce que vous d'esirez. /usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/ld: AVERTISSE MENT: ne peut trouver le symbole d'entr'ee __cygwin_dll_entry@12; utilise par d' efaut 6d081000
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX="/usr/loca l" -c -o ../obj/s_inter.o s_inter.c s_inter.c: In function `sys_startgui': s_inter.c:979: attention : le corps de la d'eclaration du if est vide
...*snip*...
d_ctl.c: In function `line_tilde_perform': d_ctl.c:110: attention : d'er'ef'erencement du pointeur type-punned brisera les strictes d'aliases
...*snip*...
../portaudio/pa_win_wmme/pa_win_wmme.c: In function `PaWinMme_Initialize': ../portaudio/pa_win_wmme/pa_win_wmme.c:814: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c:849: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c: In function `OpenStream': ../portaudio/pa_win_wmme/pa_win_wmme.c:1976: attention : << framesPerBufferProce ssorCall >> pourrait ^etre utilis'e sans ^etre initialis'e dans cette fonction
...*snip*...
../portaudio/pa_win_ds/pa_win_ds.c:380: attention : (pr`es de l'initialisation d e << IID_IRolandVSCEmulated1.Data4 >>) ../portaudio/pa_win_ds/pa_win_ds.c:381: attention : accolades manquantes autour de l'initialisation
...*snip*...
g++ -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -DUSEAPI_ MMIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/Mingw/inclu de -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -c -o ../obj/../portaudio/pa _asio/pa_asio.o ../portaudio/pa_asio/pa_asio.cpp cc1plus: attention : l'option de la ligne de commande "-Wstrict-prototypes" est valide pour Ada/C/ObjC mais pas pour C++
...*snip*...
make[1]: entrant dans le r'epertoire << /home/pat/pdextended/pd-extended/pd-exte nded/pd/extra/bonk~ >> cl /W3 /WX /DNT /DPD /nologo /I. /I....\src /I"C:\Program Files\Microsoft Visua l Studio\Vc98"\include /c bonk~.c /bin/sh: cl: command not found make[1]: *** [bonk~.dll] Erreur 127
===========================================================
Ciao;
A couple of comments to hopefully make things cleaner. The existing files aren't very clean, so it can be tricky at times:
- these changes need to fit into the configure.in and makefile.in so that those files will still work on other platforms. I am not sure that adding $(BIN_DIR)/$(PDDLL) to "all" will work on other platforms.
- things like -lwsock32 should be added to the existing LDFLAGS, you don't need a separate WINSOCK entry for that, since -l is just a standard LDFLAGS for loading a library. pdsend/pdreceive should have LDFLAGS entries added instead of the custom WINSOCK one.
- -mno-cygwin should be added to CFLAGS, AFAIK, instead of making a custom variable for it (CYGFLAGS).
I am definitely glad you are working on this. I think this will make devleoping with Pd on Windows much easier. And Pd/Windows definitely needs some attention.
.hc
On Dec 4, 2007, at 1:48 AM, Patrice Colet wrote:
Hi!
Martin Peach a écrit :
Patrice Colet wrote:
====================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Oh, too bad... I tried it a couple years ago as well and didn't get it to work either, but I learned a lot about the insides of pd;). Martin
I didn't give up finally and have almost something that builds everything (but not the "vanilla" externals because the extra/ makefile needs to be modified) on cygwin with ./configure && make, with adding smoothly the stuff from makefile.mingw. The hybrid makefile isn't clean enough for the moment as it can be seen (particulary $(BIN_DIR)/$(PDDLL) in all:) but I'll fix this.
==============================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-04 06:59:31.953125000 +0100 @@ -8,7 +8,8 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd +WINEXE =@WINEXE@ +PDEXEC = $(BIN_DIR)/pd$(WINEXE) EXT= @EXT@ GUINAME= @GUINAME@
@@ -29,6 +30,7 @@
CPPFLAGS = @CPPFLAGS@ MORECFLAGS = @MORECFLAGS@ +CYGFLAGS = @CYGFLAGS@ GINCLUDE = $(CPPFLAGS) @GUIFLAGS@ GLIB = @LIBS@
@@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
- -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $ (MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff
+PDDLL = pd.dll
+STRIP = strip --strip-unneeded -R .note -R .comment
ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all
-all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/$(PDDLL) $(PDEXEC) $ (BIN_DIR)/pd-watchdog $(BIN_DIR)/pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
$(OBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o
$*.c
$(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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
$(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -114,21 +123,31 @@ $(BIN_DIR): test -d $(BIN_DIR) || mkdir -p $(BIN_DIR)
-$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog
s_watchdog.c +#$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) +# $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
+$(BIN_DIR)/pd-watchdog: s_entry.o
cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd-watchdog.exe
s_entry.o $(LIBS) \
-L$(BIN_DIR) -lpd; cp $(OBJ_DIR)/pd-watchdog.exe $
(BIN_DIR)
$(STRIP) -s $(BIN_DIR)/pd-watchdog.exe
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend
u_pdsend.c @WINSOCK@
$(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c @WIN SOCK@
+#$(PDEXEC): $(OBJ) $(BIN_DIR) +# cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) $(CYGFLAGS) -o $ (PDEXEC) $(OB J) \ +# $(LIB)
$(PDEXEC): $(OBJ) $(BIN_DIR)
cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $
(OBJ) \
$(LIB)
cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -mwindows $(LDFLAGS) $
(DBG_CFLAGS) -o $ (PDEXEC) s_entry.o $(LIB) \
-L$(BIN_DIR) -lpd
$(STRIP) -s $(PDEXEC)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -o $(BIN_DIR)/$(GUINAME) $
(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk @@ -136,7 +155,7 @@
#this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs
warning \
cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -
read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +166,18 @@ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?)
+# this is for mingw /cygwin $(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)
cd $(BIN_DIR); dllwrap -mno-cygwin --export-all-symbol --
output-def pd tcl.def \
--output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/
t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/$(PDDLL): $(OBJ) $(ASIOOBJ)
cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o $(PDDLL) $
(CYGFLAGS) $(OBJ) $(ASIOOBJ) $(LIB) \
-Wl,--export-all-symbols -Wl,--out-implib=pd.a;
$(STRIP) $(OBJ_DIR)/$(PDDLL)
cp $(OBJ_DIR)/$(PDDLL) $(BIN_DIR)
externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +228,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~
-(cd ../doc/6.externs; rm -f *.pd_linux)
-(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"`
-rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +255,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
$(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
=======================================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-04 06:54:56.765625000 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(CYGFLAGS) +AC_SUBST(WINSOCK) +AC_SUBST(WINEXE)
dnl other defaults
@@ -179,7 +182,7 @@ AC_CHECK_LIB(jack,jack_set_xrun_callback,LIBS="$LIBS - ljack";jack=xrun, jack=no) AC_CHECK_LIB(jack,jack_set_error_function,LIBS="$LIBS - ljack";jack=yes, jack=no) fi
- PD="pd" LDFLAGS="-Wl,-export-dynamic" if test "$static" = "yes"; then LDFLAGS="$LDFLAGS -static"
@@ -231,6 +234,7 @@ binarymode="-m4755" fi STRIPFLAG=-s
GUINAME="pd-gui" if test x$USE_DEBUG_CFLAGS == "xyes"; thenWINSOCK=""
@@ -299,6 +303,7 @@ ../portmidi/pm_common/portmidi.c \ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG=""
GUINAME="libPdTcl.dylib"WINSOCK=""
# find the Tcl/Tk Frameworks @@ -334,14 +339,16 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi
+WINEXE= # only Windows uses ASIO, for the rest, set to blank ASIOSRC=
+# only cygwin needs this flag +CYGFLAGS= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -
DPD_INTERNAL \
WINEXE=".exe"
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -
DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -364,10 +371,48 @@ ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \ ../asio/asiodrivers.cpp ../asio/asiolist.cpp" STRIPFLAG="--strip-unneeded"
- GUINAME="pdtcl.dll"
WINSOCK=" -lwsock32"
- GUINAME="pd.dll" GUIFLAGS=
fi
+if test `uname -s` == CYGWIN_NT-5.1 || test `uname -s` == CYGWIN_NT-5.0 || test `uname -s` == CYGWIN_NT-6.0; +then
- EXT=dll
WINEXE=".exe"
- MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -
DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \
- -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portaudio/pa_asio -I../asio \
- -mms-bitfields "$MORECFLAGS
- CYGFLAGS="-mno-cygwin"$CYGFLAGS
- PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \
../portaudio/pa_win_ds/pa_win_ds.c \
../portaudio/pa_win_ds/dsound_wrapper.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"
WINSOCK="-lwsock32"
- GUINAME="pdtcl.dll"
- GUIFLAGS=
+fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
======================================================================
Now the problem is the one I've described before, pd.exe is mysteriously linked to cygwin1.dll, if I rename pdtcl.dll, an error message pops up to say something like it couldn't find "pthread_cond_destroy".
======================================================================
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -M g_canvas.c
...*snip*....
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/t_main.o t_main.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_main.c:18: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/t_tkcmd.o t_tkcmd.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_tkcmd.c:42: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cd ../bin; dllwrap -mno-cygwin --export-all-symbol --output- def pdtcl.def \ --output-lib=pdtcl.a --dllname=pdtcl.dll ../obj/t_tkcmd.o - ldl -lm -lpth readGC2 -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -lstdc++ -ltk84 - ltcl84 dllwrap: aucun fichier d'exportation de d'efinitions fourni. Cr'eation du fichier, mais il ne correspondra pas n'ecessairement `a ce que vous d'esirez. /usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/ ld: AVERTISSE MENT: ne peut trouver le symbole d'entr'ee __cygwin_dll_entry@12; utilise par d' efaut 6d081000
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/s_inter.o s_inter.c s_inter.c: In function `sys_startgui': s_inter.c:979: attention : le corps de la d'eclaration du if est vide
...*snip*...
d_ctl.c: In function `line_tilde_perform': d_ctl.c:110: attention : d'er'ef'erencement du pointeur type-punned brisera les strictes d'aliases
...*snip*...
../portaudio/pa_win_wmme/pa_win_wmme.c: In function `PaWinMme_Initialize': ../portaudio/pa_win_wmme/pa_win_wmme.c:814: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c:849: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c: In function `OpenStream': ../portaudio/pa_win_wmme/pa_win_wmme.c:1976: attention : << framesPerBufferProce ssorCall >> pourrait ^etre utilis'e sans ^etre initialis'e dans cette fonction
...*snip*...
../portaudio/pa_win_ds/pa_win_ds.c:380: attention : (pr`es de l'initialisation d e << IID_IRolandVSCEmulated1.Data4 >>) ../portaudio/pa_win_ds/pa_win_ds.c:381: attention : accolades manquantes autour de l'initialisation
...*snip*...
g++ -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter -Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_ MMIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/inclu de -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -c -o ../obj/../ portaudio/pa _asio/pa_asio.o ../portaudio/pa_asio/pa_asio.cpp cc1plus: attention : l'option de la ligne de commande "-Wstrict- prototypes" est valide pour Ada/C/ObjC mais pas pour C++
...*snip*...
make[1]: entrant dans le r'epertoire << /home/pat/pdextended/pd- extended/pd-exte nded/pd/extra/bonk~ >> cl /W3 /WX /DNT /DPD /nologo /I. /I....\src /I"C:\Program Files \Microsoft Visua l Studio\Vc98"\include /c bonk~.c /bin/sh: cl: command not found make[1]: *** [bonk~.dll] Erreur 127
===========================================================
Ciao;
------------------------------------------------------------------------ ----
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
On Dec 4, 2007, at 1:48 AM, Patrice Colet wrote:
Hi!
Martin Peach a écrit :
Patrice Colet wrote:
====================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Oh, too bad... I tried it a couple years ago as well and didn't get it to work either, but I learned a lot about the insides of pd;). Martin
I didn't give up finally and have almost something that builds everything (but not the "vanilla" externals because the extra/ makefile needs to be modified) on cygwin with ./configure && make, with adding smoothly the stuff from makefile.mingw.
I didn't notice this before, it is great that you got it working! It would make building Pd on Windows so much easier if the MinGW build could be done in Cygwin. But I think that will be harder than just getting the MinGW build working with ./configure && make.
It might be worthwhile to start working with MinGW, since we know Pd builds there and works. Then once ./configure works on MinGW, then it should be a lot easier to get the cygwin builds going with -mno- cygwin.
The question I have about building things with -mno-cygwin is where do you put all of the extra sources that are built with MinGW? Things like Tcl/Tk, ogg, vorbis, regex, etc.
.hc
The hybrid makefile isn't clean enough for the moment as it can be seen (particulary $(BIN_DIR)/$(PDDLL) in all:) but I'll fix this.
==============================================================
$ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-04 06:59:31.953125000 +0100 @@ -8,7 +8,8 @@ VPATH = ../obj:./ OBJ_DIR = ../obj BIN_DIR = ../bin -PDEXEC = $(BIN_DIR)/pd +WINEXE =@WINEXE@ +PDEXEC = $(BIN_DIR)/pd$(WINEXE) EXT= @EXT@ GUINAME= @GUINAME@
@@ -29,6 +30,7 @@
CPPFLAGS = @CPPFLAGS@ MORECFLAGS = @MORECFLAGS@ +CYGFLAGS = @CYGFLAGS@ GINCLUDE = $(CPPFLAGS) @GUIFLAGS@ GLIB = @LIBS@
@@ -36,7 +38,8 @@ LIB = @PDLIB@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
- -Wno-unused -Wno-unused-parameter -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD
CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $ (MORECFLAGS) @@ -45,6 +48,12 @@
SYSSRC += @SYSSRC@
+#windows stuff
+PDDLL = pd.dll
+STRIP = strip --strip-unneeded -R .note -R .comment
ASIOSRC = @ASIOSRC@
ASIOOBJ = $(ASIOSRC:.cpp=.o) @@ -89,21 +98,21 @@ #
.PHONY: pd gui externs all
-all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
+all: $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/$(PDDLL) $(PDEXEC) $ (BIN_DIR)/pd-watchdog $(BIN_DIR)/pdsend \ $(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $ (BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
$(OBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o
$*.c
$(CC) $(CFLAGS) $(GFLAGS) -c -o $(OBJ_DIR)/$*.o $*.c
$(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
$(CXX) $(CFLAGS) -c -o $(OBJ_DIR)/$*.o $*.cpp
pd: $(PDEXEC)
@@ -114,21 +123,31 @@ $(BIN_DIR): test -d $(BIN_DIR) || mkdir -p $(BIN_DIR)
-$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog
s_watchdog.c +#$(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) +# $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
+$(BIN_DIR)/pd-watchdog: s_entry.o
cd $(OBJ_DIR); $(CC) $(LDFLAGS) -o pd-watchdog.exe
s_entry.o $(LIBS) \
-L$(BIN_DIR) -lpd; cp $(OBJ_DIR)/pd-watchdog.exe $
(BIN_DIR)
$(STRIP) -s $(BIN_DIR)/pd-watchdog.exe
$(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend
u_pdsend.c @WINSOCK@
$(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR)
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c
$(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive
u_pdreceive.c @WIN SOCK@
+#$(PDEXEC): $(OBJ) $(BIN_DIR) +# cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) $(CYGFLAGS) -o $ (PDEXEC) $(OB J) \ +# $(LIB)
$(PDEXEC): $(OBJ) $(BIN_DIR)
cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $
(OBJ) \
$(LIB)
cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -mwindows $(LDFLAGS) $
(DBG_CFLAGS) -o $ (PDEXEC) s_entry.o $(LIB) \
-L$(BIN_DIR) -lpd
$(STRIP) -s $(PDEXEC)
$(BIN_DIR)/pd-gui: $(GOBJ) $(GSRC)
cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
cd $(OBJ_DIR); $(CC) $(CYGFLAGS) -o $(BIN_DIR)/$(GUINAME) $
(GOBJ) \ $(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk @@ -136,7 +155,7 @@
#this is for Max OSX only... $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
cd ../obj && $(CC) $(CFLAGS) -dynamiclib -read_only_relocs
warning \
cd $(OBJ_DIR) && $(CC) $(CFLAGS) -dynamiclib -
read_only_relocs warning \ -o $(BIN_DIR)/libPdTcl.dylib $(GOBJ) \ -F@TCLTK_FRAMEWORKS_PATH@ \ -framework Tcl -framework Tk -framework System \ @@ -147,12 +166,18 @@ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?)
+# this is for mingw /cygwin $(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)
cd $(BIN_DIR); dllwrap -mno-cygwin --export-all-symbol --
output-def pd tcl.def \
--output-lib=pdtcl.a --dllname=pdtcl.dll $(OBJ_DIR)/
t_tkcmd.o $(LIB) $(G LIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
+$(BIN_DIR)/$(PDDLL): $(OBJ) $(ASIOOBJ)
cd $(OBJ_DIR); $(CXX) -shared $(LDFLAGS) -o $(PDDLL) $
(CYGFLAGS) $(OBJ) $(ASIOOBJ) $(LIB) \
-Wl,--export-all-symbols -Wl,--out-implib=pd.a;
$(STRIP) $(OBJ_DIR)/$(PDDLL)
cp $(OBJ_DIR)/$(PDDLL) $(BIN_DIR)
externs: cd ../extra/bonk~;make @EXTERNTARGET@ cd ../extra/choice;make @EXTERNTARGET@ @@ -203,17 +228,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~
-(cd ../doc/6.externs; rm -f *.pd_linux)
-(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"`
-rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +255,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
$(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
=======================================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-04 06:54:56.765625000 +0100 @@ -21,6 +21,9 @@ AC_SUBST(OSNUMBER) AC_SUBST(EXTERNTARGET) AC_SUBST(ASIOSRC) +AC_SUBST(CYGFLAGS) +AC_SUBST(WINSOCK) +AC_SUBST(WINEXE)
dnl other defaults
@@ -179,7 +182,7 @@ AC_CHECK_LIB(jack,jack_set_xrun_callback,LIBS="$LIBS - ljack";jack=xrun, jack=no) AC_CHECK_LIB(jack,jack_set_error_function,LIBS="$LIBS - ljack";jack=yes, jack=no) fi
- PD="pd" LDFLAGS="-Wl,-export-dynamic" if test "$static" = "yes"; then LDFLAGS="$LDFLAGS -static"
@@ -231,6 +234,7 @@ binarymode="-m4755" fi STRIPFLAG=-s
GUINAME="pd-gui" if test x$USE_DEBUG_CFLAGS == "xyes"; thenWINSOCK=""
@@ -299,6 +303,7 @@ ../portmidi/pm_common/portmidi.c \ ../portmidi/porttime/ptmacosx_cf.c " STRIPFLAG=""
GUINAME="libPdTcl.dylib"WINSOCK=""
# find the Tcl/Tk Frameworks @@ -334,14 +339,16 @@ LDFLAGS=$LDFLAGS" -weak_framework Jack" fi fi
+WINEXE= # only Windows uses ASIO, for the rest, set to blank ASIOSRC=
+# only cygwin needs this flag +CYGFLAGS= if test `uname -s` == MINGW32_NT-5.0; then EXT=dll
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -
DPD_INTERNAL \
WINEXE=".exe"
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -
DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -364,10 +371,48 @@ ../portaudio/pa_asio/pa_asio.cpp ../asio/asio.cpp \ ../asio/asiodrivers.cpp ../asio/asiolist.cpp" STRIPFLAG="--strip-unneeded"
- GUINAME="pdtcl.dll"
WINSOCK=" -lwsock32"
- GUINAME="pd.dll" GUIFLAGS=
fi
+if test `uname -s` == CYGWIN_NT-5.1 || test `uname -s` == CYGWIN_NT-5.0 || test `uname -s` == CYGWIN_NT-6.0; +then
- EXT=dll
WINEXE=".exe"
- MORECFLAGS="-mno-cygwin -DPD -DNT -DUSEAPI_PORTAUDIO -
DUSEAPI_MMIO -DPA_LIT TLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL \
- -I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portaudio/pa_asio -I../asio \
- -mms-bitfields "$MORECFLAGS
- CYGFLAGS="-mno-cygwin"$CYGFLAGS
- PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -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 \
../portaudio/pa_win_ds/pa_win_ds.c \
../portaudio/pa_win_ds/dsound_wrapper.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"
WINSOCK="-lwsock32"
- GUINAME="pdtcl.dll"
- GUIFLAGS=
+fi # support for jack, on either linux or darwin:
if test x$jack == "xyes";
======================================================================
Now the problem is the one I've described before, pd.exe is mysteriously linked to cygwin1.dll, if I rename pdtcl.dll, an error message pops up to say something like it couldn't find "pthread_cond_destroy".
======================================================================
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -M g_canvas.c
...*snip*....
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/t_main.o t_main.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_main.c:18: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/t_tkcmd.o t_tkcmd.c In file included from /cygdrive/c/Mingw/include/tk.h:96, from t_tkcmd.c:42: /cygdrive/c/Mingw/include/X11/Xlib.h:140: attention : la d'eclaration de fonctio n n'est pas un prototype valide
...*snip*...
cd ../bin; dllwrap -mno-cygwin --export-all-symbol --output- def pdtcl.def \ --output-lib=pdtcl.a --dllname=pdtcl.dll ../obj/t_tkcmd.o - ldl -lm -lpth readGC2 -lwsock32 -lwinmm -lole32 -ltcl84 -ltk84 -lstdc++ -ltk84 - ltcl84 dllwrap: aucun fichier d'exportation de d'efinitions fourni. Cr'eation du fichier, mais il ne correspondra pas n'ecessairement `a ce que vous d'esirez. /usr/lib/gcc/i686-pc-mingw32/3.4.4/../../../../i686-pc-mingw32/bin/ ld: AVERTISSE MENT: ne peut trouver le symbole d'entr'ee __cygwin_dll_entry@12; utilise par d' efaut 6d081000
...*snip*...
cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter - Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_M MIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/includ e -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -DINSTALL_PREFIX= "/usr/loca l" -c -o ../obj/s_inter.o s_inter.c s_inter.c: In function `sys_startgui': s_inter.c:979: attention : le corps de la d'eclaration du if est vide
...*snip*...
d_ctl.c: In function `line_tilde_perform': d_ctl.c:110: attention : d'er'ef'erencement du pointeur type-punned brisera les strictes d'aliases
...*snip*...
../portaudio/pa_win_wmme/pa_win_wmme.c: In function `PaWinMme_Initialize': ../portaudio/pa_win_wmme/pa_win_wmme.c:814: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c:849: attention : type sign'e et non sign' e dans une expression conditionnelle ../portaudio/pa_win_wmme/pa_win_wmme.c: In function `OpenStream': ../portaudio/pa_win_wmme/pa_win_wmme.c:1976: attention : << framesPerBufferProce ssorCall >> pourrait ^etre utilis'e sans ^etre initialis'e dans cette fonction
...*snip*...
../portaudio/pa_win_ds/pa_win_ds.c:380: attention : (pr`es de l'initialisation d e << IID_IRolandVSCEmulated1.Data4 >>) ../portaudio/pa_win_ds/pa_win_ds.c:381: attention : accolades manquantes autour de l'initialisation
...*snip*...
g++ -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- unused-parameter -Wno-parentheses -Wno-switch -mno-cygwin -DPD -DNT - DUSEAPI_PORTAUDIO -DUSEAPI_ MMIO -DPA_LITTLE_ENDIAN -DMSW -DPA19 -DPD_INTERNAL -I/cygdrive/c/ Mingw/inclu de -L/cygdrive/c/Mingw/lib -I../portaudio/pa_common -I../ portaudio/pablio - I../portaudio/pa_asio -I../asio -mms-bitfields -c -o ../obj/../ portaudio/pa _asio/pa_asio.o ../portaudio/pa_asio/pa_asio.cpp cc1plus: attention : l'option de la ligne de commande "-Wstrict- prototypes" est valide pour Ada/C/ObjC mais pas pour C++
...*snip*...
make[1]: entrant dans le r'epertoire << /home/pat/pdextended/pd- extended/pd-exte nded/pd/extra/bonk~ >> cl /W3 /WX /DNT /DPD /nologo /I. /I....\src /I"C:\Program Files \Microsoft Visua l Studio\Vc98"\include /c bonk~.c /bin/sh: cl: command not found make[1]: *** [bonk~.dll] Erreur 127
===========================================================
Ciao;
------------------------------------------------------------------------ ----
The arc of history bends towards justice. - Dr. Martin Luther King, Jr.
On Dec 2, 2007, at 7:16 PM, Patrice Colet wrote:
Hello!
I've added -mno-cygwin and -I/cygdrive/c/Mingw/include -L/cygdrive/ c/Mingw/lib because:
1° The __WIN32 flag doesn't work with cygwin
Cygwin isn't a WIN32 platform, technically, so it doesn't define _WIN32. And careful about the exact spelling, it has to have only one leading underscore. Here's a bit more on this topic:
http://lists.boost.org/Archives/boost/2004/07/68241.php
Well, I can understand being annoyed by this, but it is possible, given enough time ;). I think the best outcome would be to be able to build the MinGW version using the Cygwin tools (i.e. -mno- cygwin.). The msys shell and tools is limited comparitively.
But something that is very useful and quite a bit easier would be getting the ./configure stuff to work in the MinGW shell so we can have a unified build interface. It's very close, I've gotten it to build like that a couple of years ago.
.hc
2° there is a cruel conflict with errno.h cygwin version.
So it's not possible to compile with cygwin without mingw, unless using voodoo...
Also the dllwrap doesn't seem to work good with cygwin, because the built pd.exe is linked to cygwin1.dll (with using cygwin only), else, I suspect that it causes many other errors, see an example of error it might cause below (after the diffs), I just suppose that we can't use both a def file (see dllwrap) and dll<import/export> (see m_pd.h), obviously I might be wrong (it won't be surprising).
===================================================================
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-03 00:04:37.578125000 +0100 @@ -341,7 +341,7 @@ if test `uname -s` == MINGW32_NT-5.0; then EXT=dll
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 -DMSW -DPA_NO_DS -
DPD_INTERNAL \
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DUSEAPI_PORTMIDI -DPA19 -DMSW -
DPA_NO_DS -D PD_INTERNAL \ -I../portaudio/pa_common -I../portaudio/pablio \ -mwindows -mms-bitfields "$MORECFLAGS PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" @@ -368,6 +368,49 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1; +then
- EXT=dll
- MORECFLAGS="-mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN
-DPA19 \
-I/cygdrive/c/Mingw/include -L/cygdrive/c/Mingw/lib \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portaudio/pa_asio \
-I../portmidi/pm_common -I../portmidi/porttime \
-I../portmidi/pm_win -I../portmidi/pm_win_ds \
- -mms-bitfields "$MORECFLAGS
- PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++"
- SYSSRC="s_midi_pm.c \
s_audio_pa.c s_audio_pablio.c s_audio_paring.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 \
../portaudio/pa_win_ds/pa_win_ds.c \
../portaudio/pa_win_ds/dsound_wrapper.c \
../portmidi/pm_common/pmutil.c \
../portmidi/pm_common/portmidi.c \
../portmidi/pm_win/pmdll.c \
../portmidi/pm_win/pmwin.c \
../portmidi/pm_win/pmwinmm.c \
../portmidi/porttime/ptwinmm.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";
==================================================================== $ diff -uw makefile.in.old makefile.in --- makefile.in.old 2007-11-04 23:08:24.000000000 +0100 +++ makefile.in 2007-12-03 00:54:34.750000000 +0100 @@ -12,6 +12,10 @@ EXT= @EXT@ GUINAME= @GUINAME@
+PDEXEC_WIN = pd.exe +GUINAME_WIN = pdtcl.dll +DLLWRAP= dllwrap
prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -49,6 +53,8 @@
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 \ @@ -147,9 +153,15 @@ @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \ ../bin/libPdTcl.dylib
-# this is for Windows/MinGW (only?) +# this is for cygwin +#$(BIN_DIR)/pdtcl.dll: $(GOBJ) +# cd $(BIN_DIR); echo EXPORTS > pdtcl.def +# nm pdtcl.dll | grep ' T _' | sed 's/.* T _//' >> pdtcl.def +# dlltool --def pdtcl.def --dllname pdtcl.dll --output-lib pdtcl.a
+# this is for mingw $(BIN_DIR)/pdtcl.dll: $(GOBJ)
cd $(BIN_DIR); dllwrap --export-all-symbols --output-def
pdtcl.def \
dllwrap --export-all-symbol --output-def pdtcl.def \ --output-lib=pdtcl.a --dllname=$(GUINAME) $(OBJ_DIR)/
t_tkcmd.o $(LIB) $( GLIB) strip --strip-unneeded $(BIN_DIR)/pdtcl.dll
@@ -203,17 +215,18 @@ @echo "Pd install succeeded."
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 -rm -f `find ../portaudio -name "*.o"` -rm -f *~
-(cd ../doc/6.externs; rm -f *.pd_linux)
-(cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) -rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies
extra-clean: -rm -f `find ../extra/ -name "*.pd_*"`
-rm -f `find ../extra/ -name "*.dll*"` -rm -f tags
clean: extra-clean local-clean @@ -229,7 +242,7 @@ depend: makefile.dependencies
makefile.dependencies: makefile
$(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
$(CC) $(CFLAGS) -M $(SRC) > makefile.dependencies
uninstall: rm -f -r $(libpddir)
====================================================================== =
$ diff -uw d_array.c.old d_array.c --- d_array.c.old 2007-11-04 23:08:24.000000000 +0100 +++ d_array.c 2007-12-03 00:31:56.453125000 +0100 @@ -507,7 +507,7 @@ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */
-#ifdef MSW +#ifdef __WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1
#define LOWOFFSET 0
$ diff -uw d_osc.c.old d_osc.c --- d_osc.c.old 2007-01-19 07:37:56.000000000 +0100 +++ d_osc.c 2007-12-02 22:05:43.343750000 +0100 @@ -7,7 +7,6 @@
#include "m_pd.h" #include "math.h"
#define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
/* machine-dependent definitions. These ifdefs really
@@ -19,7 +18,7 @@ #define int32 long /* a data type that has 32 bits */ #endif /* IRIX */
-#ifdef MSW +#ifdef __WIN32 /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1
#define LOWOFFSET 0
$ diff -uw g_canvas.c.old g_canvas.c --- g_canvas.c.old 2007-12-02 22:49:55.265625000 +0100 +++ g_canvas.c 2007-12-02 22:50:44.156250000 +0100 @@ -757,7 +757,7 @@ /* test if we're already visible and toplevel */ if (x->gl_editor) { /* just put us in front */ -#ifdef MSW +#ifdef __WIN32 canvas_vis(x, 0); canvas_vis(x, 1);
#else
$ diff -uw m_binbuf.c.old m_binbuf.c --- m_binbuf.c.old 2007-12-02 22:27:03.531250000 +0100 +++ m_binbuf.c 2007-12-02 22:27:44.453125000 +0100 @@ -10,7 +10,7 @@ #ifdef UNISTD #include <unistd.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <io.h> #endif #include <fcntl.h> @@ -697,7 +697,7 @@ static int binbuf_doopen(char *s, int mode) { char namebuf[MAXPDSTRING]; -#ifdef MSW +#ifdef __WIN32 mode |= O_BINARY; #endif sys_bashfilename(s, namebuf); ================================================================== $ diff -uw m_glob.c.old m_glob.c --- m_glob.c.old 2007-12-01 20:36:16.671875000 +0100 +++ m_glob.c 2007-12-01 22:32:12.468750000 +0100 @@ -35,7 +35,7 @@ void alsa_resync( void);
-#ifdef MSW +#ifdef _WIN32 void glob_audio(void *dummy, t_floatarg adc, t_floatarg dac);
#endif
$ diff -uw m_pd.h.old m_pd.h --- m_pd.h.old 2007-12-02 22:43:07.109375000 +0100 +++ m_pd.h 2007-12-03 00:02:57.578125000 +0100 @@ -13,10 +13,10 @@ #define PD_BUGFIX_VERSION 3 #define PD_TEST_VERSION "extended-20071104"
-/* old name for "MSW" flag -- we have to take it for the sake of many old -"nmakefiles" for externs, which will define NT and not MSW */ -#if defined(NT) && !defined(MSW) -#define MSW +/* old name for "__WIN32" flag -- we have to take it for the sake of many old +"nmakefiles" for externs, which will define NT and not __WIN32 */ +#if defined(NT) && !defined(__WIN32) +#define __WIN32 #endif
/* These pragmas are only used for MSVC, not MinGW or Cygwin hans@at.or.at */
@@ -27,8 +27,8 @@ #pragma warning( disable : 4101 ) /* unused automatic variables */ #endif /* _MSC_VER */
- /* the external storage class is "extern" in UNIX; in MSW it's
ugly. */ -#ifdef MSW
- /* the external storage class is "extern" in UNIX; in __WIN32
it's ugly. */
+#ifdef __WIN32 #ifdef PD_INTERNAL #define EXTERN __declspec(dllexport) extern #else @@ -36,7 +36,7 @@ #endif /* PD_INTERNAL */ #else #define EXTERN extern -#endif /* MSW */ +#endif /* __WIN32 */
/* and depending on the compiler, hidden data structures are declared differently: */
====================================================================== $ diff -uw s_stuff.h.old s_stuff.h --- s_stuff.h.old 2007-11-04 23:08:24.000000000 +0100 +++ s_stuff.h 2007-12-02 22:34:13.375000000 +0100 @@ -181,7 +181,7 @@ #define API_DEFAULT API_OSS #define API_DEFSTRING "OSS" #endif -#ifdef MSW +#ifdef __WIN32 #define API_DEFAULT API_MMIO #define API_DEFSTRING "MMIO" #endif @@ -201,7 +201,7 @@ #define DEFMIDIDEV 0
#define DEFAULTSRATE 44100 -#ifdef MSW +#ifdef __WIN32 #define DEFAULTADVANCE 70 #else #define DEFAULTADVANCE 50 @@ -282,8 +282,8 @@ typedef void (*t_printhook)(const char *s); extern t_printhook sys_printhook; /* set this to override printing */ extern int sys_printtostderr; -#ifdef MSW -#define vsnprintf _vsnprintf /* jsarlo -- alias this name for msw */ +#ifdef __WIN32 +#define vsnprintf _vsnprintf /* jsarlo -- alias this name for __WIN32 */ #endif
/* jsarlo { */
== $ diff -uw t_tkcmd.c.old t_tkcmd.c --- t_tkcmd.c.old 2007-12-02 03:11:59.500000000 +0100 +++ t_tkcmd.c 2007-12-03 00:52:53.640625000 +0100 @@ -2,7 +2,7 @@
- For information on usage and redistribution, and for a
DISCLAIMER OF ALL
- WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-#ifndef MSW /* in unix this only works first; in MSW it only works last. */
+#ifndef __WIN32 /* in unix this only works first; in __WIN32 it only works last. */ #include "tk.h" #endif
@@ -13,7 +13,7 @@ #include <stdarg.h> #include <sys/types.h>
-#ifndef MSW +#ifndef __WIN32 #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> @@ -26,7 +26,7 @@ #include <errno.h> #include <fcntl.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <winsock.h> #include <io.h> #endif @@ -38,7 +38,7 @@ #pragma warning( disable : 4101 ) /* unused local variables */ #endif
-#ifdef MSW +#ifdef __WIN32 #include "tk.h" #endif
@@ -87,10 +87,10 @@
static void pdgui_sockerror(char *s) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); #endif -#ifndef MSW +#ifndef __WIN32 int err = errno; #endif
@@ -229,7 +229,7 @@ } }
-#ifdef MSW +#ifdef __WIN32 /* if we're in Gatesland, we add a tcl command to poll the socket for data. */ static int pd_pollsocketCmd(ClientData cd, Tcl_Interp *interp, @@ -242,7 +242,7 @@
static void pd_sockerror(char *s) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); if (err == 10054) return; else if (err == 10044) @@ -261,12 +261,12 @@ { struct sockaddr_in server; struct hostent *hp; -#ifndef MSW +#ifndef __WIN32 int retry = 10; #else int retry = 1; #endif -#ifdef MSW +#ifdef __WIN32 short version = MAKEWORD(2, 0); WSADATA nobby;
@@ -307,7 +307,7 @@ retry. */ else { -#ifndef MSW +#ifndef __WIN32 fd_set readset, writeset, exceptset; struct timeval timout;
@@ -319,16 +319,16 @@ fprintf(stderr, "retrying connect...\n"); if (select(1, &readset, &writeset, &exceptset, &timout) < 0) perror("select"); -#endif /* !MSW */ +#endif /* !__WIN32 */ } } pdgui_sockerror("connecting stream socket"); gotit: ; -#ifndef MSW
/* normally we ask TK to call us back; but in MSW we have
to poll. */ +#ifndef __WIN32
/* normally we ask TK to call us back; but in __WIN32 we
have to poll. */ Tk_CreateFileHandler(sockfd, TK_READABLE | TK_EXCEPTION, pd_readsocket, 0); -#endif /* !MSW */ +#endif /* !__WIN32 */ }
#ifdef STARTGUI @@ -351,7 +351,7 @@ int ntry = 0, portno = FIRSTPORTNUM; int xsock = -1; char morebuf[256]; -#ifdef MSW +#ifdef __WIN32 short version = MAKEWORD(2, 0); WSADATA nobby; char scriptbuf[1000], wishbuf[1000], portbuf[80]; @@ -376,7 +376,7 @@ fprintf(stderr, "pdbuf is %s\n", pdbuf); #endif
-#ifdef MSW +#ifdef __WIN32 if (WSAStartup(version, &nobby)) pd_sockerror("WSAstartup"); #endif @@ -398,7 +398,7 @@ /* name the socket */ while (bind(xsock, (struct sockaddr *)&server, sizeof(server)) < 0) { -#ifdef MSW +#ifdef __WIN32 int err = WSAGetLastError(); #else int err = errno; @@ -440,7 +440,7 @@ } #endif /* UNISTD */
-#ifdef MSW +#ifdef __WIN32
#error not yet used.... sys_bashfilename() not filled in here
@@ -458,7 +458,7 @@ return; }
-#endif /* MSW */ +#endif /* __WIN32 */
#ifdef DEBUGCONNECT fprintf(stderr, "Waiting for connection request... \n"); @@ -470,18 +470,18 @@ fprintf(stderr, "... connected\n"); #endif
-#ifndef MSW
/* normally we ask TK to call us back; but in MSW we have
to poll. */ +#ifndef __WIN32
/* normally we ask TK to call us back; but in __WIN32 we
have to poll. */ Tk_CreateFileHandler(sockfd, TK_READABLE | TK_EXCEPTION, pd_readsocket, 0); -#endif /* !MSW */ +#endif /* !__WIN32 */ }
#endif /* STARTGUI */
static void pdgui_setupsocket(void) { -#ifdef MSW +#ifdef __WIN32 pdgui_connecttosocket(); #else if (pd_portno) @@ -545,10 +545,10 @@ } }
- /* in linux, we load the tk code from here (in MSW and MACOS,
this
- /* in linux, we load the tk code from here (in __WIN32 and
MACOS, this is done by passing the name of the file as a startup argument to the wish shell.) */ -#if !defined(MSW) && !defined(__APPLE__) +#if !defined(__WIN32) && !defined(__APPLE__) void pdgui_doevalfile(Tcl_Interp *interp, char *s) { char buf[GUISTRING]; @@ -580,18 +580,18 @@ /* add our own TK commands */ Tcl_CreateCommand(interp, "pd", (Tcl_CmdProc*)pdCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); -#ifdef MSW +#ifdef __WIN32 Tcl_CreateCommand(interp, "pd_pollsocket",(Tcl_CmdProc*) pd_pollsocketCmd,
(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
#endif pdgui_setupsocket(); /* read in the startup file */ -#if !defined(MSW) && !defined(__APPLE__) +#if !defined(__WIN32) && !defined(__APPLE__) pdgui_evalfile("pd.tk"); #endif }
-#ifndef MSW +#ifndef __WIN32 void pdgui_setname(char *s) { char *t; @@ -619,11 +619,11 @@ { const char *argv = Tcl_GetVar(interp, "argv", 0); int portno, argno = 0;
/* argument passing seems to be different in MSW as
opposed to
/* argument passing seems to be different in __WIN32 as
opposed to unix-likes. Here we check if we got sent a "port number" as an argument. If so. we're to connect to a previously running pd (i.e., pd got started first). If not, we start Pd from here. */ -#ifdef MSW +#ifdef __WIN32 if (argv && (portno = atoi(argv)) > 1) #else char *firstspace; ==================================================================== $ diff -uw x_list.c.old x_list.c --- x_list.c.old 2007-12-02 21:47:52.312500000 +0100 +++ x_list.c 2007-12-02 21:47:16.187500000 +0100 @@ -4,7 +4,7 @@
#include "m_pd.h" /* #include <string.h> */ -#ifdef MSW +#ifdef __WIN32 #include <malloc.h> #else
#include <alloca.h>
= $ diff -uw x_net.c.old x_net.c --- x_net.c.old 2007-12-02 21:37:51.468750000 +0100 +++ x_net.c 2007-12-02 21:45:07.453125000 +0100 @@ -9,7 +9,7 @@
#include <sys/types.h> #include <string.h> -#ifdef MSW +#ifdef __WIN32 #include <winsock.h> #else
#include <sys/socket.h>
$ diff -uw x_qlist.c.old x_qlist.c --- x_qlist.c.old 2007-12-02 21:48:07.875000000 +0100 +++ x_qlist.c 2007-12-02 21:45:46.921875000 +0100 @@ -7,7 +7,7 @@ #ifdef UNISTD #include <unistd.h> #endif -#ifdef MSW +#ifdef __WIN32 #include <io.h>
#endif
$ make distclean && autoconf && ./configure && make rm -f `find ../extra/ -name "*.pd_*"` rm -f tags rm -f ../obj/* ../bin/pd ../bin/pdtcl.dll ../bin/pdsend \ ../bin/pdreceive ../bin/pd-watchdog m_stamp.c rm: ne peut enlever `../obj/CVS': Is a directory make: [local-clean] Erreur 1 (ignor'ee) rm -f `find ../portaudio -name "*.o"` rm -f *~ (cd ../doc/6.externs; rm -f *.pd_linux; rm -f *.dll) rm -f makefile.dependencies touch makefile.dependencies chmod 666 makefile.dependencies rm -f config.cache config.log config.status makefile tags \ autom4te.cache/output.* autom4te.cache/traces.* autom4te.cache/r equests rmdir autom4te.cache rm -rf autom4te-*.cache checking for gcc... gcc checking for C compiler default output file name... a.exe checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... .exe checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /usr/bin/install -c checking whether make sets $(MAKE)... yes checking how to run the C preprocessor... gcc -E checking for an ANSI C-conforming const... yes checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for pid_t... yes checking for size_t... yes checking whether time.h and sys/time.h may both be included... yes checking for ANSI C header files... (cached) yes checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking malloc.h usability... yes checking malloc.h presence... yes checking for malloc.h... yes checking sys/ioctl.h usability... yes checking sys/ioctl.h presence... yes checking for sys/ioctl.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking bstring.h usability... no checking bstring.h presence... no checking for bstring.h... no checking whether gcc needs -traditional... no checking return type of signal handlers... void checking for vprintf... yes checking for _doprnt... no checking for gettimeofday... yes checking for select... yes checking for socket... yes checking for strerror... yes checking for working alloca.h... yes checking for alloca... yes checking for dlopen in -ldl... yes checking for sin in -lffm... no checking for sin in -lm... yes checking for pthread_create in -lpthread... no checking for pthread_create in -lpthreadGC2... yes checking tcl.h usability... yes checking tcl.h presence... yes checking for tcl.h... yes checking for main in -ltcl85... no checking for main in -ltcl8.5... no checking for main in -ltcl84... yes checking for main in -ltk85... no checking for main in -ltk8.5... no checking for main in -ltk84... yes checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... no configure: creating ./config.status config.status: creating makefile config.status: WARNING: makefile.in seems to ignore the -- datarootdir setting cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- parentheses -Wno-s witch -mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -I/ cygdr ive/c/Mingw/include -L/cygdrive/c/Mingw/lib -I../portaudio/ pa_common -I../po rtaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm_common - I../portmidi/po rttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms- bitfields -M g_ca nvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c g_scalar.c g_t raversal.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 g_toggle.c g_vdial.c g_vslider.c g_vumete r.c m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c m_conf.c m_glob.c m_ sched.c s_main.c s_inter.c s_file.c s_print.c s_loader.c s_path.c s_entry.c s_au dio.c s_midi.c d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc .c d_math.c d_fft.c d_array.c d_global.c d_delay.c d_resample.c x_arithmetic.c x _connective.c x_interface.c x_midi.c x_misc.c x_time.c x_acoustics.c x_net.c x_q list.c x_gui.c x_list.c d_soundfile.c s_midi_pm.c s_audio_pa.c s_audio_pab lio.c s_audio_paring.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_c ommon/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_w in/pa_win_util.c ../portaudio/pa_win/ pa_win_hostapis.c . ./portaudio/pa_win_wmme/pa_win_wmme.c ../portaudio/pa_win_ds/ pa_win_ds. c ../portaudio/pa_win_ds/dsound_wrapper.c ../p ortmidi/pm_common/pmutil.c ../portmidi/pm_common/ portmidi.c ../portmidi/pm_win/pmdll.c ../portmidi/pm_win/p mwin.c ../portmidi/pm_win/pmwinmm.c ../p ortmidi/porttime/ptwinmm.c d_fft_mayer.c d_fftroutine.c > makefile.dependencies cc -g -O2 -DPD -Wall -W -Wstrict-prototypes -Wno-unused -Wno- parentheses -Wno-s witch -mno-cygwin -DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 -I/ cygdr ive/c/Mingw/include -L/cygdrive/c/Mingw/lib -I../portaudio/ pa_common -I../po rtaudio/pablio -I../portaudio/pa_asio -I../portmidi/pm_common - I../portmidi/po rttime -I../portmidi/pm_win -I../portmidi/pm_win_ds -mms- bitfields -DINSTA LL_PREFIX="/usr/local" -c -o ../obj/g_canvas.o g_canvas.c g_canvas.c:58: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:59: erreur: un 'el'ement de l'initialisation n'est pas une constante g_canvas.c:574: attention : << canvas_makebindsym >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:677: attention : << canvas_redraw >> d'efini localement apr`es avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:749: attention : << canvas_vis >> d'efini localement apr`es avoir 'et 'e r'ef'erenc'e avec lien dllimport. g_canvas.c:847: attention : << glist_isvisible >> d'efini localement apr`es avoi r 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:852: attention : << glist_istoplevel >> d'efini localement apr`es avo ir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1043: attention : << canvas_loadbang >> d'efini localement apr`es avo ir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1221: attention : << canvas_isabstraction >> d'efini localement apr`e s avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1252: attention : << canvas_getrootfor >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1344: attention : << canvas_suspend_dsp >> d'efini localement apr`es avoir 'et'e r'ef'erenc'e avec lien dllimport. g_canvas.c:1351: attention : << canvas_resume_dsp >> d'efini localement apr`es a voir 'et'e r'ef'erenc'e avec lien dllimport. make: *** [g_canvas.o] Erreur 1
======================================================================
I have to give up for the moment, even if I've just replaced MSW with __WIN32 and added a few lines of codes to configure.in and makefile.in, it took me too much time for no satisfying results.
Let the sun be with you, Patko.
------------------------------------------------------------------------ ----
I have the audacity to believe that peoples everywhere can have three meals a day for their bodies, education and culture for their minds, and dignity, equality and freedom for their spirits. - Martin Luther King, Jr.
Martin Peach a écrit :
Patrice Colet wrote:
Hans-Christoph Steiner a écrit :
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff -uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
Okay, let's start with these diff (I might have reversed the new and the old file, sorry for that, also I'll make separated diff files when make will run smoothly) and after that, there is my last error message (I didn't go further because s_inter.c seems linked to s_midi.c by the sys_close_midi() function, and I don't get how to deal with it) :
$ diff -uw d_osc.c d_osc.c.old --- d_osc.c 2007-12-01 06:02:38.218750000 +0100 +++ d_osc.c.old 2007-01-19 07:37:56.000000000 +0100
Yes that's a backwards diff...
s_inter.o: dans la fonction << sys_bail >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_inter.c:1276: r'ef'erence ind'efinie vers << _sys_close_midi >>
sys_close_midi has several incarnations but you must choose one. The MSW version uses portmidi, so if you can build portmidi then use s_midi_pm.c by specifying it in the makefile.
I've just modified configure.in by adding those lines:
if test `uname -s` == CYGWIN_NT-5.1; then EXT=dll MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 \ -I../portaudio/pa_common -I../portaudio/pablio \ -I../portmidi/pm_common -I../portmidi/porttime \ -I../portmidi/pm_win -I../portmidi/pm_win_ds \ -mms-bitfields "$MORECFLAGS
PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++"
SYSSRC="s_midi_pm.c \ s_audio_pa.c s_audio_pablio.c s_audio_paring.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 \ ../portaudio/pa_win_ds/pa_win_ds.c \ ../portmidi/pm_common/pmutil.c \ ../portmidi/pm_common/portmidi.c \ ../portmidi/pm_win/pmdll.c \ ../portmidi/pm_win/pmwin.c \ ../portmidi/pm_win/pmwinmm.c \ ../portmidi/porttime/ptwinmm.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
And the problem I'm encountering right now could engage a big discussion, I hope the solution is simplier than the one I'm figuring out. The compiler needs DSound.h, so I have to download the complete directx SDK for having this header included, and then having possibility of using directsound in pd, once downloaded I would like to put this header file into the portaudio/pa_win_ds directory, what do you thing about this?
On Dec 1, 2007, at 5:42 PM, Patrice Colet wrote:
Martin Peach a écrit :
Patrice Colet wrote:
Hans-Christoph Steiner a écrit :
That stuff wasn't removed from Pd, but instead never made it into Miller's sources. If you get this running smoothly, then I think it is likely to be included by Miller. The big thing to do would be to make the ./configure && make work on Cygwin, then we'll have a unified build system on all platforms.
One tip, when posting changes to code, you should post a "diff - uw", otherwise it's hard to tell what you have changed. I don't think anyone here has s_midi.c memorized, but I could be wrong ;).
Post the errors that you were getting before adding s_stuff.h and that will be easier to troubleshoot.
Okay, let's start with these diff (I might have reversed the new and the old file, sorry for that, also I'll make separated diff files when make will run smoothly) and after that, there is my last error message (I didn't go further because s_inter.c seems linked to s_midi.c by the sys_close_midi() function, and I don't get how to deal with it) :
$ diff -uw d_osc.c d_osc.c.old --- d_osc.c 2007-12-01 06:02:38.218750000 +0100 +++ d_osc.c.old 2007-01-19 07:37:56.000000000 +0100
Yes that's a backwards diff...
s_inter.o: dans la fonction << sys_bail >>: /home/pat/pdextended/pd-extended/pd-extended/pd/src/s_inter.c: 1276: r'ef'erence ind'efinie vers << _sys_close_midi >>
sys_close_midi has several incarnations but you must choose one. The MSW version uses portmidi, so if you can build portmidi then use s_midi_pm.c by specifying it in the makefile.
I've just modified configure.in by adding those lines:
if test `uname -s` == CYGWIN_NT-5.1; then EXT=dll MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 \ -I../portaudio/pa_common -I../portaudio/pablio \ -I../portmidi/pm_common -I../portmidi/porttime \ -I../portmidi/pm_win -I../portmidi/pm_win_ds \ -mms-bitfields "$MORECFLAGS
PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" SYSSRC="s_midi_pm.c \ s_audio_pa.c s_audio_pablio.c s_audio_paring.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 \ ../portaudio/pa_win_ds/pa_win_ds.c \ ../portmidi/pm_common/pmutil.c \ ../portmidi/pm_common/portmidi.c \ ../portmidi/pm_win/pmdll.c \ ../portmidi/pm_win/pmwin.c \ ../portmidi/pm_win/pmwinmm.c \ ../portmidi/porttime/ptwinmm.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
A "diff -uw" patch of this would be very helpful since it includes the line information and can be applied automatically.
And the problem I'm encountering right now could engage a big discussion, I hope the solution is simplier than the one I'm figuring out. The compiler needs DSound.h, so I have to download the complete directx SDK for having this header included, and then having possibility of using directsound in pd, once downloaded I would like to put this header file into the portaudio/pa_win_ds directory, what do you thing about this?
A lot of the DirectX headers are available under a free license from MinGW/WINE/Cygwin. I see dshow.h, dxerr8.h, and dxerr9.h on the WinXP auto-build machine. Perhaps it's just a matter of finding them and installing them? I think those headers should be installed in the system rather than included in the Pd/portaudio source.
One other thing that would be nice to address is the different Cygwin defines. CYGWIN_NT-5.1 is for WinXP, CYGWIN_NT-5.0 is for Windows 2000, and I am guessing CYGWIN_NT-6.0 is for Vista.
.hc
------------------------------------------------------------------------ ----
Hans-Christoph Steiner a écrit :
A "diff -uw" patch of this would be very helpful since it includes the line information and can be applied automatically.
Okay sorry, here is my actual configure.in:
$ diff -uw configure.in.old configure.in --- configure.in.old 2007-11-04 23:08:24.000000000 +0100 +++ configure.in 2007-12-02 01:13:24.484375000 +0100 @@ -368,6 +368,48 @@ GUIFLAGS= fi
+if test `uname -s` == CYGWIN_NT-5.1; +then + EXT=dll + MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA_LITTLE_ENDIAN -DPA19 \ + -I../portaudio/pa_common -I../portaudio/pablio \ + -I../portaudio/pa_asio \ + -I../portmidi/pm_common -I../portmidi/porttime \ + -I../portmidi/pm_win -I../portmidi/pm_win_ds \ + -mms-bitfields "$MORECFLAGS + + PDLIB=$PDLIB" -lwsock32 -lwinmm -lole32 -lstdc++" + + SYSSRC="s_midi_pm.c \ + s_audio_pa.c s_audio_pablio.c s_audio_paring.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 \ + ../portaudio/pa_win_ds/pa_win_ds.c \ + ../portaudio/pa_win_ds/dsound_wrapper.c \ + ../portmidi/pm_common/pmutil.c \ + ../portmidi/pm_common/portmidi.c \ + ../portmidi/pm_win/pmdll.c \ + ../portmidi/pm_win/pmwin.c \ + ../portmidi/pm_win/pmwinmm.c \ + ../portmidi/porttime/ptwinmm.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";
A lot of the DirectX headers are available under a free license from MinGW/WINE/Cygwin. I see dshow.h, dxerr8.h, and dxerr9.h on the WinXP auto-build machine. Perhaps it's just a matter of finding them and installing them? I think those headers should be installed in the system rather than included in the Pd/portaudio source.
You've certainly figured like me that dsound.h is missing in w32api, I've also found some headers in here:
http://www.videolan.org/vlc/dx7headers.tgz
I've copied it into usr/include/w32api, and modified portaudio/pa_win_ds/dsound_wrapper because anywhere it is not DSound.h anymore:
$ diff dsound_wrapper.h.old dsound_wrapper.h 52c52 < #include <DSound.h> ---
#include "dsound.h"
One other thing that would be nice to address is the different Cygwin defines. CYGWIN_NT-5.1 is for WinXP, CYGWIN_NT-5.0 is for Windows 2000, and I am guessing CYGWIN_NT-6.0 is for Vista.
what about this? I haven't tried it yet:
if test `uname -s` == CYGWIN_NT-5.0 || CYGWIN_NT-5.1 || CYGWIN_NT-6.0;
Also, how could I resolve this:
pd/src/../portaudio/pa_win/pa_win_hostapis.c:(.data+0x8): r'ef'erence ind'efi nie vers << _PaAsio_Initialize >> collect2: ld a retourn'e 1 code d''etat d'ex'ecution make: *** [../bin/pd] Erreur 1
This reference is into pa_asio.cpp, I don't see what is the problem, like you can see into the configure file I tried to include the pa_asio directory, I've also tried to put $(ASIOOBJ) line before $(OBJ), but it has no effect at all.
++
pd-main/externals:
Compiled external for windows aka CYGWIN_NT-5.1
I couldn't build vorbis library, all other libs are okay.
Attached are the externals/Makefile and externals/OSCx/configure.in diff files
--- Makefile.old 2007-12-14 19:39:49.953125000 +0100 +++ Makefile 2007-12-15 04:36:08.171875000 +0100 @@ -46,7 +46,8 @@ CFLAGS = -DPD $(OPT_CFLAGS) -I$(pd_src)/src -Wall -W $(DEBUG_CFLAGS) LDFLAGS = LIBS = -lm - +CYGWIN_CFLAG = +CYGWIN_LD_FLAG = ifeq ($(OS_NAME),darwin) CFLAGS += -I/sw/include -DMACOSX -DUNIX -Dunix LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -L/sw/lib \ @@ -57,12 +58,17 @@ endif ifeq ($(OS_NAME),linux) CFLAGS += -DUNIX -Dunix -fPIC - LDFLAGS += -Wl,-export_dynamic -shared + LDFLAGS += -Wl,-export_dynamic -shared $(CYGWIN_CFLAG) LIBS += -lc DYLIB_LDFLAGS = $(LDFLAGS) STRIP = strip --strip-unneeded -R .note -R .comment endif ifeq ($(OS_NAME),windows) +ifeq (CYGWIN,$(findstring CYGWIN,$(UNAME))) + CYGWIN_CFLAG = -mno-cygwin -I/cygdrive/c/MinGW/include + CYGWIN_LIB = -L/cygdrive/c/MinGW/lib -mno-cygwin + LDFLAGS += -mno-cygwin +endif BUILDSRC_OS_NAME = win WINDOWS_HACKS = -D'O_NONBLOCK=1' -D'srand48(n)=srand((n))' \ -D'drand48()=((double)rand()/RAND_MAX)' -D'bzero(p,n)=memset(p,0,n)' @@ -70,12 +76,12 @@ # -D'PROT_READ=1' \ # -D'MAP_PRIVATE=2' \ # -D'O_NDELAY=O_NONBLOCK' - CFLAGS += -mms-bitfields -DMSW -DNT $(WINDOWS_HACKS) + CFLAGS += -mms-bitfields -DMSW -DNT $(WINDOWS_HACKS) $(CYGWIN_CFLAG) LDFLAGS += -shared # all of these included libs are part of libc in UNIX platforms. All except # libregex are in DLLs, so they get stripped from the external's .dll binary - LIBS += -L$(pd_src)/bin -L$(pd_src)/obj -lpd \ - -lwsock32 -lpthreadGC2 -lkernel32 -luser32 -lgdi32 -lregex + LIBS += -L$(pd_src)/bin $(CYGWIN_LIB) -L$(pd_src)/obj -lpd \ + -lwsock32 -lpthreadGC2 -lkernel32 -luser32 -lgdi32 -lregex $(CYGWIN_CFLAG) DYLIB_LDFLAGS = -shared STRIP = strip --strip-unneeded -R .note -R .comment endif @@ -85,7 +91,7 @@ ### C++ files %.$(EXTENSION): %.cpp %.$(EXTENSION): %.cc - $(CXX) $(CXXFLAGS) -o "$*.o" -c "$<" + $(CXX) $(CXXFLAGS) -o "$*.o" $(CYGWIN_CFLAG) -c "$<" $(CXX) $(LDFLAGS) -o "$*.$(EXTENSION)" "$*.o" $(LIBS) chmod a-x "$*.$(EXTENSION)" # $(STRIP) $*.$(EXTENSION) @@ -93,7 +99,7 @@
%.o: %.cpp %.o: %.cc - $(CXX) $(CXXFLAGS) -o "$*.o" -c "$<" + $(CXX) $(CXXFLAGS) -o "$*.o" $(CYGWIN_CFLAG) -c "$<"
### C files @@ -124,17 +130,17 @@ # # WARNING! this MUST be all on one line because the automatic package # building scripts rely on it being that way. -LIB_TARGETS = adaptive bassemu boids bsaylor creb cxc cyclone deprecated earplug ekext ext13 flashserver flatspace flib freeverb ggee hardware hcs iem_ambi iem_bin_ambi iemlib iemgui iem_adaptfilt iemmatrix iem_matrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders mapping markex maxlib mjlib moocow moonlib motex mrpeach msd oscx pan pdcontainer pddp pdogg pmpd sigpack smlib tkwidgets tof toxy unauthorized vbap zexy +LIB_TARGETS = adaptive bassemu boids bsaylor creb cxc cyclone deprecated earplug ekext ext13 flashserver flatspace flib freeverb ggee hardware hcs iem_ambi iem_bin_ambi iemlib iemgui iem_adaptfilt iemmatrix iem_matrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders mapping markex maxlib mjlib moocow moonlib motex mrpeach msd oscx pan pdcontainer pddp pmpd sigpack smlib tkwidgets tof toxy unauthorized vbap windowing zexy
# this is for libraries that don't compile (yet) on all platforms ifeq ($(OS_NAME),windows) LIB_TARGETS += else ifeq ($(OS_NAME),darwin) - LIB_TARGETS += hid hidio pdp pidip gem2pdp wiiremote iem16 + LIB_TARGETS += hid hidio pdp pidip gem2pdp wiiremote iem16 usbhid else # GNU/Linux, BSD, IRIX, etc. - LIB_TARGETS += hid hidio pdp pidip gem2pdp hdspm_mixer iem16 + LIB_TARGETS += hid hidio pdp pidip gem2pdp hdspm_mixer iem16 postlude endif endif
@@ -2071,6 +2077,7 @@ POSTLUDE_NAME=postlude # flib is separate, so exclude it here POSTLUDE_OBJECTS := $(wildcard $(externals_src)/postlude/[a-eg-z]*/src/*.c) +# $(externals_src)/postlude/psql/psql.c postlude: $(POSTLUDE_OBJECTS:.c=.$(EXTENSION))
postlude_install: postlude @@ -2079,8 +2086,10 @@ --author "Jamie Bullock" \ --license "GNU GPL" install -p $(POSTLUDE_OBJECTS:.c=.$(EXTENSION)) $(objectsdir)/$(POSTLUDE_NAME) + install -p $(externals_src)/postlude/dssi/doc/output~.pd \ + $(objectsdir)/$(POSTLUDE_NAME) install -d $(helpdir)/$(POSTLUDE_NAME) - install -p $(externals_src)/postlude/*/doc/help-*.pd \ + install -p $(externals_src)/postlude/*/doc/*-help.pd \ $(helpdir)/$(POSTLUDE_NAME) # install -d $(manualsdir)/$(POSTLUDE_NAME) # install -p $(externals_src)/postlude/manual.txt \ @@ -2088,8 +2097,8 @@ install -d $(readmesdir) install -p $(externals_src)/postlude/dssi/README \ $(readmesdir)/$(POSTLUDE_NAME)-dssi.txt - install -p $(externals_src)/postlude/getpatchname/README \ - $(readmesdir)/$(POSTLUDE_NAME)-getpatchname.txt + install -p $(externals_src)/postlude/psql/README \ + $(readmesdir)/$(POSTLUDE_NAME)-psql.txt install -d $(examplesdir)/$(POSTLUDE_NAME) # install -p $(externals_src)/postlude/examples/*.pd \ # $(examplesdir)/$(POSTLUDE_NAME) @@ -2439,6 +2448,44 @@
#------------------------------------------------------------------------------# +# WINDOWING +WINDOWING_NAME=windowing +WINDOWING_OBJECTS := $(wildcard $(externals_src)/windowing/*.c) +WINDOWING_SHARED := $(wildcard $(externals_src)/windowing/shared/*.c) +windowing_shared: $(WINDOWING_SHARED:.c=.o) +# $(CC) $(DYLIB_LDFLAGS) \ +# -o $(externals_src)/windowing/libwindowing.$(DYLIB_EXTENSION) \ +# $(WINDOWING_SHARED:.c=.o) + +windowing: windowing_shared $(WINDOWING_OBJECTS:.c=.$(EXTENSION)) + +windowing_install: windowing + install -d $(objectsdir)/$(WINDOWING_NAME) + $(scripts_src)/generate-libdir-metafile.sh $(objectsdir) $(WINDOWING_NAME) \ + --author "Joe Sarlo" \ + --license "GPLv2 or later" + install -p $(WINDOWING_OBJECTS:.c=.$(EXTENSION)) $(objectsdir)/$(WINDOWING_NAME) + install -d $(helpdir)/$(WINDOWING_NAME) + install -p $(externals_src)/windowing/*-help.pd \ + $(helpdir)/$(WINDOWING_NAME) +# install -d $(manualsdir)/$(WINDOWING_NAME) +# install -p $(externals_src)/windowing/manual.txt \ +# $(manualsdir)/$(WINDOWING_NAME) + install -d $(readmesdir) + install -p $(externals_src)/windowing/README \ + $(readmesdir)/$(WINDOWING_NAME).txt + install -d $(examplesdir)/$(WINDOWING_NAME) + install -p $(externals_src)/windowing/examples/*.pd \ + $(examplesdir)/$(WINDOWING_NAME) + +windowing_clean: + -rm -f -- $(WINDOWING_OBJECTS:.c=.$(EXTENSION)) + -rm -f -- $(WINDOWING_OBJECTS:.c=.o) + -rm -f -- $(externals_src)/windowing/*.bak + -rm -f -- $(externals_src)/windowing/*.*~ + + +#------------------------------------------------------------------------------# # Zexy ZEXY_NAME = zexy ZEXY_OBJECTS := $(wildcard $(externals_src)/zexy/src/[a-vxy0]*.c) \ @@ -2513,13 +2560,13 @@ pdcontainer: $(PDCONTAINER_TARGETS)
$(PDCONTAINER_TARGETS) : %.$(EXTENSION) : $(PDCONTAINER_OBJ) - $(CXX) $(LDFLAGS) -o $*.$(EXTENSION) "$*.o" $(shell ls `echo "$*.o" | sed -e s/"h_[a-z]"/"??"/g -e s/"map"/"Map"/g -e s/"set"/"Set"/g -e s/"queue"/"Queue"/g`) $(PDC_SHARED:.cpp=.o) $(LIBS) + $(CXX) $(LDFLAGS) -o $*.$(EXTENSION) "$*.o" $(shell ls `echo "$*.o" | sed -e s/"h_[a-z]"/"??"/g -e s/"map"/"Map"/g -e s/"set"/"Set"/g -e s/"queue"/"Queue"/g`) $(PDC_SHARED:.cpp=.o) $(LIBS) $(CYGWIN_CFLAG) $(STRIP) $*.$(EXTENSION) chmod 755 $*.$(EXTENSION) #rm -f -- "$*.o"
$(PDCONTAINER_OBJ) : %.o : %.cpp - $(CXX) $(CXXFLAGS) -DPDCONTAINER_SINGLE_OBJECT $(PDCONTAINER_INCLUDE) -o "$*.o" -c "$*.cpp" + $(CXX) $(CXXFLAGS) -DPDCONTAINER_SINGLE_OBJECT $(PDCONTAINER_INCLUDE) -o "$*.o" -c "$*.cpp" $(CYGWIN_CFLAG)
pdcontainer_install: pdcontainer install -d $(objectsdir)/$(PDCONTAINER_NAME) @@ -2879,13 +2926,13 @@ iemxmlrpc: $(IEMXMLRPC_TARGET)
$(IEMXMLRPC_TARGET) : $(IEMXMLRPC_SRC:.cpp=.o) $(XMLRPCPP_SRC:.cpp=.o) - $(CXX) $(LDFLAGS) -o $(IEMXMLRPC_TARGET) $(IEMXMLRPC_SRC:.cpp=.o) $(XMLRPCPP_SRC:.cpp=.o) $(LIBS) + $(CXX) $(LDFLAGS) -o $(IEMXMLRPC_TARGET) $(IEMXMLRPC_SRC:.cpp=.o) $(XMLRPCPP_SRC:.cpp=.o) $(CYGWIN_CFLAG) $(LIBS) $(STRIP) $(IEMXMLRPC_TARGET) chmod 755 $(IEMXMLRPC_TARGET) #rm -f -- "$*.o"
$(IEMXMLRPC_SRC:.cpp=.o) $(XMLRPCPP_SRC:.cpp=.o) : %.o : %.cpp - $(CXX) $(CXXFLAGS) $(IEMXMLRPC_FLAGS) -o "$*.o" -c "$*.cpp" + $(CXX) $(CXXFLAGS) $(IEMXMLRPC_FLAGS) -o "$*.o" $(CYGWIN_CFLAG) -c "$*.cpp"
iemxmlrpc_install: iemxmlrpc install -d $(objectsdir)/$(IEMXMLRPC_NAME)
# -*- Autoconf -*- # Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57) AC_INIT(OSCxpd, 0.2, jdl@xdv.org) AC_CONFIG_SRCDIR([libOSC/OSC-client.h]) AC_CONFIG_HEADER([config.h])
# get system type AC_CANONICAL_HOST
# Checks for programs. AC_PROG_CC AC_PROG_LN_S # AC_PROG_CXX AC_PROG_CPP # AC_PROG_INSTALL
dnl ---------------------------------- dnl here you can see that autoconf adds "-g -02" as a default dnl these are flags for debugging, and will add extra weight dnl to you external. CFLAGS, CPPFLAGS, etc are default variables dnl ---------------------------------- echo "default flags" # echo "$CPPFLAGS" # echo "$CXXFLAGS" echo cflags "$CFLAGS" echo ldflags "$LDFLAGS"
# Checks for libraries. # FIXME: Replace `main' with a function in `-lc': AC_CHECK_LIB([c], [main]) # FIXME: Replace `main' with a function in `-lm': AC_CHECK_LIB([m], [main])
# Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h sys/prctl.h])
# Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_HEADER_TIME AC_TYPE_SIZE_T
# Checks for library functions. AC_FUNC_MALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_VPRINTF AC_CHECK_FUNCS([bzero gethostbyname inet_ntoa select socket strchr]) AC_TYPE_SIGNAL
# from augusts template
dnl ------------------------------------------ dnl for each of the *-*-host's in the following, do the checking and then set your CFLAGS, CPPFLAGS and LDFLAGS dnl CFLAGS get set for C code, CPPFLAGS for c++ code. LDFLAGS is the linking flags for both c and c++ dnl ------------------------------------------
INCLUDES="-I../libOSC -I../../pd/src -I../../../pd/src -I../src" LIBOSC=libOSC.a if test -z "$GCC"; then case $host in *-*-irix*) dnl If we're on IRIX, we wanna use cc even if gcc dnl is there (unless the user has overriden us)... if test -z "$CC"; then CC=cc fi ;; sparc-sun-solaris*) CFLAGS="-xO4 -fast -w -fsimple -native -xcg92" ;; *) CFLAGS="-O" ;; esac else case $host in *86-*-linux*) CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O2" LDFLAGS="-Wl,-export_dynamic -shared" dnl we could test for bad glibc here, but don't pd_suffix=pd_linux LIBS="-lc -lm" ;; powerpc-*-linux*) CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" LDFLAGS="-Wl,-export_dynamic -shared" pd_suffix=pd_linux LIBS="-lc -lm" ;; *-*-linux*) CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" LDFLAGS="-Wl,-export_dynamic -shared" INCLUDES="$INCLUDES" pd_suffix=pd_linux LIBS="-L../../../pd/bin -lpd -lc -lm" ;; sparc-sun-*) echo "YOU HAVE A SPARC STATION, not setting any flags, not supported yet" ;; *-*-cygwin*) CFLAGS="$CFLAGS -mno-cygwin -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " LDFLAGS="-Wl,-export_dynamic -shared" INCLUDES="$INCLUDES -I../../../pd/src" pd_suffix=dll LIBS="-lc -lm" ;; *-*-mingw*) CFLAGS="$CFLAGS -mms-bitfields -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " LDFLAGS="-shared" INCLUDES="$INCLUDES -I../../../pd/src" pd_suffix=dll LIBS="-L../../../pd/bin -L../../../pd/obj -lpd -lm -lwsock32" ;; *-*-darwin*) CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " LDFLAGS=" -bundle -bundle_loader ../../../pd/bin/pd -flat_namespace " pd_suffix=pd_darwin LIBS="-lc -lm" ;; *) dnl assume unix CFLAGS="$CFLAGS -DUNIX -Wall -Wimplicit -Wunused -Wmissing-prototypes -O1" LDFLAGS="-Wl,-export_dynamic -shared" pd_suffix=pd_linux LIBS="-lc -lm" ;; esac fi
CFLAGS="$CFLAGS $INCLUDES"
echo "Using cflags= $CFLAGS" echo "Using ldflags= $LDFLAGS" echo "Using includes= $INCLUDES"
dnl ------------------------------------------ dnl ---- add PureData includes dir dnl ---- usually /usr/local/include dnl ------------------------------------------ AC_ARG_WITH(pd_dir, [ --with-pd-dir=path pd header path (default=/usr/local/include) ], [ CPPFLAGS="$CPPFLAGS -I$withval" echo echo "pd dir is $withval" echo ])
if test $prefix == NONE; then prefix=/usr/local fi
dnl ------------------------------------------ dnl ---- check for PureData Header dnl ------------------------------------------ AC_CHECK_HEADER(m_pd.h, [have_pd_hdr=yes ], [ have_pd_hdr=no echo echo "no m_pd.h header found. try with option --with-pd-dir=/path/to/pd/src" echo exit ])
AC_SUBST(LIBOSC) AC_SUBST(pd_suffix) AC_SUBST(INCLUDES) AC_SUBST(CFLAGS)
AC_CONFIG_FILES([src/Makefile libOSC/Makefile send+dump/Makefile Makefile])
AC_OUTPUT
Patrice Colet a écrit :
pd-main/externals:
Compiled external for windows aka CYGWIN_NT-5.1
I couldn't build vorbis library, all other libs are okay.
Attached are the externals/Makefile and externals/OSCx/configure.in diff files
It is not externals/OSCx/configure.in but externals/OSCx/configure.ac, attached is the real patch.
--- configure.ac.old 2007-12-15 02:55:37.859375000 +0100 +++ configure.ac 2007-12-15 03:17:35.140625000 +0100 @@ -103,9 +103,9 @@ *-*-cygwin*) CFLAGS="$CFLAGS -mno-cygwin -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 " LDFLAGS="-Wl,-export_dynamic -shared" - INCLUDES="$INCLUDES -I../../../pd/src" + INCLUDES="$INCLUDES -I../../../pd/src -I/cygdrive/MinGW/include" pd_suffix=dll - LIBS="-lc -lm" + LIBS="-L../../../pd/bin -L../../../pd/obj -lpd -lm -lwsock32" ;; *-*-mingw*) CFLAGS="$CFLAGS -mms-bitfields -Wall -Wimplicit -Wunused -Wmissing-prototypes -O3 "
Could you submit these to the patch tracker as a file? Then it's much easier to track them and commit them. Pasting diffs into emails usually messes up the line formatting.
http://puredata.info/dev/patchtracker
.hc
On Dec 15, 2007, at 12:20 AM, Patrice Colet wrote:
Patrice Colet a écrit :
pd-main/externals: Compiled external for windows aka CYGWIN_NT-5.1 I couldn't build vorbis library, all other libs are okay. Attached are the externals/Makefile and externals/OSCx/ configure.in diff files
It is not externals/OSCx/configure.in but externals/OSCx/ configure.ac, attached is the real patch.
--- configure.ac.old 2007-12-15 02:55:37.859375000 +0100 +++ configure.ac 2007-12-15 03:17:35.140625000 +0100 @@ -103,9 +103,9 @@ *-*-cygwin*) CFLAGS="$CFLAGS -mno-cygwin -Wall -Wimplicit - Wunused -Wmissing-prototypes -O3 " LDFLAGS="-Wl,-export_dynamic -shared"
INCLUDES="$INCLUDES -I../../../pd/src"
INCLUDES="$INCLUDES -I../../../pd/src -I/cygdrive/MinGW/
include" pd_suffix=dll
LIBS="-lc -lm"
LIBS="-L../../../pd/bin -L../../../pd/obj -lpd -lm -lwsock32" ;; *-*-mingw*) CFLAGS="$CFLAGS -mms-bitfields -Wall -Wimplicit -
Wunused -Wmissing-prototypes -O3 "
------------------------------------------------------------------------ ----
¡El pueblo unido jamás será vencido!