aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdl <x75@users.sourceforge.net>2002-09-28 15:04:01 +0000
committerjdl <x75@users.sourceforge.net>2002-09-28 15:04:01 +0000
commite8208e0f5befd41b8f23b28d784fa7bced23fee9 (patch)
treea88b4d99f75c90cd8ed1fda78c38710ee0eee8e9
parent535b353753110168cde9b4bd25084e4f52555e66 (diff)
OSX mods vssss
svn path=/trunk/externals/OSCx/; revision=152
-rw-r--r--OSC/OSC-pattern-match.c4
-rw-r--r--OSC/htmsocket.c7
-rw-r--r--OSC/makefile81
-rw-r--r--OSC/routeOSC.c4
-rw-r--r--OSC/sendOSC.c1
5 files changed, 42 insertions, 55 deletions
diff --git a/OSC/OSC-pattern-match.c b/OSC/OSC-pattern-match.c
index 2d6a541..c3000c1 100644
--- a/OSC/OSC-pattern-match.c
+++ b/OSC/OSC-pattern-match.c
@@ -35,7 +35,9 @@ The OpenSound Control WWW page is
Matt Wright, 3/16/98
Adapted from oscpattern.c, by Matt Wright and Amar Chaudhury
*/
-
+#ifdef MACOSX
+#include <stdio.h>
+#endif
#include "OSC-common.h"
#include "OSC-pattern-match.h"
diff --git a/OSC/htmsocket.c b/OSC/htmsocket.c
index 420853f..9666ebe 100644
--- a/OSC/htmsocket.c
+++ b/OSC/htmsocket.c
@@ -36,6 +36,9 @@ University of California, Berkeley.
in addition to X.X.X.X addresses.
*/
+#ifdef MACOSX
+ #include <string.h>
+#endif
#ifdef WIN32
#include <sys/types.h>
@@ -53,7 +56,7 @@ University of California, Berkeley.
#include <sys/stat.h>
#include <netinet/in.h>
- #include <rpc/rpc.h>
+// #include <rpc/rpc.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/times.h>
@@ -71,7 +74,7 @@ University of California, Berkeley.
#include <sys/file.h>
#include <sys/time.h>
#include <sys/types.h>
- #include <sys/prctl.h>
+// #include <sys/prctl.h>
#include <stdlib.h>
#endif
diff --git a/OSC/makefile b/OSC/makefile
index f9825da..5c9144e 100644
--- a/OSC/makefile
+++ b/OSC/makefile
@@ -1,69 +1,48 @@
###############################
-# change these
-IFLAGS = -I. -I../../../src/pd-0.35-0/src
-INSTALL_PREFIX=/usr
+NAME=OSC
-# should be oke below ..
-EXT = o
-#DEFS = -DHAVE_LIBC=1 -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_UNISTD_H=1 -DHAVE_GETPAGESIZE=1 -DHAVE_MMAP=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRERROR=1 -DPD_VERSION_MINOR=32
-DEFS =
-CC = gcc
-CXX = c++
-LD = ld
-AFLAGS =
-LFLAGS = -export_dynamic -shared
-WFLAGS =
+# ----------------------- Mac OS X (Darwin) -----------------------
-# DEBUG = -DDEBUG -g
-DEBUG =
+pd_darwin: $(NAME).pd_darwin
-VERSION = \"$(shell cat VERSION)\"
+.SUFFIXES: .pd_darwin
-.SUFFIXES: .$(EXT)
+DARWINCFLAGS = -DPD -DUNIX -DMACOSX -O2 \
+ -Wall -W -Wshadow -Wstrict-prototypes \
+ -Wno-unused -Wno-parentheses -Wno-switch
-PDCFLAGS = -O2 $(DEFS) $(IFLAGS) $(WFLAGS) $(LFLAGS) $(AFLAGS) -DVERSION=$(VERSION)
-CFLAGS = -O2 $(DEFS) $(IFLAGS) $(WFLAGS) -DVERSION=$(VERSION) $(DEBUG)
-CXXFLAGS = $(CFLAGS)
-LIBOSC = ../libOSC/libOSC.a
-LIBS = -lpthread -lm -lc
-SOURCES = htmsocket.c OSC-pattern-match.c sendOSC.c dumpOSC.c routeOSC.c
-TARGETS = $(SOURCES:.c=.$(EXT))
+# where is your m_pd.h ???
+DARWININCLUDE = -I../../../pd/src -I../../obj
-all: $(TARGETS)
+DARWINEXTERNALS = htmsocket.o OSC-pattern-match.o sendOSC.o dumpOSC.o routeOSC.o
+# lorenz.o rossler.o henon.o ikeda.o
-OSC: $(TARGETS)
- cc -c $(CFLAGS) -DPD OSC.c
- $(LD) -export_dynamic -shared -o OSC.pd_linux *.o $(LIBS) $(LIBOSC)
- strip --strip-unneeded OSC.pd_linux
+.c.pd_darwin:
+ cc $(DARWINCFLAGS) $(DARWININCLUDE) -c *.c
+ cc -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o $(DARWINEXTERNALS)
+ rm -f $*.o ../$*.pd_darwin
+ ln -s $*/$*.pd_darwin ..
-clean::
- -rm *.$(EXT) *.pd_linux *~
-distclean: clean
- -rm config.cache config.log config.status makefile
+# ----------------------- LINUX i386 -----------------------
+pd_linux: $(NAME).pd_linux
-distcleancvs:
- -rm -r CVS reference/CVS
+.SUFFIXES: .pd_linux
+LINUXCFLAGS = -DPD -DUNIX -O2 -funroll-loops -fomit-frame-pointer \
+ -Wall -W -Wshadow \
+ -Wno-unused -Wno-parentheses -Wno-switch
-.c.o:
- $(CC) -c -o $@ $(CFLAGS) -DPD $*.c
+# where is your m_pd.h ???
+LINUXINCLUDE = -I/usr/local/include
-# cp $@ $*_stat.o
+LINUXEXTERNALS = htmsocket.o OSC-pattern-match.o sendOSC.o dumpOSC.o routeOSC.o
-#.o.pd_linux:
-# $(CC) -o $@ $(PDCFLAGS) -DPD $*.o
+.c.pd_linux:
+ cc -O2 -Wall -DPD -fPIC $(LINUXCFLAGS) $(LINUXINCLUDE) -c *.c
+ ld -export_dynamic -shared -o $*.pd_linux $*.o $(LINUXEXTERNALS) -lc
+ strip --strip-unneeded $*.pd_linux
+# ----------------------------------------------------------
-
-install::
- install -d $(INSTALL_PREFIX)/lib/pd/externs
-# install -m 644 *.pd_linux $(INSTALL_PREFIX)/lib/pd/externs
- install -m 644 OSC.pd_linux $(INSTALL_PREFIX)/lib/pd/externs
- install -d $(INSTALL_PREFIX)/lib/pd/doc/5.reference/OSC
- install -m 644 ../doc/*.pd $(INSTALL_PREFIX)/lib/pd/doc/5.reference/OSC
-
-
-#dist: distclean
-# (cd ..;tar czvf ggext.tgz ggext)
diff --git a/OSC/routeOSC.c b/OSC/routeOSC.c
index 0e297dd..1b3a264 100644
--- a/OSC/routeOSC.c
+++ b/OSC/routeOSC.c
@@ -58,7 +58,9 @@ The OpenSound Control WWW page is
#include <stdlib.h>
#include <string.h>
#endif
-
+#ifdef MACOSX
+ #include <stdio.h>
+#endif
/* structure definition of your object */
#define MAX_NUM 20
diff --git a/OSC/sendOSC.c b/OSC/sendOSC.c
index c039c86..7c0e228 100644
--- a/OSC/sendOSC.c
+++ b/OSC/sendOSC.c
@@ -80,6 +80,7 @@ compiling:
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+ #include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#endif