# HG changeset patch # User erikj # Date 1362465540 28800 # Node ID d778bb46a9a508113cbb1dfd59a48ef5a27ff91a # Parent 27714220e50e44a9a88c48970cff08419976ded9 8008451: Make mac builds on 10.8 work on 10.7 Reviewed-by: jcoomes, ohair diff -r 27714220e50e -r d778bb46a9a5 make/bsd/makefiles/gcc.make --- a/make/bsd/makefiles/gcc.make Mon Mar 04 12:42:14 2013 -0800 +++ b/make/bsd/makefiles/gcc.make Mon Mar 04 22:39:00 2013 -0800 @@ -229,6 +229,20 @@ CFLAGS += -DDONT_USE_PRECOMPILED_HEADER endif +ifeq ($(OS_VENDOR), Darwin) + # Setting these parameters makes it an error to link to macosx APIs that are + # newer than the given OS version and makes the linked binaries compatible even + # if built on a newer version of the OS. + # The expected format is X.Y.Z + ifeq ($(MACOSX_VERSION_MIN),) + MACOSX_VERSION_MIN=10.7.0 + endif + # The macro takes the version with no dots, ex: 1070 + CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \ + -mmacosx-version-min=$(MACOSX_VERSION_MIN) + LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) +endif + #------------------------------------------------------------------------ # Linker flags