make/lib/NioLibraries.gmk
changeset 47216 71c04702a3d5
parent 41215 e139c1cb033a
child 47217 72e3ae9a25eb
equal deleted inserted replaced
47215:4ebc2e2fb97c 47216:71c04702a3d5
       
     1 #
       
     2 # Copyright (c) 2011, 2016, 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 BUILD_LIBNIO_SRC := \
       
    27     $(JDK_TOPDIR)/src/java.base/share/native/libnio \
       
    28     $(JDK_TOPDIR)/src/java.base/share/native/libnio/ch \
       
    29     $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio \
       
    30     $(sort $(wildcard \
       
    31       $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/ch \
       
    32       $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/libnio/fs \
       
    33       $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/ch \
       
    34       $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS)/native/libnio/fs)) \
       
    35     #
       
    36 
       
    37 BUILD_LIBNIO_CFLAGS := \
       
    38     $(addprefix -I, $(BUILD_LIBNIO_SRC)) \
       
    39     -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
       
    40     $(LIBJAVA_HEADER_FLAGS) \
       
    41     $(addprefix -I, $(BUILD_LIBNET_SRC))
       
    42 
       
    43 ifeq ($(OPENJDK_TARGET_OS), linux)
       
    44   BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
       
    45 endif
       
    46 
       
    47 ifeq ($(OPENJDK_TARGET_OS), macosx)
       
    48   BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
       
    49 endif
       
    50 
       
    51 ifeq ($(OPENJDK_TARGET_OS), solaris)
       
    52   BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
       
    53 endif
       
    54 
       
    55 ifeq ($(OPENJDK_TARGET_OS), aix)
       
    56   BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
       
    57 endif
       
    58 
       
    59 $(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
       
    60     LIBRARY := nio, \
       
    61     OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
       
    62     SRC := $(BUILD_LIBNIO_SRC), \
       
    63     EXCLUDE_FILES := $(BUILD_LIBNIO_EXFILES), \
       
    64     OPTIMIZATION := HIGH, \
       
    65     WARNINGS_AS_ERRORS_xlc := false, \
       
    66     CFLAGS := $(CFLAGS_JDKLIB) \
       
    67         $(BUILD_LIBNIO_CFLAGS), \
       
    68     MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
       
    69     LDFLAGS := $(LDFLAGS_JDKLIB) \
       
    70         $(call SET_SHARED_LIBRARY_ORIGIN), \
       
    71     LIBS_unix := -ljava -lnet, \
       
    72     LIBS_linux := -lpthread $(LIBDL), \
       
    73     LIBS_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
       
    74         -lsendfile -lc, \
       
    75     LIBS_aix := $(LIBDL), \
       
    76     LIBS_macosx := \
       
    77         -framework CoreFoundation -framework CoreServices, \
       
    78     LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
       
    79         $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnet/net.lib \
       
    80         advapi32.lib, \
       
    81     VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
       
    82     RC_FLAGS := $(RC_FLAGS) \
       
    83         -D "JDK_FNAME=nio.dll" \
       
    84         -D "JDK_INTERNAL_NAME=nio" \
       
    85         -D "JDK_FTYPE=0x2L", \
       
    86     OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libnio, \
       
    87 ))
       
    88 
       
    89 TARGETS += $(BUILD_LIBNIO)
       
    90 
       
    91 $(BUILD_LIBNIO): $(BUILD_LIBNET)