jdk/make/tools/freetypecheck/Makefile
author ohair
Tue, 04 Mar 2008 09:50:30 -0800
changeset 28 a2b62af4c8c5
parent 2 90ce3da70b43
child 305 9b905a071b0e
permissions -rw-r--r--
6638571: Fix freetype sanity check to work on solaris 64bit Summary: Missing -xarch options to build for 64bit Reviewed-by: xdono
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
# Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
# by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
# CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
# have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
# Builds test program for freetype sanity check.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Makefile should be called with following input parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#   FT_TEST    - full name of test program
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#   FT_HEADERS - path to freetype headers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#   FT_LIB     - location of directory with library
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
#   XARCH      - xarch option if required
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
BUILDDIR = ../..
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
include $(BUILDDIR)/common/Defs.gmk
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#test program is expected in the TEMPDIR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
FT_TEST_PATH = $(TEMPDIR)/$(FT_TEST)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
all: $(FT_TEST_PATH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
28
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    41
# Start with CFLAGS (which gets us the required -xarch setting on solaris)
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    42
ifeq ($(PLATFORM), windows)
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    43
  FT_OPTIONS  =
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    44
else
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    45
  FT_OPTIONS  = $(CFLAGS)
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    46
endif
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    47
a2b62af4c8c5 6638571: Fix freetype sanity check to work on solaris 64bit
ohair
parents: 2
diff changeset
    48
FT_OPTIONS += -I$(FT_HEADERS) -I$(FT_HEADERS)/freetype2
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
FT_OPTIONS += $(XARCH)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
#add runtime library search path
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
  FREETYPE_LIB=$(FT_LIB)/freetype.lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  FREETYPE_DLL=$(FT_LIB)/freetype.dll
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
  DFLAG=/D
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
  FT_OPTIONS += -L$(FT_LIB)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
  DFLAG = -D
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
  #add runtime lib search path to ensure test will be runnable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
  ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    FT_OPTIONS += -R $(FT_LIB) -lfreetype
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
  else #linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
      FT_OPTIONS += -Wl,-rpath -Wl,$(FT_LIB) -lfreetype
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
FT_OPTIONS += $(DFLAG)REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
# On windows we need to copy dll to test dir
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
#  ti ensure it will be found in runtime
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
$(FT_TEST_PATH): freetypecheck.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
	@$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FREETYPE_LIB) $(LFLAGS_$(COMPILER_VERSION))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
ifeq ($(PLATFORM), windows)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
	@$(CP) $(FREETYPE_DLL) `dirname $@`
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
endif