[PD-dev] compile pd with cygwin

Patrice Colet pat at mamalala.org
Sat Dec 1 07:02:40 CET 2007


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




More information about the Pd-dev mailing list