jdk/make/lib/NioLibraries.gmk
author rfield
Fri, 25 Mar 2016 18:36:19 -0700
changeset 36718 bf40906bf49d
parent 35276 50b3cdcef339
child 37529 868c7195632c
permissions -rw-r--r--
8151755: jshell tool: properly cover resolution issues in output configuration 8152246: jshell tool: history overflow Reviewed-by: jlahoda

#
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

BUILD_LIBNIO_SRC := \
    $(JDK_TOPDIR)/src/java.base/share/native/libnio \
    $(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
    $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
    $(sort $(wildcard \
      $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
      $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
      $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
      $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
    #

BUILD_LIBNIO_CFLAGS := \
    $(addprefix -I, $(BUILD_LIBNIO_SRC)) \
    -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
    $(LIBJAVA_HEADER_FLAGS) \
    $(addprefix -I, $(BUILD_LIBNET_SRC))

ifeq ($(OPENJDK_TARGET_OS), linux)
  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
endif

ifeq ($(OPENJDK_TARGET_OS), macosx)
  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
  BUILD_LIBNIO_EXFILES += \
      GioFileTypeDetector.c \
      #
endif

ifeq ($(OPENJDK_TARGET_OS), solaris)
  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
endif

ifeq ($(OPENJDK_TARGET_OS), aix)
  BUILD_LIBNIO_MAPFILE:=$(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
  BUILD_LIBNIO_EXFILES += \
      /NativeThread.c
  # Notice: we really need the leading slash here because otherwise every
  # FILE_NAME in EXCLUDE_FILES will actually match any file ending in FILE_NAME
  # (e.g. 'NativeThread.c' will also exclude 'AixNativeThread.c').
endif

$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
    LIBRARY := nio, \
    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    SRC := $(BUILD_LIBNIO_SRC), \
    EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
    OPTIMIZATION := HIGH, \
    CFLAGS := $(CFLAGS_JDKLIB) \
        $(BUILD_LIBNIO_CFLAGS), \
    MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
    LDFLAGS := $(LDFLAGS_JDKLIB) \
        $(call SET_SHARED_LIBRARY_ORIGIN), \
    LIBS_unix := -ljava -lnet, \
    LIBS_linux := -lpthread $(LIBDL), \
    LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
        -lsendfile -lc, \
    LIBS_aix := $(LIBDL), \
    LIBS_macosx := \
        -framework CoreFoundation -framework CoreServices, \
    LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
        $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
        advapi32.lib, \
    VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
    RC_FLAGS := $(RC_FLAGS) \
        -D "JDK_FNAME=nio.dll" \
        -D "JDK_INTERNAL_NAME=nio" \
        -D "JDK_FTYPE=0x2L", \
    OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnio, \
))

TARGETS += $(BUILD_LIBNIO)

$(BUILD_LIBNIO): $(BUILD_LIBNET)