make/lib/SoundLibraries.gmk
author ihse
Fri, 23 Mar 2018 09:51:02 +0100
changeset 49289 148e29df1644
parent 49261 d5c43e9f08fb
permissions -rw-r--r--
8071469: Cleanup include and exclude of sound native libraries Reviewed-by: amenkov, erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
     2
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
12317
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     4
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    10
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    15
# accompanied this code).
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    16
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    20
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    23
# questions.
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    24
#
9670c1610c53 7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff changeset
    25
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    26
LIBJSOUND_SRC_DIRS := $(wildcard \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    27
    $(TOPDIR)/src/java.desktop/share/native/libjsound \
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    28
    $(TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS)/native/libjsound \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    29
    )
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    30
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 22607
diff changeset
    31
LIBJSOUND_CFLAGS := \
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    32
    -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 22607
diff changeset
    33
    $(LIBJAVA_HEADER_FLAGS) \
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 22607
diff changeset
    34
    $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir)) \
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    35
    -DUSE_PORTS=TRUE \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    36
    -DUSE_DAUDIO=TRUE \
25859
3317bb8137f4 8054834: Modular Source Code
chegar
parents: 22607
diff changeset
    37
    #
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    38
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    39
ifneq ($(OPENJDK_TARGET_OS), solaris)
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    40
  LIBJSOUND_CFLAGS += \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    41
      -DUSE_PLATFORM_MIDI_OUT=TRUE \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    42
      -DUSE_PLATFORM_MIDI_IN=TRUE \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    43
      #
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    44
endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    45
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    46
ifeq ($(OPENJDK_TARGET_OS), windows)
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    47
  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    48
endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    49
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    50
ifeq ($(OPENJDK_TARGET_OS), linux)
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    51
  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    52
endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    53
22593
938340719ac2 8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents: 22592
diff changeset
    54
ifeq ($(OPENJDK_TARGET_OS), aix)
22595
aaa6b141196c 8028066: PPC64: 8025715 changes broke AIX build after sync
simonis
parents: 22594
diff changeset
    55
  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_AIX
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    56
endif
22593
938340719ac2 8024900: PPC64: Enable new build on AIX (jdk part)
simonis
parents: 22592
diff changeset
    57
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    58
ifeq ($(OPENJDK_TARGET_OS), macosx)
29931
64e274ed6567 8077824: Introduce DefineNativeToolchain to handle toolchain configurations
erikj
parents: 29374
diff changeset
    59
  LIBJSOUND_TOOLCHAIN := TOOLCHAIN_LINK_CXX
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    60
  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    61
endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    62
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    63
ifeq ($(OPENJDK_TARGET_OS), solaris)
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    64
  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    65
endif
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    66
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    67
$(eval $(call SetupJdkLibrary, BUILD_LIBJSOUND, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
    68
    NAME := jsound, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    69
    SRC := $(LIBJSOUND_SRC_DIRS), \
29931
64e274ed6567 8077824: Introduce DefineNativeToolchain to handle toolchain configurations
erikj
parents: 29374
diff changeset
    70
    TOOLCHAIN := $(LIBJSOUND_TOOLCHAIN), \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    71
    OPTIMIZATION := LOW, \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    72
    CFLAGS := $(CFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    73
        $(LIBJSOUND_CFLAGS), \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    74
    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    75
    MAPFILE := $(TOPDIR)/make/mapfiles/libjsound/mapfile-vers, \
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    76
    LDFLAGS := $(LDFLAGS_JDKLIB) \
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    77
        $(call SET_SHARED_LIBRARY_ORIGIN), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32111
diff changeset
    78
    LIBS_unix := -ljava -ljvm, \
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    79
    LIBS_linux := $(ALSA_LIBS), \
33406
4680f7495292 8140661: Rename LDFLAGS_SUFFIX to LIBS
ihse
parents: 32111
diff changeset
    80
    LIBS_macosx := -framework CoreAudio -framework CoreFoundation \
49289
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    81
        -framework CoreServices -framework AudioUnit \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    82
        -framework CoreMIDI -framework AudioToolbox $(LIBCXX), \
148e29df1644 8071469: Cleanup include and exclude of sound native libraries
ihse
parents: 49261
diff changeset
    83
    LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib dsound.lib winmm.lib user32.lib ole32.lib, \
35276
50b3cdcef339 8145596: Enable debug symbols for all libraries
ihse
parents: 33406
diff changeset
    84
))
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    85
49261
d5c43e9f08fb 8199745: JDK-8199668 introduced a build race on macosx
erikj
parents: 49244
diff changeset
    86
$(BUILD_LIBJSOUND): $(call FindLib, java.base, java)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    87
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents: 25859
diff changeset
    88
TARGETS += $(BUILD_LIBJSOUND)
20547
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    89
453837141fac 8001931: The new build system whitespace cleanup
ihse
parents: 20203
diff changeset
    90
##########################################################################################