]> git.vomp.tv Git - vompserver.git/commitdiff
Makefile made backward compatible with VDR 1.7.26
authorChris Tallon <chris@telescope.org>
Sun, 3 Feb 2013 16:36:31 +0000 (16:36 +0000)
committerChris Tallon <chris@telescope.org>
Sun, 3 Feb 2013 16:36:31 +0000 (16:36 +0000)
Makefile

index 85c36bb9817d87b215d05607f6dab20503c2cac5..feffd1a04e95fe83d49411e1bc4361e1c3d445ea 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,11 +23,29 @@ PLGCFG = $(call PKGCFG,plgcfg)
 #
 TMPDIR ?= /tmp
 
+# VOMP INSERT for older VDRs
+ifeq ($(VDRDIR),)
+  VDRDIR = ../../..
+  LIBDIR = ../../lib
+endif
+
+APIVERSNUM = $(shell grep 'define APIVERSNUM ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+DOOLDINSTALL = 0
+ifeq ($(shell test $(APIVERSNUM) -le 10734; echo $$?),0) # thanks streamdev
+DOOLDINSTALL = 1
+endif
+# end insert
+
 ### The compiler options:
 
 export CFLAGS   = $(call PKGCFG,cflags)
 export CXXFLAGS = $(call PKGCFG,cxxflags)
 
+# VOMP INSERT
+CFLAGS += -fPIC
+CXXFLAGS += -fPIC
+# end insert
+
 ### The version number of VDR's plugin API:
 
 APIVERSION = $(call PKGCFG,apiversion)
@@ -56,6 +74,7 @@ INCLUDES += -I$(VDRDIR)/include -I$(DVBDIR)/include
 
 DEFINES += -D_GNU_SOURCE -DVOMPSERVER
 DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
+
 # END-VOMP-INSERT
 
 
@@ -134,6 +153,9 @@ standalonebase:
 
 $(SOFILE): objects
        $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(OBJS2) -o $@
+       [ -n "$(DOOLDINSTALL)" ]; then \
+cp $@ $(LIBDIR)/$@.$(APIVERSION) ; \
+fi
 
 vompserver-standalone: objectsstandalone
        $(CXX) $(CXXFLAGS) $(OBJS) -lpthread -o $@