hotspot/make/lib/CompileLibjsig.gmk
author iignatyev
Mon, 09 May 2016 14:15:40 +0300
changeset 38255 5784bccf53b0
parent 38097 1ca3d6f508b1
child 41277 65200988b2ee
permissions -rw-r--r--
8148244: Finalize and integrate GTest implementation Reviewed-by: jwilhelm, erikj Contributed-by: stefan.karlsson@oracle.com, stefan.sarne@oracle.com, jesper.wilhelmsson@oracle.com, erik.helin@oracle.com, alexandre.iline@oracle.com, igor.ignatyev@oracle.com, erik.joelsson@oracle.com
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
    LIBJSIG_STRIP_SYMBOLS := true
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
    ifeq ($(OPENJDK_TARGET_OS), linux)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
      LIBJSIG_CFLAGS := -fPIC -D_GNU_SOURCE -D_REENTRANT $(EXTRA_CFLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
      LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE) $(EXTRA_CFLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
      # Flags for other CPUs can be provided in EXTRA_CFLAGS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
      ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
        LIBJSIG_CPU_FLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
      else ifeq ($(OPENJDK_TARGET_CPU), x86)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
        LIBJSIG_CPU_FLAGS := -m32 -march=i586
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
      endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
    else ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
      LIBJSIG_CFLAGS := -m64 -KPIC -mt
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
      LIBJSIG_LDFLAGS := -m64 -mt -xnolib
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
    else ifeq ($(OPENJDK_TARGET_OS), aix)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
      LIBJSIG_CFLAGS := -q64 -D_GNU_SOURCE -D_REENTRANT -qpic=large
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
      LIBJSIG_LDFLAGS := -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
      LIBJSIG_LIBS := $(LIBDL)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
      # NOTE: The old build compiled this library without -soname.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
      # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
      SET_SHARED_LIBRARY_NAME :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
    else ifeq ($(OPENJDK_TARGET_OS), macosx)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
      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
    74
      LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
      # NOTE: This lib is not stripped on macosx in old build. Looks like a mistake.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
      LIBJSIG_STRIP_SYMBOLS := false
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
      $(error Unknown target OS $(OPENJDK_TARGET_OS) in CompileLibjsig.gmk)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
    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
    82
    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
    83
    LIBJSIG_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/libjsig
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
    LIBJSIG_LDFLAGS += $(SHARED_LIBRARY_FLAGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
    $(eval $(call SetupNativeCompilation, BUILD_LIBJSIG, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
        LIBRARY := jsig, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
        EXTRA_FILES := $(LIBJSIG_SRC_FILE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
        OUTPUT_DIR := $(LIBJSIG_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
        LANG := C, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
        CFLAGS := $(LIBJSIG_CFLAGS) $(LIBJSIG_CPU_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
        LDFLAGS := $(LIBJSIG_LDFLAGS) $(LIBJSIG_CPU_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
        LIBS := $(LIBJSIG_LIBS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
        MAPFILE := $(LIBJSIG_MAPFILE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
        OBJECT_DIR := $(LIBJSIG_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
        STRIP_SYMBOLS := $(LIBJSIG_STRIP_SYMBOLS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
    TARGETS += $(BUILD_LIBJSIG)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
all: $(TARGETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
.PHONY: all