You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

  1. From f732d44c2bc47e6eccf65e5eb3160734f11e5d3e Mon Sep 17 00:00:00 2001
  2. From: Rosen Penev <rosenp@gmail.com>
  3. Date: Thu, 27 Dec 2018 20:16:59 -0800
  4. Subject: [PATCH] Switch Makefile to compile with g++
  5. With this change I managed to get OpenWrt to compile with uclibcxx
  6. instead of libstdcpp.
  7. Made CXX adjustable by the shell as OpenWrt needs to override this.
  8. It also has its own ar.
  9. EXTRA_CXXFLAGS seems to be the proper variable based on usage in the
  10. OpenWrt tree.
  11. ---
  12. Makefile | 12 ++++++------
  13. 1 file changed, 6 insertions(+), 6 deletions(-)
  14. diff --git a/Makefile b/Makefile
  15. index 51aaa37..f05bf0d 100644
  16. --- a/v4l2wrapper/Makefile
  17. +++ b/v4l2wrapper/Makefile
  18. @@ -1,12 +1,12 @@
  19. -CFLAGS = -W -Wall -pthread -g -pipe $(CFLAGS_EXTRA)
  20. -CFLAGS += -I inc
  21. +CXXFLAGS ?= -W -Wall -pthread -g -pipe $(EXTRA_CXXFLAGS)
  22. +CXXFLAGS += -I inc
  23. RM = rm -rf
  24. -CC = $(CROSS)gcc
  25. -AR = $(CROSS)ar
  26. +CXX ?= $(CROSS)g++
  27. +AR ?= $(CROSS)ar
  28. PREFIX?=/usr
  29. ifneq ($(wildcard $(SYSROOT)$(PREFIX)/include/log4cpp/Category.hh),)
  30. -CFLAGS += -DHAVE_LOG4CPP -I $(SYSROOT)$(PREFIX)/include
  31. +CXXFLAGS += -DHAVE_LOG4CPP -I $(SYSROOT)$(PREFIX)/include
  32. endif
  33. V4L2WRAPPER_CPP:=$(wildcard src/*.cpp)
  34. @@ -17,7 +17,7 @@ V4L2WRAPPER_OBJ:=$(V4L2WRAPPER_CPP:%.cpp=%.o)
  35. all: libv4l2wrapper.a
  36. %.o: %.cpp
  37. - $(CC) -c -o $@ $< $(CFLAGS)
  38. + $(CXX) -c -o $@ $< $(CXXFLAGS)
  39. libv4l2wrapper.a: $(V4L2WRAPPER_OBJ)
  40. $(AR) rcs $@ $^
  41. --
  42. 2.20.1