make/lib/NioLibraries.gmk
author ihse
Wed, 14 Mar 2018 23:26:27 +0100
branchihse-jdk-library-branch
changeset 56310 b74ed86a116a
parent 56287 593a452fcbeb
parent 49241 de4b3a04feae
child 56311 e05b4241302b
permissions -rw-r--r--
Merge from default

#
# Copyright (c) 2011, 2018, 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 := \
    $(TOPDIR)/src/java.base/share/native/libnio \
    $(TOPDIR)/src/java.base/share/native/libnio/ch \
    $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
    $(sort $(wildcard \
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
      $(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
      $(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 := $(TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
endif

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

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

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

$(eval $(call SetupJdkLibrary, BUILD_LIBNIO, \
    NAME := nio, \
    SRC := $(BUILD_LIBNIO_SRC), \
    EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
    OPTIMIZATION := HIGH, \
    WARNINGS_AS_ERRORS_xlc := false, \
    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, \
    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, \
))

TARGETS += $(BUILD_LIBNIO)

$(BUILD_LIBNIO): $(BUILD_LIBNET)