1 #
   2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 include LibCommon.gmk
  27 
  28 ################################################################################
  29 
  30 BUILD_LIBHPROF_SRC := $(call FindSrcDirsForLib, jdk.hprof.agent, hprof)
  31 
  32 BUILD_LIBHPROF_CFLAGS := $(addprefix -I, $(BUILD_LIBHPROF_SRC)) \
  33     -I$(JDK_TOPDIR)/src/demo/share/jvmti/java_crw_demo
  34     
  35 BUILD_LIBHPROF_LDFLAGS :=
  36 
  37 LIBHPROF_OPTIMIZATION := HIGHEST
  38 ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
  39   ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
  40     LIBHPROF_OPTIMIZATION := LOW
  41   endif
  42 endif
  43 
  44 $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
  45     LIBRARY := hprof, \
  46     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  47     SRC := $(BUILD_LIBHPROF_SRC), \
  48     OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \
  49     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
  50         $(BUILD_LIBHPROF_CFLAGS), \
  51     CFLAGS_debug := -DHPROF_LOGGING, \
  52     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libhprof/mapfile-vers, \
  53     LDFLAGS := $(LDFLAGS_JDKLIB) \
  54         $(call SET_SHARED_LIBRARY_ORIGIN), \
  55     LDFLAGS_windows := wsock32.lib winmm.lib advapi32.lib, \
  56     LDFLAGS_SUFFIX_linux := $(LIBDL), \
  57     LDFLAGS_SUFFIX_macosx := $(LIBDL), \
  58     LDFLAGS_SUFFIX_solaris := -lsocket -lnsl $(LIBDL) -lc, \
  59     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  60     RC_FLAGS := $(RC_FLAGS) \
  61         -D "JDK_FNAME=hprof.dll" \
  62         -D "JDK_INTERNAL_NAME=hprof" \
  63         -D "JDK_FTYPE=0x2L", \
  64     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libhprof_jvmti, \
  65     DEBUG_SYMBOLS := true))
  66 
  67 TARGETS += $(BUILD_LIBHPROF)
  68 
  69 ################################################################################
  70 
  71 LIBJAVA_CRW_DEMO_SRC := $(JDK_TOPDIR)/src/demo/share/jvmti/java_crw_demo
  72 
  73 $(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO, \
  74     LIBRARY := java_crw_demo, \
  75     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
  76     SRC := $(LIBJAVA_CRW_DEMO_SRC), \
  77     OPTIMIZATION := LOW, \
  78     CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
  79         $(addprefix -I, $(LIBJAVA_CRW_DEMO_SRC)), \
  80     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjava_crw_demo/mapfile-vers, \
  81     LDFLAGS := $(LDFLAGS_JDKLIB) \
  82         $(call SET_SHARED_LIBRARY_ORIGIN), \
  83     LDFLAGS_SUFFIX_solaris := -lc, \
  84     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
  85     RC_FLAGS := $(RC_FLAGS) \
  86         -D "JDK_FNAME=java_crw_demo.dll" \
  87         -D "JDK_INTERNAL_NAME=java_crw_demo" \
  88         -D "JDK_FTYPE=0x2L", \
  89     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava_crw_demo, \
  90     DEBUG_SYMBOLS := true))
  91 
  92 TARGETS += $(BUILD_LIBJAVA_CRW_DEMO)
  93 
  94 ################################################################################