jdk/test/tools/launcher/Makefile.SolarisRunpath
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load

# Copyright 2007 Sun Microsystems, Inc.  All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.

#

# This is a not quite automated Makefile to generate the Solaris
# binaries used for the SolarisRunpath.sh test.  First,
# libraryCaller.java program must be compiled.  Next, javah is called
# on the class file to generate the needed header file for the jni
# code.  Then, 2 Solaris executables are generated in separate
# directories, a default one meant to be pointed to by LD_LIBRARY_PATH
# (this function returns 0) and another one for the data model
# specific LD_LIBRARY_PATH (this function returns the size of integers
# in the data model, 32 or 64).  A better makefile would run, say
# isainfo -v, and generated binaries for all supported data models.
# To do this a mapping would be needed from data models to
# architecture dependent compiler options; e.g. 64 bit on sparc =>
# -xarch=v9.  Also, the settings for JINCLUDE, JAVAC, and JAVAH should
# come from the current build.  The C compiler should be the one
# approved for the build.  To be extra safe, the binaries should be
# generated on the oldest Solaris release supported by the current
# Java build.

# Include directory in JRE or JDK install; e.g.
JINCLUDE=/java/re/jdk/1.4.1/latest/binaries/solaris-sparc/include

# Path to javac executable; e.g.
JAVAC=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javac

# Path to javah executable; e.g.
JAVAH=/java/re/jdk/1.4.1/promoted/fcs/b21/binaries/solaris-sparc/bin/javah

# Path to C compiler; e.g.
CC=/java/devtools/sparc/SUNWspro/SC6.1/bin/cc


ARCH=`uname -p`

# 32-bit Solaris Options
DM=32
# Default architecture is fine for both sparc and x86 32-bit builds
OPTIONS=

# 64-bit Solaris Options
#DM=64
#OPTIONS=-xarch=v9


all: libraryCaller.java libraryCaller.c
	$(JAVAC) libraryCaller.java;					\
	$(JAVAH) libraryCaller;						\
	$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=0 	\
		$(OPTIONS) libraryCaller.c 				\
		-o lib/$(ARCH)/lib$(DM)/liblibrary.so;			\
	$(CC) -G -I$(JINCLUDE) -I$(JINCLUDE)/solaris -DRETURN_VALUE=$(DM)\
		$(OPTIONS) libraryCaller.c 				\
		-o lib/$(ARCH)/lib$(DM)/lib$(DM)/liblibrary.so;