2
|
1 |
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
2 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
#
|
|
4 |
# This code is free software; you can redistribute it and/or modify it
|
|
5 |
# under the terms of the GNU General Public License version 2 only, as
|
|
6 |
# published by the Free Software Foundation.
|
|
7 |
#
|
|
8 |
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
9 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
11 |
# version 2 for more details (a copy is included in the LICENSE file that
|
|
12 |
# accompanied this code).
|
|
13 |
#
|
|
14 |
# You should have received a copy of the GNU General Public License version
|
|
15 |
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
16 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
17 |
#
|
|
18 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
19 |
# CA 95054 USA or visit www.sun.com if you need additional information or
|
|
20 |
# have any questions.
|
|
21 |
|
|
22 |
#
|
|
23 |
|
|
24 |
# This is a not quite automated Makefile to generate the Solaris
|
|
25 |
# binaries used for the SolarisRunpath.sh test. First,
|
|
26 |
# libraryCaller.java program must be compiled. Next, javah is called
|
|
27 |
# on the class file to generate the needed header file for the jni
|
|
28 |
# code. Then, 2 Solaris executables are generated in separate
|
|
29 |
# directories, a default one meant to be pointed to by LD_LIBRARY_PATH
|
|
30 |
# (this function returns 0) and another one for the data model
|
|
31 |
# specific LD_LIBRARY_PATH (this function returns the size of integers
|
|
32 |
# in the data model, 32 or 64). A better makefile would run, say
|
|
33 |
# isainfo -v, and generated binaries for all supported data models.
|
|
34 |
# To do this a mapping would be needed from data models to
|
|
35 |
# architecture dependent compiler options; e.g. 64 bit on sparc =>
|
|
36 |
# -xarch=v9. Also, the settings for JINCLUDE, JAVAC, and JAVAH should
|
|
37 |
# come from the current build. The C compiler should be the one
|
|
38 |
# approved for the build. To be extra safe, the binaries should be
|
|
39 |
# generated on the oldest Solaris release supported by the current
|
|
40 |
# Java build.
|
|
41 |
|
|
42 |
# Include directory in JRE or JDK install; e.g.
|
|
43 |
JINCLUDE=/java/re/jdk/1.4.1/latest/binaries/solaris-sparc/include
|
|
44 |
|
|
45 |
# Path to javac executable; e.g.
|
|
46 |
JAVAC=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javac
|
|
47 |
|
|
48 |
# Path to javah executable; e.g.
|
|
49 |
JAVAH=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javah
|
|
50 |
|
|
51 |
# Path to C compiler; e.g.
|
|
52 |
CC=/java/devtools/sparc/SUNWspro/SC6.1/bin/cc
|
|
53 |
|
|
54 |
|
|
55 |
ARCH=`uname -p`
|
|
56 |
|
|
57 |
# 32-bit Solaris Options
|
|
58 |
DM=32
|
|
59 |
# Default architecture is fine for both sparc and x86 32-bit builds
|
|
60 |
OPTIONS=
|
|
61 |
|
|
62 |
# 64-bit Solaris Options
|
|
63 |
#DM=64
|
|
64 |
#OPTIONS=-xarch=v9
|
|
65 |
|
|
66 |
|
|
67 |
all: libraryCaller.java libraryCaller.c
|
|
68 |
$(JAVAC) libraryCaller.java; \
|
|
69 |
$(JAVAH) libraryCaller; \
|
|
70 |
$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=0 \
|
|
71 |
$(OPTIONS) libraryCaller.c \
|
|
72 |
-o lib/$(ARCH)/lib$(DM)/liblibrary.so; \
|
|
73 |
$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=$(DM)\
|
|
74 |
$(OPTIONS) libraryCaller.c \
|
|
75 |
-o lib/$(ARCH)/lib$(DM)/lib$(DM)/liblibrary.so;
|