michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ifdef NS_USE_JDK michael@0: ####################################################################### michael@0: # [1] Define preliminary JDK "Core Components" toolset options # michael@0: ####################################################################### michael@0: michael@0: # set default JDK java threading model michael@0: ifeq ($(JDK_THREADING_MODEL),) michael@0: JDK_THREADING_MODEL = native_threads michael@0: # no such thing as -native flag michael@0: JDK_THREADING_MODEL_OPT = michael@0: endif michael@0: michael@0: ####################################################################### michael@0: # [2] Define platform-independent JDK "Core Components" options # michael@0: ####################################################################### michael@0: michael@0: # set default location of the java classes repository michael@0: ifeq ($(JAVA_DESTPATH),) michael@0: ifdef BUILD_OPT michael@0: JAVA_DESTPATH = $(SOURCE_CLASSES_DIR) michael@0: else michael@0: JAVA_DESTPATH = $(SOURCE_CLASSES_DBG_DIR) michael@0: endif michael@0: endif michael@0: michael@0: # set default location of the package under the java classes repository michael@0: # note that this overrides the default package value in ruleset.mk michael@0: ifeq ($(PACKAGE),) michael@0: PACKAGE = . michael@0: endif michael@0: michael@0: # set default location of the java source code repository michael@0: ifeq ($(JAVA_SOURCEPATH),) michael@0: JAVA_SOURCEPATH = . michael@0: endif michael@0: michael@0: # add JNI directory to default include search path michael@0: ifneq ($(JNI_GEN),) michael@0: ifdef NSBUILDROOT michael@0: INCLUDES += -I$(JNI_GEN_DIR) -I$(SOURCE_XP_DIR) michael@0: else michael@0: INCLUDES += -I$(JNI_GEN_DIR) michael@0: endif michael@0: endif michael@0: michael@0: ####################################################################### michael@0: # [3] Define platform-dependent JDK "Core Components" options # michael@0: ####################################################################### michael@0: michael@0: # set [Microsoft Windows] platforms michael@0: ifeq ($(OS_ARCH), WINNT) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = ; michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = win32 michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # currently, disable JIT option on this platform michael@0: JDK_JIT_OPT = -nojit michael@0: endif michael@0: michael@0: # set [Sun Solaris] platforms michael@0: ifeq ($(OS_ARCH), SunOS) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = solaris michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # currently, disable JIT option on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [Hewlett Packard HP-UX] platforms michael@0: ifeq ($(OS_ARCH), HP-UX) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = hp-ux michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [Redhat Linux] platforms michael@0: ifeq ($(OS_ARCH), Linux) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = linux michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [Mac OS X] platforms michael@0: ifeq ($(OS_ARCH), Darwin) michael@0: JAVA_CLASSES = $(JAVA_HOME)/../Classes/classes.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/../Classes/classes.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = darwin michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [IBM AIX] platforms michael@0: ifeq ($(OS_ARCH), AIX) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = aix michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [Digital UNIX] platforms michael@0: ifeq ($(OS_ARCH), OSF1) michael@0: JAVA_CLASSES = $(JAVA_HOME)/jre/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = alpha michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: # set [Silicon Graphics IRIX] platforms michael@0: ifeq ($(OS_ARCH), IRIX) michael@0: JAVA_CLASSES = $(JAVA_HOME)/lib/dev.jar:$(JAVA_HOME)/lib/rt.jar michael@0: michael@0: ifeq ($(JRE_HOME),) michael@0: JRE_HOME = $(JAVA_HOME) michael@0: JRE_CLASSES = $(JAVA_CLASSES) michael@0: else michael@0: ifeq ($(JRE_CLASSES),) michael@0: JRE_CLASSES = $(JRE_HOME)/lib/dev.jar:$(JRE_HOME)/lib/rt.jar michael@0: endif michael@0: endif michael@0: michael@0: PATH_SEPARATOR = : michael@0: michael@0: # (2) specify "header" information michael@0: JAVA_ARCH = irix michael@0: michael@0: INCLUDES += -I$(JAVA_HOME)/include michael@0: INCLUDES += -I$(JAVA_HOME)/include/$(JAVA_ARCH) michael@0: michael@0: # no JIT option available on this platform michael@0: JDK_JIT_OPT = michael@0: endif michael@0: michael@0: ####################################################################### michael@0: # [4] Define remaining JDK "Core Components" default toolset options # michael@0: ####################################################################### michael@0: michael@0: # set JDK optimization model michael@0: ifeq ($(BUILD_OPT),1) michael@0: JDK_OPTIMIZER_OPT = -O michael@0: else michael@0: JDK_OPTIMIZER_OPT = -g michael@0: endif michael@0: michael@0: # set minimal JDK debugging model michael@0: ifeq ($(JDK_DEBUG),1) michael@0: JDK_DEBUG_OPT = -debug michael@0: else michael@0: JDK_DEBUG_OPT = michael@0: endif michael@0: michael@0: # set default path to repository for JDK classes michael@0: ifeq ($(JDK_CLASS_REPOSITORY_OPT),) michael@0: JDK_CLASS_REPOSITORY_OPT = -d $(JAVA_DESTPATH) michael@0: endif michael@0: michael@0: # define a default JDK classpath michael@0: ifeq ($(JDK_CLASSPATH),) michael@0: JDK_CLASSPATH = '$(JAVA_DESTPATH)$(PATH_SEPARATOR)$(JAVA_SOURCEPATH)$(PATH_SEPARATOR)$(JAVA_CLASSES)' michael@0: endif michael@0: michael@0: # by default, override CLASSPATH environment variable using the JDK classpath option with $(JDK_CLASSPATH) michael@0: ifeq ($(JDK_CLASSPATH_OPT),) michael@0: JDK_CLASSPATH_OPT = -classpath $(JDK_CLASSPATH) michael@0: endif michael@0: michael@0: ifeq ($(USE_64), 1) michael@0: JDK_USE_64 = -d64 michael@0: endif michael@0: michael@0: endif michael@0: michael@0: michael@0: ####################################################################### michael@0: # [5] Define JDK "Core Components" toolset; # michael@0: # (always allow a user to override these values) # michael@0: ####################################################################### michael@0: michael@0: # michael@0: # (1) appletviewer michael@0: # michael@0: michael@0: ifeq ($(APPLETVIEWER),) michael@0: APPLETVIEWER_PROG = $(JAVA_HOME)/bin/appletviewer$(PROG_SUFFIX) michael@0: APPLETVIEWER_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: APPLETVIEWER_FLAGS += $(JDK_DEBUG_OPT) michael@0: APPLETVIEWER_FLAGS += $(JDK_JIT_OPT) michael@0: APPLETVIEWER = $(APPLETVIEWER_PROG) $(APPLETVIEWER_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (2) jar michael@0: # michael@0: michael@0: ifeq ($(JAR),) michael@0: JAR_PROG = $(JAVA_HOME)/bin/jar$(PROG_SUFFIX) michael@0: JAR_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAR = $(JAR_PROG) $(JAR_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (3) java michael@0: # michael@0: michael@0: ifeq ($(JAVA),) michael@0: JAVA_PROG = $(JAVA_HOME)/bin/java$(PROG_SUFFIX) michael@0: JAVA_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVA_FLAGS += $(JDK_DEBUG_OPT) michael@0: JAVA_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JAVA_FLAGS += $(JDK_JIT_OPT) michael@0: JAVA_FLAGS += $(JDK_USE_64) michael@0: JAVA = $(JAVA_PROG) $(JAVA_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (4) javac michael@0: # michael@0: michael@0: ifeq ($(JAVAC),) michael@0: JAVAC_PROG = $(JAVA_HOME)/bin/javac$(PROG_SUFFIX) michael@0: JAVAC_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAC_FLAGS += $(JDK_OPTIMIZER_OPT) michael@0: JAVAC_FLAGS += $(JDK_DEBUG_OPT) michael@0: JAVAC_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JAVAC_FLAGS += $(JDK_CLASS_REPOSITORY_OPT) michael@0: JAVAC_FLAGS += $(JDK_USE_64) michael@0: JAVAC = $(JAVAC_PROG) $(JAVAC_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (5) javadoc michael@0: # michael@0: michael@0: ifeq ($(JAVADOC),) michael@0: JAVADOC_PROG = $(JAVA_HOME)/bin/javadoc$(PROG_SUFFIX) michael@0: JAVADOC_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVADOC_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JAVADOC = $(JAVADOC_PROG) $(JAVADOC_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (6) javah michael@0: # michael@0: michael@0: ifeq ($(JAVAH),) michael@0: JAVAH_PROG = $(JAVA_HOME)/bin/javah$(PROG_SUFFIX) michael@0: JAVAH_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAH_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JAVAH = $(JAVAH_PROG) $(JAVAH_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (7) javakey michael@0: # michael@0: michael@0: ifeq ($(JAVAKEY),) michael@0: JAVAKEY_PROG = $(JAVA_HOME)/bin/javakey$(PROG_SUFFIX) michael@0: JAVAKEY_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAKEY = $(JAVAKEY_PROG) $(JAVAKEY_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (8) javap michael@0: # michael@0: michael@0: ifeq ($(JAVAP),) michael@0: JAVAP_PROG = $(JAVA_HOME)/bin/javap$(PROG_SUFFIX) michael@0: JAVAP_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAP_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JAVAP = $(JAVAP_PROG) $(JAVAP_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (9) javat michael@0: # michael@0: michael@0: ifeq ($(JAVAT),) michael@0: JAVAT_PROG = $(JAVA_HOME)/bin/javat$(PROG_SUFFIX) michael@0: JAVAT_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAT = $(JAVAT_PROG) $(JAVAT_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (10) javaverify michael@0: # michael@0: michael@0: ifeq ($(JAVAVERIFY),) michael@0: JAVAVERIFY_PROG = $(JAVA_HOME)/bin/javaverify$(PROG_SUFFIX) michael@0: JAVAVERIFY_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JAVAVERIFY = $(JAVAVERIFY_PROG) $(JAVAVERIFY_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (11) javaw michael@0: # michael@0: michael@0: ifeq ($(JAVAW),) michael@0: jJAVAW_PROG = $(JAVA_HOME)/bin/javaw$(PROG_SUFFIX) michael@0: jJAVAW_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: jJAVAW_FLAGS += $(JDK_DEBUG_OPT) michael@0: jJAVAW_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: jJAVAW_FLAGS += $(JDK_JIT_OPT) michael@0: jJAVAW = $(JAVAW_PROG) $(JAVAW_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (12) jdb michael@0: # michael@0: michael@0: ifeq ($(JDB),) michael@0: JDB_PROG = $(JAVA_HOME)/bin/jdb$(PROG_SUFFIX) michael@0: JDB_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JDB_FLAGS += $(JDK_DEBUG_OPT) michael@0: JDB_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JDB_FLAGS += $(JDK_JIT_OPT) michael@0: JDB = $(JDB_PROG) $(JDB_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (13) jre michael@0: # michael@0: michael@0: ifeq ($(JRE),) michael@0: JRE_PROG = $(JAVA_HOME)/bin/jre$(PROG_SUFFIX) michael@0: JRE_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JRE_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JRE_FLAGS += $(JDK_JIT_OPT) michael@0: JRE = $(JRE_PROG) $(JRE_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (14) jrew michael@0: # michael@0: michael@0: ifeq ($(JREW),) michael@0: JREW_PROG = $(JAVA_HOME)/bin/jrew$(PROG_SUFFIX) michael@0: JREW_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: JREW_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: JREW_FLAGS += $(JDK_JIT_OPT) michael@0: JREW = $(JREW_PROG) $(JREW_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (15) native2ascii michael@0: # michael@0: michael@0: ifeq ($(NATIVE2ASCII),) michael@0: NATIVE2ASCII_PROG = $(JAVA_HOME)/bin/native2ascii$(PROG_SUFFIX) michael@0: NATIVE2ASCII_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: NATIVE2ASCII = $(NATIVE2ASCII_PROG) $(NATIVE2ASCII_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (16) rmic michael@0: # michael@0: michael@0: ifeq ($(RMIC),) michael@0: RMIC_PROG = $(JAVA_HOME)/bin/rmic$(PROG_SUFFIX) michael@0: RMIC_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: RMIC_FLAGS += $(JDK_OPTIMIZER_OPT) michael@0: RMIC_FLAGS += $(JDK_CLASSPATH_OPT) michael@0: RMIC = $(RMIC_PROG) $(RMIC_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (17) rmiregistry michael@0: # michael@0: michael@0: ifeq ($(RMIREGISTRY),) michael@0: RMIREGISTRY_PROG = $(JAVA_HOME)/bin/rmiregistry$(PROG_SUFFIX) michael@0: RMIREGISTRY_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: RMIREGISTRY = $(RMIREGISTRY_PROG) $(RMIREGISTRY_FLAGS) michael@0: endif michael@0: michael@0: # michael@0: # (18) serialver michael@0: # michael@0: michael@0: ifeq ($(SERIALVER),) michael@0: SERIALVER_PROG = $(JAVA_HOME)/bin/serialver$(PROG_SUFFIX) michael@0: SERIALVER_FLAGS = $(JDK_THREADING_MODEL_OPT) michael@0: SERIALVER = $(SERIALVER_PROG) $(SERIALVER_FLAGS) michael@0: endif