author | ohair |
Tue, 04 Mar 2008 09:50:30 -0800 | |
changeset 28 | a2b62af4c8c5 |
parent 2 | 90ce3da70b43 |
child 305 | 9b905a071b0e |
permissions | -rw-r--r-- |
2 | 1 |
# |
2 |
# Copyright 2007 Sun Microsystems, Inc. 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. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
||
25 |
# Builds test program for freetype sanity check. |
|
26 |
# |
|
27 |
# Makefile should be called with following input parameters |
|
28 |
# FT_TEST - full name of test program |
|
29 |
# FT_HEADERS - path to freetype headers |
|
30 |
# FT_LIB - location of directory with library |
|
31 |
# XARCH - xarch option if required |
|
32 |
||
33 |
BUILDDIR = ../.. |
|
34 |
include $(BUILDDIR)/common/Defs.gmk |
|
35 |
||
36 |
#test program is expected in the TEMPDIR |
|
37 |
FT_TEST_PATH = $(TEMPDIR)/$(FT_TEST) |
|
38 |
||
39 |
all: $(FT_TEST_PATH) |
|
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 | 49 |
FT_OPTIONS += $(XARCH) |
50 |
||
51 |
#add runtime library search path |
|
52 |
ifeq ($(PLATFORM), windows) |
|
53 |
FREETYPE_LIB=$(FT_LIB)/freetype.lib |
|
54 |
FREETYPE_DLL=$(FT_LIB)/freetype.dll |
|
55 |
DFLAG=/D |
|
56 |
else |
|
57 |
FT_OPTIONS += -L$(FT_LIB) |
|
58 |
DFLAG = -D |
|
59 |
||
60 |
#add runtime lib search path to ensure test will be runnable |
|
61 |
ifeq ($(PLATFORM), solaris) |
|
62 |
FT_OPTIONS += -R $(FT_LIB) -lfreetype |
|
63 |
else #linux |
|
64 |
FT_OPTIONS += -Wl,-rpath -Wl,$(FT_LIB) -lfreetype |
|
65 |
endif |
|
66 |
endif |
|
67 |
||
68 |
FT_OPTIONS += $(DFLAG)REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION) |
|
69 |
||
70 |
# On windows we need to copy dll to test dir |
|
71 |
# ti ensure it will be found in runtime |
|
72 |
$(FT_TEST_PATH): freetypecheck.c |
|
73 |
@$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FREETYPE_LIB) $(LFLAGS_$(COMPILER_VERSION)) |
|
74 |
ifeq ($(PLATFORM), windows) |
|
75 |
@$(CP) $(FREETYPE_DLL) `dirname $@` |
|
76 |
endif |