hotspot/make/lib/CompileLibjsig.gmk
author erikj
Wed, 05 Oct 2016 10:49:49 +0200
changeset 41277 65200988b2ee
parent 38097 1ca3d6f508b1
child 42559 f71b844f33d1
child 42144 01015af8278d
permissions -rw-r--r--
8150736: Excessive disk space used by build system Reviewed-by: ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     2
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    26
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
# Create the libjsig.so shared library
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
default: all
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
include $(SPEC)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
include MakeBase.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
include NativeCompilation.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
ifneq ($(OPENJDK_TARGET_OS), windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
  ifeq ($(STATIC_BUILD), false)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
    ifeq ($(OPENJDK_TARGET_OS), linux)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
      LIBJSIG_CFLAGS := -fPIC -D_GNU_SOURCE -D_REENTRANT $(EXTRA_CFLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
      LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE) $(EXTRA_CFLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
      # Flags for other CPUs can be provided in EXTRA_CFLAGS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
      ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
        LIBJSIG_CPU_FLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
      else ifeq ($(OPENJDK_TARGET_CPU), x86)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
        LIBJSIG_CPU_FLAGS := -m32 -march=i586
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
      endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
    else ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
      LIBJSIG_CFLAGS := -m64 -KPIC -mt
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
      LIBJSIG_LDFLAGS := -m64 -mt -xnolib
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
    else ifeq ($(OPENJDK_TARGET_OS), aix)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
      LIBJSIG_CFLAGS := -q64 -D_GNU_SOURCE -D_REENTRANT -qpic=large
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
      LIBJSIG_LDFLAGS := -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
    else ifeq ($(OPENJDK_TARGET_OS), macosx)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
      LIBJSIG_CFLAGS := -m64 -D_GNU_SOURCE -pthread -mno-omit-leaf-frame-pointer -mstack-alignment=16 -fPIC
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
      LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
      $(error Unknown target OS $(OPENJDK_TARGET_OS) in CompileLibjsig.gmk)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    LIBJSIG_SRC_FILE := $(HOTSPOT_TOPDIR)/src/os/$(HOTSPOT_TARGET_OS)/vm/jsig.c
38097
1ca3d6f508b1 8150601: Remove the old Hotspot build system
erikj
parents: 37437
diff changeset
    79
    LIBJSIG_MAPFILE := $(wildcard $(HOTSPOT_TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    LIBJSIG_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/libjsig
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
    LIBJSIG_LDFLAGS += $(SHARED_LIBRARY_FLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
    84
    LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
    85
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
    $(eval $(call SetupNativeCompilation, BUILD_LIBJSIG, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
        LIBRARY := jsig, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
        EXTRA_FILES := $(LIBJSIG_SRC_FILE), \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
    89
        OUTPUT_DIR := $(LIB_OUTPUTDIR), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
        LANG := C, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
        CFLAGS := $(LIBJSIG_CFLAGS) $(LIBJSIG_CPU_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
        LDFLAGS := $(LIBJSIG_LDFLAGS) $(LIBJSIG_CPU_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
        LIBS := $(LIBJSIG_LIBS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
        MAPFILE := $(LIBJSIG_MAPFILE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
        OBJECT_DIR := $(LIBJSIG_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
    TARGETS += $(BUILD_LIBJSIG)
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
    99
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   100
    ############################################################################
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   101
    # Create symlinks in each variant sub dir
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   102
    ifeq ($(OPENJDK_TARGET_OS), macosx)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   103
      DEBUG_INFO_SUFFIX := $(SHARED_LIBRARY_SUFFIX).dSYM
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   104
    else
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   105
      DEBUG_INFO_SUFFIX := .debuginfo
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   106
    endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   107
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   108
    # $1 variant subdir
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   109
    define CreateSymlinks
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   110
      # Always symlink from libdir/variant/libjsig.so -> ../libjsig.so and
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   111
      # the corresponding debuginfo.
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   112
      $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   113
          $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   114
		$$(call MakeDir, $$(@D))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   115
		$(RM) $$@
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   116
		$(LN) -s ../$$(@F) $$@
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   117
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   118
      TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   119
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   120
      ifeq ($(COPY_DEBUG_SYMBOLS), true)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   121
        $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX): \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   122
            $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   123
		$$(call MakeDir, $$(@D))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   124
		$(RM) $$@
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   125
		$(LN) -s ../$$(@F) $$@
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   126
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   127
        TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   128
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   129
        ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   130
          $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz: \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   131
              $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   132
			$(CD) $$(@D) && $(ZIP) -q -y $$@ $$(basename $$(@F))$(DEBUG_INFO_SUFFIX)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   133
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   134
          TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   135
        endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   136
      endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   137
    endef
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   138
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   139
    # The subdir is the same as the variant for client and minimal, for all
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   140
    # others it's server.
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   141
    VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   142
        $(if $(filter-out client minimal, $(JVM_VARIANTS)), server)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   143
    $(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v)))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   144
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   145
    ############################################################################
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   146
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   147
    include CopyToExplodedJdk.gmk
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 38097
diff changeset
   148
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   150
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
all: $(TARGETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   153
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   154
.PHONY: all