--- Makefile.orig	2007-03-17 15:43:58.000000000 +0100
+++ Makefile	2007-03-17 15:46:21.000000000 +0100
@@ -39,6 +39,14 @@
 
 VDRVERSION = $(shell grep 'define VDRVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
 
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
+
+APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+ifeq ($(APIVERSION),)
+### Backward compatibility: use version number of VDR!
+APIVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
+endif
+
 ### The name of the distribution archive:
 
 ARCHIVE = $(PLUGIN)-$(VERSION)
@@ -87,8 +95,8 @@
 
 libvdr-$(PLUGIN).so: $(OBJS)
 	$(CXX) $(CXXFLAGS) -shared $(OBJS) -Wl,-soname -Wl,$@.$(VDRVERSION) -o $@ -lasound -lrt -lmad
-	@cp $@ $(LIBDIR)/$@.$(VDRVERSION)
-	@-strip --strip-unneeded $(LIBDIR)/$@.$(VDRVERSION)
+	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
+	@-strip --strip-unneeded $(LIBDIR)/$@.$(APIVERSION)
 
 install:  $(LIBDIR)/libvdr-$(PLUGIN).so.$(VDRVERSION)
 	install -d -m 0755 $(DESTDIR)$(VIDEOLIB)/PLUGINS/lib

