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.