021-darwin_compat.patch 881 B

1234567891011121314151617181920212223
  1. --- a/config.mk
  2. +++ b/config.mk
  3. @@ -64,9 +64,17 @@ HOSTSTRIP = strip
  4. #
  5. ifeq ($(HOSTOS),darwin)
  6. -HOSTCC = cc
  7. -HOSTCFLAGS += -traditional-cpp
  8. -HOSTLDFLAGS += -multiply_defined suppress
  9. +#get the major and minor product version (e.g. '10' and '6' for Snow Leopard)
  10. +DARWIN_MAJOR_VERSION = $(shell sw_vers -productVersion | cut -f 1 -d '.')
  11. +DARWIN_MINOR_VERSION = $(shell sw_vers -productVersion | cut -f 2 -d '.')
  12. +
  13. +before-snow-leopard = $(shell if [ $(DARWIN_MAJOR_VERSION) -le 10 -a \
  14. + $(DARWIN_MINOR_VERSION) -le 5 ] ; then echo "$(1)"; else echo "$(2)"; fi ;)
  15. +
  16. +# Snow Leopards build environment has no longer restrictions as described above
  17. +HOSTCC = $(call before-snow-leopard, "cc", "gcc")
  18. +HOSTCFLAGS += $(call before-snow-leopard, "-traditional-cpp")
  19. +HOSTLDFLAGS += $(call before-snow-leopard, "-multiply_defined suppress")
  20. else
  21. HOSTCC = gcc
  22. endif