From 9d453d871e6985f67da7a4c7227c13e326dbe452 Mon Sep 17 00:00:00 2001 From: ddennedy Date: Thu, 7 Feb 2008 09:39:49 +0000 Subject: [PATCH] configure: add soversion variable, move version variables to top for easier access framework/Makefile, miracle/Makefile, valerie/Makefile: improve library versioning by linking on interface version (soversion) mlt.h: add version info to header so apps can have build time adaptations git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1062 d19143bc-622f-0410-bfdd-b5b2a6649095 --- configure | 5 ++++- src/framework/Makefile | 9 +++++++-- src/framework/mlt.h | 3 +++ src/miracle/Makefile | 9 +++++++-- src/valerie/Makefile | 9 +++++++-- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 5180e45..65961fa 100755 --- a/configure +++ b/configure @@ -1,5 +1,8 @@ #!/bin/bash +export version=0.2.5 +export soversion=0 + show_help() { cat << EOF @@ -38,6 +41,7 @@ build_config() { ( echo "version=$version" + echo "soversion=$soversion" echo "prefix=$prefix" echo "libdir=$libdir" echo "bindir=$prefix/bin" @@ -115,7 +119,6 @@ export build_dir=`dirname $0` export prefix=/usr/local export libdir="" export help=0 -export version=0.2.5 export debug=true export mmx=true export gpl=false diff --git a/src/framework/Makefile b/src/framework/Makefile index 5ee621f..8dcf6b4 100644 --- a/src/framework/Makefile +++ b/src/framework/Makefile @@ -6,11 +6,13 @@ TARGET = $(NAME).$(version) ifneq ($(targetos), Darwin) NAME = libmlt$(LIBSUF) TARGET = $(NAME).$(version) -SHFLAGS += -Wl,-soname,$(TARGET) +SONAME = $(NAME).$(soversion) +SHFLAGS += -Wl,-soname,$(SONAME) else NAME = libmlt$(LIBSUF) TARGET = libmlt.$(version)$(LIBSUF) -SHFLAGS += -install_name $(libdir)/$(TARGET) +SONAME = libmlt.$(soversion)$(LIBSUF) +SHFLAGS += -install_name $(libdir)/$(SONAME) -current_version $(version) -compatibility_version $(soversion) endif OBJS = mlt_frame.o \ @@ -70,6 +72,7 @@ all: $(TARGET) $(TARGET): $(OBJS) $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) ln -sf $(TARGET) $(NAME) + ln -sf $(TARGET) $(SONAME) depend: $(SRCS) $(CC) -MM $(CFLAGS) $^ 1>.depend @@ -83,12 +86,14 @@ clean: install: install -d $(DESTDIR)$(libdir) install -m 755 $(TARGET) $(DESTDIR)$(libdir) + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME) ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME) install -d "$(DESTDIR)$(prefix)/include/mlt/framework" install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/framework" uninstall: rm -f "$(DESTDIR)$(libdir)/$(TARGET)" + rm -f "$(DESTDIR)$(libdir)/$(SONAME)" rm -f "$(DESTDIR)$(libdir)/$(NAME)" rm -rf "$(DESTDIR)$(prefix)/include/mlt/framework" diff --git a/src/framework/mlt.h b/src/framework/mlt.h index 9e4f962..d4e2721 100644 --- a/src/framework/mlt.h +++ b/src/framework/mlt.h @@ -21,6 +21,9 @@ #ifndef _MLT_H_ #define _MLT_H_ +#define LIBMLT_VERSION_INT ((0<<16)+(2<<8)+5) +#define LIBMLT_VERSION 0.2.5 + #ifdef __cplusplus extern "C" { diff --git a/src/miracle/Makefile b/src/miracle/Makefile index 7fa8a29..96a9b1a 100644 --- a/src/miracle/Makefile +++ b/src/miracle/Makefile @@ -5,11 +5,13 @@ TARGET = miracle ifneq ($(targetos), Darwin) LIBNAME = libmiracle$(LIBSUF) LIBTARGET = $(LIBNAME).$(version) -SHFLAGS += -Wl,-soname,$(LIBTARGET) +LIBSONAME = $(LIBNAME).$(soversion) +SHFLAGS += -Wl,-soname,$(LIBSONAME) else LIBNAME = libmiracle$(LIBSUF) LIBTARGET = libmiracle.$(version)$(LIBSUF) -SHFLAGS += -install_name $(libdir)/$(LIBTARGET) +LIBSONAME = libmiracle.$(soversion)$(LIBSUF) +SHFLAGS += -install_name $(libdir)/$(LIBSONAME) -current_version $(version) -compatibility_version $(soversion) endif APP_OBJS = miracle.o @@ -42,6 +44,7 @@ $(TARGET): $(APP_OBJS) $(LIBTARGET) $(LIBTARGET): $(LIB_OBJS) $(CC) $(SHFLAGS) -o $@ $(LIB_OBJS) $(LDFLAGS) ln -sf $(LIBTARGET) $(LIBNAME) + ln -sf $(LIBTARGET) $(LIBSONAME) depend: $(SRCS) $(CC) -MM $(CFLAGS) $^ 1>.depend @@ -56,6 +59,7 @@ install: all install -d "$(DESTDIR)$(bindir)" install -c -s -m 755 $(TARGET) "$(DESTDIR)$(bindir)" install -m 755 $(LIBTARGET) $(DESTDIR)$(libdir) + ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBSONAME) ln -sf $(LIBTARGET) $(DESTDIR)$(libdir)/$(LIBNAME) mkdir -p "$(DESTDIR)$(prefix)/include/mlt/miracle" install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/miracle" @@ -63,6 +67,7 @@ install: all uninstall: rm -f "$(DESTDIR)$(bindir)/$(TARGET)" rm -f "$(DESTDIR)$(libdir)/$(LIBTARGET)" + rm -f "$(DESTDIR)$(libdir)/$(LIBSONAME)" rm -f "$(DESTDIR)$(libdir)/$(LIBNAME)" rm -rf "$(DESTDIR)$(prefix)/include/mlt/miracle" diff --git a/src/valerie/Makefile b/src/valerie/Makefile index c1a783b..29e4df0 100644 --- a/src/valerie/Makefile +++ b/src/valerie/Makefile @@ -3,11 +3,13 @@ include ../../config.mak ifneq ($(targetos), Darwin) NAME = libvalerie$(LIBSUF) TARGET = $(NAME).$(version) -SHFLAGS += -Wl,-soname,$(TARGET) +SONAME = $(NAME).$(soversion) +SHFLAGS += -Wl,-soname,$(SONAME) else NAME = libvalerie$(LIBSUF) TARGET = libvalerie.$(version)$(LIBSUF) -SHFLAGS += -install_name $(libdir)/$(TARGET) +SONAME = libmlt.$(soversion)$(LIBSUF) +SHFLAGS += -install_name $(libdir)/$(SONAME) -current_version $(version) -compatibility_version $(soversion) endif OBJS = valerie.o \ @@ -40,6 +42,7 @@ all: $(TARGET) $(TARGET): $(OBJS) $(CC) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS) ln -sf $(TARGET) $(NAME) + ln -sf $(TARGET) $(SONAME) depend: $(SRCS) $(CC) -MM $(CFLAGS) $^ 1>.depend @@ -52,12 +55,14 @@ clean: install: all install -m 755 $(TARGET) $(DESTDIR)$(libdir) + ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(SONAME) ln -sf $(TARGET) $(DESTDIR)$(libdir)/$(NAME) mkdir -p "$(DESTDIR)$(prefix)/include/mlt/valerie" install -m 644 $(INCS) "$(DESTDIR)$(prefix)/include/mlt/valerie" uninstall: rm -f "$(DESTDIR)$(libdir)/$(TARGET)" + rm -f "$(DESTDIR)$(libdir)/$(SONAME)" rm -f "$(DESTDIR)$(libdir)/$(NAME)" rm -rf "$(DESTDIR)$(prefix)/include/mlt/valerie" -- 1.7.4.4