From 7c8efa096472fc2d30e4d07ca63ddfe380f964ab Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Mon, 3 Oct 2005 08:48:45 +0000 Subject: [PATCH] + Whoops - had forgotten these OS/X patches... git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@841 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt++/configure | 16 ++++++++++++++++ mlt++/src/Makefile | 6 ++---- mlt++/src/MltProperties.cpp | 12 ++++++++++++ mlt++/src/MltProperties.h | 6 +++++- mlt++/test/Makefile | 6 ++++-- 5 files changed, 39 insertions(+), 7 deletions(-) diff --git a/mlt++/configure b/mlt++/configure index 557b3da..8c02c98 100755 --- a/mlt++/configure +++ b/mlt++/configure @@ -14,5 +14,21 @@ prefix=`mlt-config --prefix` [ ! -d "$prefix" ] && echo "Invalid prefix $prefix - aborting" && exit 1 echo "prefix=$prefix" > config.mak + +targetos=$(uname -s) + +case $targetos in + Darwin) + echo LIBSUF=.dylib + echo "CXXFLAGS+=-D__DARWIN__ -Wall -fPIC `mlt-config --cflags`" + echo "LDFLAGS=-dynamiclib `mlt-config --libs` `mlt-config miracle --libs` `mlt-config valerie --libs` -single_module" + ;; + Linux) + echo LIBSUF=.so + echo "CXXFLAGS+=-pthread -Wall -fPIC `mlt-config --cflags`" + echo "LDFLAGS=-shared `mlt-config --libs` `mlt-config miracle --libs`" + ;; +esac >> config.mak + echo "MLT++ configured - will be installed in $prefix." diff --git a/mlt++/src/Makefile b/mlt++/src/Makefile index 9c1cbb3..fa07151 100644 --- a/mlt++/src/Makefile +++ b/mlt++/src/Makefile @@ -1,9 +1,7 @@ include ../config.mak -CXXFLAGS = -Wall -fPIC -DPIC -pthread `mlt-config --cflags` -LDFLAGS = `mlt-config --libs` `mlt-config miracle --libs` INSTALL = install -TARGET = libmlt++.so +TARGET = libmlt++$(LIBSUF) OBJS = MltConsumer.o \ MltDeque.o \ @@ -36,7 +34,7 @@ CC=g++ all: $(TARGET) $(TARGET): $(OBJS) - $(CC) -shared -o $@ $(OBJS) $(LDFLAGS) + $(CC) -o $@ $(OBJS) $(LDFLAGS) clean: $(RM) $(OBJS) $(TARGET) diff --git a/mlt++/src/MltProperties.cpp b/mlt++/src/MltProperties.cpp index 467b318..e6ebfa6 100644 --- a/mlt++/src/MltProperties.cpp +++ b/mlt++/src/MltProperties.cpp @@ -220,12 +220,24 @@ int Properties::save( const char *file ) return error; } +#ifdef __DARWIN__ + +Event *Properties::listen( char *id, void *object, void (*listener)( ... ) ) +{ + mlt_event event = mlt_events_listen( get_properties( ), object, id, ( mlt_listener )listener ); + return new Event( event ); +} + +#else + Event *Properties::listen( char *id, void *object, mlt_listener listener ) { mlt_event event = mlt_events_listen( get_properties( ), object, id, listener ); return new Event( event ); } +#endif + Event *Properties::setup_wait_for( char *id ) { return new Event( mlt_events_setup_wait_for( get_properties( ), id ) ); diff --git a/mlt++/src/MltProperties.h b/mlt++/src/MltProperties.h index 3f33733..ab66ecd 100644 --- a/mlt++/src/MltProperties.h +++ b/mlt++/src/MltProperties.h @@ -73,7 +73,11 @@ namespace Mlt void debug( const char *title = "Object", FILE *output = stderr ); void load( const char *file ); int save( const char *file ); - Event *listen( char *id, void *object, mlt_listener listener ); + #ifdef __DARWIN__ + Event *listen( char *id, void *object, void (*)(...) ); + #else + Event *listen( char *id, void *object, mlt_listener ); + #endif Event *setup_wait_for( char *id ); void wait_for( Event *, bool destroy = true ); }; diff --git a/mlt++/test/Makefile b/mlt++/test/Makefile index 00252e3..173b572 100644 --- a/mlt++/test/Makefile +++ b/mlt++/test/Makefile @@ -1,5 +1,7 @@ -CXXFLAGS=-Wall -g `mlt-config --cflags` -I ../src -LDFLAGS=-L../src -lmlt++ +include ../config.mak + +CXXFLAGS+=-Wall -g `mlt-config --cflags` -I ../src +LDFLAGS+=-L../src -lmlt++ -lmiracle -lvalerie `mlt-config --libs` CC=c++ all: play server -- 1.7.4.4