mcelog-1.0_pre3_p20120918-build.patch 849 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From: Julian Ospald <hasufell@gentoo.org>
  2. Date: Wed Oct 24 15:41:33 UTC 2012
  3. Subject: build system
  4. don't overwrite system CFLAGS, only append "-g -Os" if DEBUG=1 is passed
  5. as argument
  6. always use $(CC) instead of "gcc"
  7. --- Makefile
  8. +++ Makefile
  9. @@ -1,4 +1,11 @@
  10. -CFLAGS := -g -Os
  11. +CC ?= gcc
  12. +
  13. +# set to 1 to enable debug flags
  14. +DEBUG = 0
  15. +ifeq ($(DEBUG),1)
  16. +CFLAGS += -g -Os
  17. +endif
  18. +
  19. prefix := /usr
  20. etcprefix :=
  21. # Define appropiately for your distribution
  22. @@ -70,7 +77,7 @@
  23. rm -f ${CLEAN} ${OBJ}
  24. tsc: tsc.c
  25. - gcc -o tsc ${CFLAGS} -DSTANDALONE tsc.c ${LDFLAGS}
  26. + $(CC) -o tsc ${CFLAGS} -DSTANDALONE tsc.c ${LDFLAGS}
  27. dbquery: db.o dbquery.o memutil.o
  28. @@ -101,7 +108,7 @@
  29. echo $(SRC)
  30. config-test: config.c
  31. - gcc -DTEST=1 config.c -o config-test
  32. + $(CC) -DTEST=1 config.c -o config-test
  33. test:
  34. $(MAKE) -C tests test DEBUG=""