oh, I stupidly forgot to actually attach the patch ;-)

-- 
ohnobinki

Look out for missing apostrophes!
Author: Nathan Phillip Brink <[email protected]>
Purpose: To better respect LDFLAGS and other compiletime variables as well as 
supporting --as-needed; https://bugs.gentoo.org/321303

Index: test/Makefile
===================================================================
--- test/Makefile       (revision 4154)
+++ test/Makefile       (working copy)
@@ -7,9 +7,8 @@
        ivtv-osd-dma-test ivtv-fb-colormap-test \
        ivtv-fb-16-bit-test ps-analyzer
 
-CFLAGS = -I../utils -D_GNU_SOURCE -O2 -Wall
-CXXFLAGS = $(CFLAGS)
-LDFLAGS = -lm
+CPPFLAGS = -I../utils -D_GNU_SOURCE
+LDLIBS = -lm
 
 all: $(EXES)
 
Index: utils/Makefile
===================================================================
--- utils/Makefile      (revision 4154)
+++ utils/Makefile      (working copy)
@@ -2,7 +2,7 @@
 BINDIR = $(PREFIX)/bin
 HDRDIR = /usr/include/linux
 
-X86  := $(shell if echo - | $(CC) -E -dM - | egrep -e '__i386__|__x86_64__' 
>/dev/null; \
+X86  := $(shell if echo - | $(CC) $(CFLAGS) $(CPPFLAGS) -E -dM - | egrep -e 
'__i386__|__x86_64__' >/dev/null; \
        then echo y; else echo n; fi)
 
 ifeq ($(X86),y)
@@ -16,30 +16,29 @@
 
 HEADERS := linux/ivtv.h linux/ivtvfb.h
 
-CFLAGS = -D_GNU_SOURCE -O2 -Wall -g -I.
-CXXFLAGS = $(CFLAGS)
+CPPFLAGS = -D_GNU_SOURCE -I.
 
 all:: $(EXES)
-       $(MAKE) CFLAGS="$(CFLAGS)" -C ivtv-tune
-       $(MAKE) CFLAGS="$(CFLAGS)" -C cx25840ctl
+       $(MAKE) CPPFLAGS="$(CPPFLAGS)" -C ivtv-tune
+       $(MAKE) CPPFLAGS="$(CPPFLAGS)" -C cx25840ctl
 
 ivtv-ctl: ivtv-ctl.o
-       $(CC) -lm -o $@ $^
+       $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lm
 
 v4l2-ctl: v4l2-ctl.o
-       $(CXX) -lm -o $@ $^
+       $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lm
 
 v4l2-dbg: v4l2-dbg.o v4l2-driverids.o v4l2-chipids.o
-       $(CXX) -lm -o $@ $^
+       $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lm
 
 ivtvplay: ivtvplay.cc
-       $(CXX) $(CXXFLAGS) -lm -lpthread -o $@ $^
+       $(CXX) $(CXXFLAGS) $(CPPFLAGS) -lpthread -o $@ $^ -lm
 
 encoder.o: encoder.c
-       $(CC) $(CFLAGS) -DVIDEO_PORT=0 -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -c $^
+       $(CC) $(CFLAGS) $(CPPFLAGS) -DVIDEO_PORT=0 -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -c $^
 
 ivtv-encoder: enc_mindex.o enc_chann.o encoder.o
-       $(CC) -lpthread -o $@ $^
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lpthread
 
 install: all
        install -d $(DESTDIR)/$(HDRDIR)
Index: Makefile
===================================================================
--- Makefile    (revision 4154)
+++ Makefile    (working copy)
@@ -1,6 +1,10 @@
+# sane defaults for CFLAGS and CXXFLAGS:
+CFLAGS = -O2 -Wall -pipe
+CXXFLAGS = $(CFLAGS)
+
 all clean install:
-       make -C utils $@
-       make -C test $@
+       $(MAKE) -C utils $@
+       $(MAKE) -C test $@
 
 distclean: clean
 

Attachment: pgpRmehmcNxjc.pgp
Description: PGP signature

_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to