configure: add soversion variable, move version variables to top for easier access
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 7 Feb 2008 09:39:49 +0000 (09:39 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 7 Feb 2008 09:39:49 +0000 (09:39 +0000)
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
src/framework/Makefile
src/framework/mlt.h
src/miracle/Makefile
src/valerie/Makefile

index 5180e45..65961fa 100755 (executable)
--- 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
index 5ee621f..8dcf6b4 100644 (file)
@@ -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"
 
index 9e4f962..d4e2721 100644 (file)
@@ -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"
 {
index 7fa8a29..96a9b1a 100644 (file)
@@ -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"
 
index c1a783b..29e4df0 100644 (file)
@@ -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"