diff --git a/make/common/Defs-macosx.gmk b/make/common/Defs-macosx.gmk index b3349db2711c6401a79bad42bbdea4cdb993c95c..951a18de90acf1106e18afec4949591bfcd6a054 100644 --- a/make/common/Defs-macosx.gmk +++ b/make/common/Defs-macosx.gmk @@ -405,3 +405,11 @@ ifdef CROSS_COMPILE_ARCH endif LIB_LOCATION ?= $(LIBDIR) + +# Adding these macros will make it an error to link to mac APIs newer than OS version 10.7 +ifeq ($(MACOSX_REQUIRED_VERSION),) + MACOSX_REQUIRED_VERSION:=1070 +endif +MACOSX_OS_VERSION_CFLAGS := -DMAC_OS_X_VERSION_MAX_ALLOWED=$(MACOSX_REQUIRED_VERSION) -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MACOSX_REQUIRED_VERSION) +OTHER_CFLAGS += $(MACOSX_OS_VERSION_CFLAGS) +OTHER_CXXFLAGS += $(MACOSX_OS_VERSION_CFLAGS) diff --git a/makefiles/CompileDemos.gmk b/makefiles/CompileDemos.gmk index 4346e3dee740a2361277432db303a130aed8775d..f3100b10ab3077bb30246665b4e727f574fd2a9b 100644 --- a/makefiles/CompileDemos.gmk +++ b/makefiles/CompileDemos.gmk @@ -421,6 +421,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\ CFLAGS:=$(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \ -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \ LDFLAGS:=$(LDFLAGS_JDKLIB), \ + LDFLAGS_SUFFIX_solaris:=-lc,\ OBJECT_DIR:=$(JDK_OUTPUTDIR)/demoobjs/jni/Poller,\ OUTPUT_DIR:=$(JDK_OUTPUTDIR)/demoobjs, \ LIBRARY:=Poller)) diff --git a/makefiles/CompileNativeLibraries.gmk b/makefiles/CompileNativeLibraries.gmk index fdd2762107de542baf3408f4fd0e85ba432a5925..01dbc2ba41719bc45d2226524741a0dfff0c5f80 100644 --- a/makefiles/CompileNativeLibraries.gmk +++ b/makefiles/CompileNativeLibraries.gmk @@ -2188,6 +2188,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJFR,\ MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \ LDFLAGS:=$(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN),\ + LDFLAGS_SUFFIX_solaris:=-lc,\ VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\ RC_FLAGS:=$(RC_FLAGS)\ -D "JDK_FNAME=jfr.dll" \ @@ -2236,6 +2237,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS,\ LDFLAGS:=$(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN),\ LDFLAGS_SUFFIX_linux:=-lc -lpthread,\ + LDFLAGS_SUFFIX_solaris:=-lc,\ LDFLAGS_SUFFIX_windows:=$(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \ LDFLAGS_SUFFIX_posix:=-lm -ljava -ljvm,\ VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc,\ @@ -2939,6 +2941,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO,\ MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \ LDFLAGS:=$(LDFLAGS_JDKLIB),\ LDFLAGS_SUFFIX:=$(LIBDL),\ + LDFLAGS_SUFFIX_solaris:=-lc,\ OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2ucrypto)) $(BUILD_LIBJ2UCRYPTO) : $(BUILD_LIBJAVA) diff --git a/makefiles/Import.gmk b/makefiles/Import.gmk index e26bc4dde34546170467731b3b3a0b987a450e41..5e99b53f0e8dca9ed07701d80c473acdbbe35428 100644 --- a/makefiles/Import.gmk +++ b/makefiles/Import.gmk @@ -100,33 +100,13 @@ IMPORT_TARGET_FILES += $(IMPORT_TARGET_CLASSES) $(IMPORT_TARGET_SOURCES) $(IMPOR ####### -ifeq ($(OPENJDK_TARGET_OS),solaris) -define do-install-file - $(MKDIR) -p '$$(@D)' - $(RM) '$$@' - $(CP) -r -P '$$<' '$$(@D)' -endef -else ifeq ($(OPENJDK_TARGET_OS),macosx) -define do-install-file - $(MKDIR) -p '$$(@D)' - $(RM) '$$@' - $(CP) -pRP '$$<' '$$@' -endef -else -define do-install-file - $(MKDIR) -p '$$(@D)' - $(RM) '$$@' - $(CP) -P '$$<' '$$@' -endef -endif - define CopyDir $1_SRC_FILES := $(shell $(FIND) $2 -type f -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE),$4) \)) $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES)) IMPORT_TARGET_FILES += $$($1_DST_FILES) $3/% : $2/% $(ECHO) $(LOG_INFO) Copying $$(@F) - $(do-install-file) + $$(install-file) endef ####### @@ -222,26 +202,4 @@ $(INSTALL_LIBRARIES_HERE)/minimal/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz ####### -ifeq ($(OPENJDK_TARGET_OS),solaris) -define install-file - $(MKDIR) -p '$(@D)' - $(RM) '$@' - $(CP) -r -P '$<' '$(@D)' -endef -else ifeq ($(OPENJDK_TARGET_OS),macosx) -define install-file - $(MKDIR) -p '$(@D)' - $(RM) '$@' - $(CP) -pRP '$<' '$@' -endef -else -define install-file - $(MKDIR) -p '$(@D)' - $(RM) '$@' - $(CP) -P '$<' '$@' -endef -endif - -####### - all: $(IMPORT_TARGET_FILES)