jdk/makefiles/GensrcX11Wrappers.gmk
author jgish
Fri, 28 Dec 2012 16:56:54 -0500
changeset 14997 97d6098fd419
parent 14233 18fda1299ea9
child 15126 bceb690ccf35
permissions -rw-r--r--
8005118: Javadoc styles are inconsistent Summary: use a common javadoc style in the String classes Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     1
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     2
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     4
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    10
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    15
# accompanied this code).
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    16
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    20
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    23
# questions.
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    24
#
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    25
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    26
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    27
# This file is responsible for extracting the x11 native struct offsets to
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    28
# the xawt Java library. This is done by compiling and running a native
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    29
# binary, which dumps output to a text file. The offsets differ on 32 and 64
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    30
# bit systems, so care must be taken here.
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    31
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    32
# Note: Some of the more complex logic here is most likely not needed anymore.
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    33
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    34
GENSRC_X11WRAPPERS :=
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    35
GENSRC_X11WRAPPERS_TMP := $(JDK_OUTPUTDIR)/gensrc_x11wrappers
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
    36
GENSRC_X11WRAPPERS_DST := $(JDK_OUTPUTDIR)/gensrc
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    37
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    38
GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    39
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    40
# Normal case is to generate version according to target bits
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    41
GENSRC_SIZES := sizes.$(OPENJDK_TARGET_CPU_BITS)
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    42
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    43
ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    44
ifneq ($(OPENJDK_TARGET_OS), linux)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    45
# On all 64-bit systems except Linux, generate both 32 and 64 bit versions
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    46
GENSRC_SIZES := sizes.32 sizes.64
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    47
endif
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    48
else
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
    49
ifeq ($(OPENJDK_TARGET_OS), solaris)
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
    50
# As a special case, solaris 32-bit also generates the 64-bit version
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    51
GENSRC_SIZES := sizes.32 sizes.64
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    52
endif
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    53
endif
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    54
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    55
##########################################################################################
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    56
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    57
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
    58
	$(ECHO) "Generating X11 wrapper ($*-bit version)"
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    59
	$(MKDIR) -p $(@D)
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    60
	$(RM) $@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    61
	$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    62
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    63
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    64
	$(MKDIR) -p $(@D)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    65
	$(RM) $@ $@.tmp
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    66
	(cd $(@D) && $(BUILD_CC) -m$* -o $@.tmp $< \
14233
18fda1299ea9 8001891: build-infra: Adding X_CFLAGS and X_LIBS to lwawt and sizer compilation
ohrstrom
parents: 14231
diff changeset
    67
              $(X_CFLAGS) \
18fda1299ea9 8001891: build-infra: Adding X_CFLAGS and X_LIBS to lwawt and sizer compilation
ohrstrom
parents: 14231
diff changeset
    68
              $(X_LIBS) \
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    69
              -I$(JDK_OUTPUTDIR)/include \
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    70
              -I$(JDK_TOPDIR)/src/share/javavm/export \
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    71
              -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
13164
72c5d01a857d 7181504: Update of latest build-infra Makefiles
erikj
parents: 12892
diff changeset
    72
              -I$(JDK_TOPDIR)//src/share/native/common \
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    73
              -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    74
              -I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    75
	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    76
	      -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    77
	$(MV) $@.tmp $@
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    78
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    79
# Run the generated sizer binary to create the sizes text file
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    80
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.% : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    81
	$(MKDIR) -p $(@D)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    82
	$(RM) $@ $@.tmp
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    83
	$< > $@.tmp
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    84
	$(MV) $@.tmp $@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    85
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    86
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    87
  # On solaris-x86 we also need to create the 64-bit version, but we can't run a 64-bit binary
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    88
  # As a workaround, copy this from a pre-generated file.
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    89
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator/sizes.64-solaris-i386
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    90
	$(MKDIR) -p $(@D)
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    91
	$(RM) $@
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    92
	$(CP) $< $@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    93
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    94
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
    95
$(GENSRC_X11WRAPPERS_DST)/_the.generated.x11 : $(foreach S,$(GENSRC_SIZES),$(GENSRC_X11WRAPPERS_TMP)/sizer/$(S))
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    96
	$(RM) $@
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    97
	$(MKDIR) -p $(@D)/sun/awt/X11
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
    98
	$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
13702
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
    99
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-x86_64)
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
   100
  # On solaris-x86_64, as a safety measure, compare the generated file with the checked-in version 
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
   101
	$(ECHO) COMPARING $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 and $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386
efd6a05935b2 7197849: Update new build-infra makefiles
ohair
parents: 13164
diff changeset
   102
	$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-solaris-i386
12892
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   103
endif
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   104
	$(TOUCH) $@
3ef14bab6254 7170079: Adjustments to build-infra makefiles
erikj
parents:
diff changeset
   105
14231
a0c23c1c010f 8000992: Update new build-infra makefiles
ohair
parents: 13702
diff changeset
   106
GENSRC_X11WRAPPERS += $(GENSRC_X11WRAPPERS_DST)/_the.generated.x11