annotate jdk/make/lib/LibCommon.gmk @ 27772:a0a13701758d

8065913: Various improvements in SetupNativeCompilation Reviewed-by: erikj
author ihse
date Wed, 26 Nov 2014 15:15:27 +0100
parents 8c9bd4be4a86
children 097b1d6f6894
rev   line source
chegar@25859 1 #
chegar@25859 2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
chegar@25859 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
chegar@25859 4 #
chegar@25859 5 # This code is free software; you can redistribute it and/or modify it
chegar@25859 6 # under the terms of the GNU General Public License version 2 only, as
chegar@25859 7 # published by the Free Software Foundation. Oracle designates this
chegar@25859 8 # particular file as subject to the "Classpath" exception as provided
chegar@25859 9 # by Oracle in the LICENSE file that accompanied this code.
chegar@25859 10 #
chegar@25859 11 # This code is distributed in the hope that it will be useful, but WITHOUT
chegar@25859 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
chegar@25859 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
chegar@25859 14 # version 2 for more details (a copy is included in the LICENSE file that
chegar@25859 15 # accompanied this code).
chegar@25859 16 #
chegar@25859 17 # You should have received a copy of the GNU General Public License version
chegar@25859 18 # 2 along with this work; if not, write to the Free Software Foundation,
chegar@25859 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
chegar@25859 20 #
chegar@25859 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
chegar@25859 22 # or visit www.oracle.com if you need additional information or have any
chegar@25859 23 # questions.
chegar@25859 24 #
chegar@25859 25
chegar@25859 26 default: all
chegar@25859 27
chegar@25859 28 include $(SPEC)
chegar@25859 29 include MakeBase.gmk
chegar@25859 30 include NativeCompilation.gmk
chegar@25859 31
chegar@25859 32 # Build tools
chegar@25859 33 include Tools.gmk
chegar@25859 34
chegar@25859 35 GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
chegar@25859 36
ihse@27736 37 # Put the libraries here. Different locations for different target OS types.
ihse@27736 38 ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
chegar@25859 39 INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
chegar@25859 40 else
chegar@25859 41 INSTALL_LIBRARIES_HERE := $(JDK_OUTPUTDIR)/bin
chegar@25859 42 endif
chegar@25859 43
chegar@25859 44 # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
chegar@25859 45 # elegant solution to this.
chegar@25859 46 WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
chegar@25859 47
ihse@27772 48 ifdef OPENJDK
ihse@27772 49 # Build everything with debugging on OpenJDK
chegar@25859 50 DEBUG_ALL_BINARIES := true
ihse@27772 51 else
ihse@27772 52 # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
ihse@27772 53 # not on other platforms.
ihse@27772 54 ifeq ($(OPENJDK_TARGET_OS), windows)
ihse@27772 55 DEBUG_ALL_BINARIES := true
ihse@27772 56 else
ihse@27772 57 DEBUG_ALL_BINARIES := false
ihse@27772 58 endif
chegar@25859 59 endif
chegar@25859 60
chegar@25859 61 ################################################################################
chegar@25859 62
chegar@25859 63 # Find the default set of src dirs for a native library.
chegar@25859 64 # Param 1 - module name
chegar@25859 65 # Param 2 - library name
chegar@25859 66 FindSrcDirsForLib = $(call uniq, $(wildcard \
chegar@25859 67 $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
ihse@27736 68 $(JDK_TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
chegar@25859 69 $(JDK_TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
chegar@25859 70
chegar@25859 71 ################################################################################
chegar@25859 72
chegar@25859 73 # A lot of libraries are dependent on libjava. Define the name of that
chegar@25859 74 # library here to make dependency declarations to it possible in other files.
chegar@25859 75 BUILD_LIBJAVA := $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)java$(SHARED_LIBRARY_SUFFIX)
chegar@25859 76
chegar@25859 77 # Also define the header include flags needed to compile against it.
chegar@25859 78 LIBJAVA_HEADER_FLAGS := $(addprefix -I, $(call FindSrcDirsForLib, java.base, java))
chegar@25859 79
chegar@25859 80 ################################################################################
chegar@25859 81
chegar@25859 82 # Define it here since there are multiple uses.
chegar@25859 83 ifeq ($(USE_EXTERNAL_LIBZ), true)
chegar@25859 84 LIBZ := -lz
chegar@25859 85 else
chegar@25859 86 ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
chegar@25859 87 endif