[ ! -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."
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 \
all: $(TARGET)
$(TARGET): $(OBJS)
- $(CC) -shared -o $@ $(OBJS) $(LDFLAGS)
+ $(CC) -o $@ $(OBJS) $(LDFLAGS)
clean:
$(RM) $(OBJS) $(TARGET)
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 ) );
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 );
};
-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