summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/patches/06_cflags_ldflags.patch32
-rw-r--r--debian/patches/series1
2 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches/06_cflags_ldflags.patch b/debian/patches/06_cflags_ldflags.patch
new file mode 100644
index 00000000..02367691
--- /dev/null
+++ b/debian/patches/06_cflags_ldflags.patch
@@ -0,0 +1,32 @@
+Description: Patch to make CPPFLAGS, CXXFLAGS and LDFLAGS
+ from dpkg-buildflags be used.
+Forwarded: will do
+Author: Ruben Undheim <ruben.undheim@gmail.com>
+Index: yosys/Makefile
+===================================================================
+--- yosys.orig/Makefile 2014-09-14 12:27:43.000000000 +0200
++++ yosys/Makefile 2014-09-14 12:28:36.066660204 +0200
+@@ -27,8 +27,8 @@
+
+ all: top-all
+
+-CXXFLAGS = -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -DYOSYS_SRC='"$(shell pwd)"' -D_YOSYS_ -fPIC -I${DESTDIR}/include
+-LDFLAGS = -L${DESTDIR}/lib
++CXXFLAGS += -Wall -Wextra -ggdb -I"$(shell pwd)" -MD -DYOSYS_SRC='"$(shell pwd)"' -D_YOSYS_ -fPIC -I${DESTDIR}/include
++LDFLAGS += -L${DESTDIR}/lib
+ LDLIBS = -lstdc++ -lm
+ QMAKE = qmake-qt4
+ SED = sed
+@@ -195,10 +195,10 @@
+ $(P) $(CXX) -o yosys $(LDFLAGS) $(OBJS) $(LDLIBS)
+
+ %.o: %.cc
+- $(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
++ $(P) $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<
+
+ %.o: %.cpp
+- $(P) $(CXX) -o $@ -c $(CXXFLAGS) $<
++ $(P) $(CXX) -o $@ -c $(CPPFLAGS) $(CXXFLAGS) $<
+
+ kernel/version_$(GIT_REV).cc: Makefile
+ $(P) rm -f kernel/version_*.o kernel/version_*.d kernel/version_*.cc
diff --git a/debian/patches/series b/debian/patches/series
index 8a942691..a91ae4f8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
03_notruntests.patch
04_installpath.patch
05_abc_executable.patch
+06_cflags_ldflags.patch