blob: 347c32376301a2f3a4e724963aa20f4465b58c5b [file] [log] [blame]
ihse554e46f2013-11-14 11:19:32 +01001#
2# Copyright (c) 2011, 2013, 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
26LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \
27 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \
michaelm37816142013-11-26 10:06:57 +000028 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/ \
ihse554e46f2013-11-14 11:19:32 +010029 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \
30 $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi
31
32ifeq ($(OPENJDK_TARGET_OS), windows)
33 LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm
34else
35 LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp
36endif
37
38LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir))
39
40LIBNET_EXCLUDE_FILES :=
41ifneq ($(OPENJDK_TARGET_OS), linux)
42 LIBNET_EXCLUDE_FILES += linux_close.c
43endif
44
45ifneq ($(OPENJDK_TARGET_OS), macosx)
46 LIBNET_EXCLUDE_FILES += bsd_close.c
47endif
48
kvn7130df72013-12-05 15:10:36 -080049ifeq ($(OPENJDK_TARGET_OS), aix)
50 LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/aix/native/java/net/
51endif
52
ihse554e46f2013-11-14 11:19:32 +010053ifeq ($(OPENJDK_TARGET_OS), windows)
54 LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
55else
56 LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
57 TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
58 NTLMAuthSequence.c NetworkInterface_winXP.c
59endif
60
61$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
62 LIBRARY := net, \
63 OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
64 SRC := $(LIBNET_SRC_DIRS), \
65 EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \
66 LANG := C, \
67 OPTIMIZATION := LOW, \
68 CFLAGS := $(CFLAGS_JDKLIB) \
69 $(LIBNET_CFLAGS), \
70 MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libnet/mapfile-vers, \
71 LDFLAGS := $(LDFLAGS_JDKLIB) \
72 $(call SET_SHARED_LIBRARY_ORIGIN), \
73 LDFLAGS_SUFFIX_macosx := -ljvm -ljava, \
74 LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lnsl -lsocket $(LIBDL) -lc, \
75 LDFLAGS_SUFFIX_linux := $(LIBDL) -ljvm -lpthread -ljava, \
kvn7130df72013-12-05 15:10:36 -080076 LDFLAGS_SUFFIX_aix := $(LIBDL) -ljvm -ljava,\
ihse554e46f2013-11-14 11:19:32 +010077 LDFLAGS_SUFFIX_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
78 delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
79 -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \
80 VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
81 RC_FLAGS := $(RC_FLAGS) \
82 -D "JDK_FNAME=net.dll" \
83 -D "JDK_INTERNAL_NAME=net" \
84 -D "JDK_FTYPE=0x2L", \
85 OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnet, \
86 DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
87
88$(BUILD_LIBNET): $(BUILD_LIBJAVA)
89
90BUILD_LIBRARIES += $(BUILD_LIBNET)
91
92$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
93 $(ECHO) $(LOG_INFO) Copying $(@F)
94 $(call install-file)
95
96COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
97
98ifeq ($(OPENJDK_TARGET_OS), solaris)
99 $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
100 $(ECHO) $(LOG_INFO) Copying $(@F)
101 $(call install-file)
102
103 COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
104endif