From: lilo_booter Date: Tue, 29 Nov 2005 12:05:30 +0000 (+0000) Subject: + Added a --libdir switch to the configure and build and fixed test case compilation X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=3e27e17ee89f8ba89d53fbb9fc36f3b780c639f9;p=melted + Added a --libdir switch to the configure and build and fixed test case compilation git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@868 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt++/configure b/mlt++/configure index c1310fc..05573c0 100755 --- a/mlt++/configure +++ b/mlt++/configure @@ -7,13 +7,26 @@ path=`which mlt-config 2>/dev/null` prefix=`mlt-config --prefix` [ "$prefix" = "" ] && echo "Can't locate MLT's prefix - please reconfigure MLT." && exit 1 +# Default the libdir +libdir="" + # Allow override from command line -[ "$1" != "" ] && prefix="${1#--prefix=}" +for i in $* +do + case $i in + --prefix=* ) prefix="${1#--prefix=}" ;; + --libdir=* ) libdir="${1#--libdir=}" ;; + esac +done + +# Determine the libdir if it's not specified in the args +[ "$libdir" = "" ] && libdir=$prefix/lib # Sanity check [ ! -d "$prefix" ] && echo "Invalid prefix $prefix - aborting" && exit 1 echo "prefix=$prefix" > config.mak +echo "libdir=$libdir" >> config.mak targetos=$(uname -s) @@ -21,12 +34,14 @@ 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" + echo "LIBFLAGS=-dynamiclib" + echo "LDFLAGS+=`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`" + echo "LIBFLAGS=-shared" + echo "LDFLAGS+=`mlt-config --libs` `mlt-config miracle --libs`" ;; esac >> config.mak diff --git a/mlt++/src/Makefile b/mlt++/src/Makefile index 6f72bb2..5d205b8 100644 --- a/mlt++/src/Makefile +++ b/mlt++/src/Makefile @@ -34,14 +34,14 @@ CC=g++ all: $(TARGET) $(TARGET): $(OBJS) - $(CC) -o $@ $(OBJS) $(LDFLAGS) + $(CC) $(LIBFLAGS) -o $@ $(OBJS) $(LDFLAGS) clean: $(RM) $(OBJS) $(TARGET) install: - $(INSTALL) -d "$(DESTDIR)$(prefix)/lib" - $(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(prefix)/lib + $(INSTALL) -d "$(DESTDIR)$(libdir)" + $(INSTALL) -m 755 $(TARGET) $(DESTDIR)$(libdir) $(INSTALL) -d "$(DESTDIR)$(prefix)/include/mlt++" $(INSTALL) -m 644 $(HEADERS) "$(DESTDIR)$(prefix)/include/mlt++" /sbin/ldconfig || true