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.