[SCM] pd-readanysf/master: more Makefile fixes

zmoelnig-guest at users.alioth.debian.org zmoelnig-guest at users.alioth.debian.org
Thu Feb 10 08:48:08 UTC 2011


The following commit has been merged in the master branch:
commit 0c313b6905893f4cf96386516fffcc086b87e550
Author: IOhannes m zmölnig <zmoelnig at iem.at>
Date:   Thu Feb 10 09:47:04 2011 +0100

    more Makefile fixes
    
    these fixes should allow to build on systems overriding CFLAGS and
    the like as well as an non-linux architectures.

diff --git a/debian/patches/fix-makefile.patch b/debian/patches/fix-makefile.patch
index 8618243..cf04945 100644
--- a/debian/patches/fix-makefile.patch
+++ b/debian/patches/fix-makefile.patch
@@ -1,10 +1,70 @@
 Author: IOhannes m zmölnig
-Description: make builds into nonexistant objs directory and fails
-to clean up; this patch will create the directory and delete it on
-clean
+Description: various makefile fixes
+#1: make builds into nonexistant objs directory and fails to clean up; this
+patch will create the directory and delete it on clean
+#2: various build-system might set the CFLAGS/LDFLAGS variables from outside,
+which will make make ignore the flags set inside the makefile (und thus fail)
+#3: OS-detection assumed that everything is Darwin that is not Linux; on Debian
+(which is very linux-like) UNAME could as well be "kFreeBSD" or "Hurd", so i
+thought it safer to assume that everything is "Linux"(like) that is not Darwin.
 --- pd-readanysf.orig/Makefile
 +++ pd-readanysf/Makefile
-@@ -50,8 +50,6 @@
+@@ -6,7 +6,13 @@
+ 
+ 
+ VERSION=0.42
++
+ UNAME := $(shell uname)
++ifneq ($(UNAME), Darwin)
++# simplistic approach to handle Debians non-linux architectures (kFreeBSD,
++# kHurd) the same as linux
++UNAME=Linux
++endif
+ 
+ ifeq ($(UNAME), Linux)
+ TARGET=pd_linux
+@@ -18,44 +24,35 @@
+ endif
+ 
+ ##############################################
+-LBITS := $(shell getconf LONG_BIT)
+-ifeq ($(LBITS),64)
+-   # do 64 bit stuff here, like set some CFLAGS
+-CFLAGS =  -fPIC -I./  -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
+-else
+-   # do 32 bit stuff here
+-CFLAGS =  -I./  -I$(GAVLPATH)  -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
+-endif
+-
++# do 32/64 bit stuff here, like set some PD_CFLAGS
++PD_CFLAGS =  -fPIC -I./  -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall $(CFLAGS)
+ 
+ ifeq ($(UNAME), Linux)
+ STRIP=strip --strip-unneeded
+ # optimizations?
+-#CFLAGS += -O1 -funroll-loops -fomit-frame-pointer \
++#PD_CFLAGS += -O1 -funroll-loops -fomit-frame-pointer \
+ #    -Wall -W -Wshadow \
+ #    -Wno-unused -Wno-parentheses -Wno-switch
+-LDFLAGS =  -L/usr/local/lib -lpthread  -lgavl -lgmerlin_avdec 
++PD_LDFLAGS =  -L/usr/local/lib -lpthread  -lgavl -lgmerlin_avdec
+ else
+ # assume darwin here
+ STRIP=strip -x
+-CFLAGS += -I/sw/include -fast -fPIC
+-LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
+-#LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
++PD_CFLAGS += -I/sw/include -fast -fPIC
++PD_LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
++#PD_LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
+ #		-L/sw/lib -weak_framework Carbon -lc -L/sw/lib -lgavl -lgmerlin_avdec  
+ # os 10.4
+-#CFLAGS += -mmacosx-version-min=10.4  -arch i386  -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
+-#LDFLAGS =  -L/sw/lib -lgavl -lgmerlin_avdec \
++#PD_CFLAGS += -mmacosx-version-min=10.4  -arch i386  -isysroot /Developer/SDKs/MacOSX10.4u.sdk
++#PD_LDFLAGS =  -L/sw/lib -lgavl -lgmerlin_avdec \
+ #        -dynamiclib -undefined dynamic_lookup  -lsupc++ -mmacosx-version-min=10.4 \
+ #        -lSystem.B -arch i386  -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
  endif
  
  
@@ -13,21 +73,38 @@ clean
  all: $(TARGET) 
  
  pd_linux: src/readanysf~.cpp  objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
-@@ -78,16 +76,20 @@
+-	g++  -shared  -o  readanysf~.pd_linux  $(CFLAGS) $(LDFLAGS) \
++	g++  -shared  -o  readanysf~.pd_linux  $(PD_CFLAGS) $(PD_LDFLAGS) \
+ 	src/readanysf~.cpp \
+ 	objs/FifoAudioFrames.o \
+ 	objs/FifoVideoFrames.o \
+@@ -63,7 +60,7 @@
+ 	$(STRIP) readanysf~.pd_linux
+ 
+ pd_darwin: src/readanysf~.cpp  objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
+-	g++  $(LDFLAGS)  -o  readanysf~.pd_darwin  $(CFLAGS)  \
++	g++  $(PD_LDFLAGS)  -o  readanysf~.pd_darwin  $(PD_CFLAGS)  \
+ 	src/readanysf~.cpp \
+ 	objs/FifoAudioFrames.o \
+ 	objs/FifoVideoFrames.o \
+@@ -78,16 +75,20 @@
  	tar -cvf readanysf~$(VERSION)_MacOSX-Intel.tar readanysf~$(VERSION)_MacOSX-Intel/
  	gzip readanysf~$(VERSION)_MacOSX-Intel.tar
  
 -objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
+-	g++  -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
 +objs/ReadMedia.o: objs/ src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
- 	g++  -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
++	g++  -c -o objs/ReadMedia.o src/ReadMedia.cpp $(PD_CFLAGS)
  
 -objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h 
+-	g++  -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
 +objs/FifoAudioFrames.o: objs/ src/FifoAudioFrames.cpp src/FifoAudioFrames.h
- 	g++  -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
++	g++  -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(PD_CFLAGS)
  
 -objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h 
+-	g++  -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
 +objs/FifoVideoFrames.o: objs/ src/FifoVideoFrames.cpp src/FifoVideoFrames.h
- 	g++  -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
++	g++  -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(PD_CFLAGS)
  
  clean:
  	if [ -d readanysf~$(VERSION)_MacOSX-Intel ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel; fi; 

-- 
pd-readanysf packaging



More information about the pkg-multimedia-commits mailing list