view make/common/Defs-aix.gmk @ 1347:41b5258db381

8024900: PPC64: Enable new build on AIX (jdk part) Reviewed-by: alanb, prr, sla, chegar, michaelm, mullan, art Contributed-by: spoole@linux.vnet.ibm.com
author simonis
date Tue, 10 Jul 2012 11:11:25 +0100
parents
children
line wrap: on
line source

#
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

#
# Makefile to specify compiler flags for programs and libraries
# targeted to Solaris.  Should not contain any rules.
#
# WARNING: This file is shared with other workspaces. 
#          So when it includes other files, it must use JDK_TOPDIR.
#

# Warning: the following variables are overridden by Defs.gmk. Set
# values will be silently ignored:
#   CFLAGS        (set $(OTHER_CFLAGS) instead)
#   CPPFLAGS      (set $(OTHER_CPPFLAGS) instead)
#   CXXFLAGS      (set $(OTHER_CXXFLAGS) instead)
#   LDFLAGS       (set $(OTHER_LDFAGS) instead)
#   LDLIBS        (set $(EXTRA_LIBS) instead)
#   LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
#   LINTFLAGS     (set $(OTHER_LINTFLAGS) instead)
#
# Note: CPPFLAGS are used in C and C++ compiles.
#

# Get shared JDK settings
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk

# define these to avoid picking up ones from aliases or from
# non-standard locations
#

AR             = $(USRBIN_PATH)ar
BASENAME       = $(UNIXCOMMAND_PATH)basename
CAT            = $(UNIXCOMMAND_PATH)cat
# SAPJVM: Moved to shared/Compiler-aix.gmk
#CC             = $(COMPILER_PATH)xlc_r
#CPP            = $(COMPILER_PATH)xlc_r -E
#CXX            = $(COMPILER_PATH)xlC_r
CD             = cd # intrinsic unix command
CHMOD          = $(UNIXCOMMAND_PATH)chmod
CMP            = $(USRBIN_PATH)cmp
COMPRESS       = $(USRBIN_PATH)compress
CP             = $(UNIXCOMMAND_PATH)cp
CPIO           = $(UNIXCOMMAND_PATH)cpio
CUT            = $(USRBIN_PATH)cut
DATE           = $(UNIXCOMMAND_PATH)date
DF             = $(UNIXCOMMAND_PATH)df
DIFF           = $(USRBIN_PATH)diff
DIRNAME        = $(USRBIN_PATH)dirname
ECHO           = echo # intrinsic unix command, with backslash-escaped character interpretation 
EGREP          = $(UNIXCOMMAND_PATH)egrep
EXPR           = $(USRBIN_PATH)expr

FIND           = $(UNIXCOMMAND_PATH)find

HEAD           = $(USRBIN_PATH)head
GREP           = $(UNIXCOMMAND_PATH)grep
GUNZIP         = $(UNIXCOMMAND_PATH)gunzip
LEX            = $(USRBIN_PATH)lex
LN             = $(UNIXCOMMAND_PATH)ln
LS             = $(UNIXCOMMAND_PATH)ls
M4             = $(USRBIN_PATH)m4
MKDIR          = $(UNIXCOMMAND_PATH)mkdir
MV             = $(UNIXCOMMAND_PATH)mv
NAWK           = $(USRBIN_PATH)awk
PWD            = $(UNIXCOMMAND_PATH)pwd
#RM   is defined by GNU Make as 'rm -f'
RMDIR          = $(UNIXCOMMAND_PATH)rmdir
RPM            = $(UNIXCOMMAND_PATH)rpm
SED            = $(UNIXCOMMAND_PATH)sed
SH             = $(UNIXCOMMAND_PATH)sh
SORT           = $(UNIXCOMMAND_PATH)sort
STRIP          = $(USRBIN_PATH)strip
TAIL 	       = $(USRBIN_PATH)tail

# SAPJVM: catch (gnu) tool by PATH environment variable
TAR            = /usr/local/bin/tar

TEST	       = $(USRBIN_PATH)test
TOUCH          = $(UNIXCOMMAND_PATH)touch
TR             = $(USRBIN_PATH)tr
TRUE           = $(UNIXCOMMAND_PATH)true
UNAME          = $(UNIXCOMMAND_PATH)uname
UNIQ           = $(USRBIN_PATH)uniq
UNZIPSFX       = $(USRBIN_PATH)unzipsfx
YACC           = $(USRBIN_PATH)yacc

# SAPJVM: catch (gnu) tool by PATH environment variable
ZIPEXE         = $(UNIXCOMMAND_PATH)zip

OS_VERSION  = $(shell $(UNAME) -v)
OS_NAME	    = aix

ARCH_DATA_MODEL=64

LIBARCH = ppc64

# Value of Java os.arch property
ARCHPROP = $(LIBARCH)

BINDIR      = $(OUTPUTDIR)/bin

# where is unwanted output to be delivered?
DEV_NULL = /dev/null
export DEV_NULL

CLASSPATH_SEPARATOR = :

ifndef PLATFORM_SRC
  PLATFORM_SRC = $(BUILDDIR)/../src/solaris
endif # PLATFORM_SRC

# Location of the various .properties files specific to Linux platform
ifndef PLATFORM_PROPERTIES
  PLATFORM_PROPERTIES  = $(BUILDDIR)/../src/solaris/lib
endif # PLATFORM_SRC

# Platform specific closed sources
ifndef OPENJDK
  ifndef CLOSED_PLATFORM_SRC
    CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
  endif
endif

# SAPJVM: Set the source for the platform dependent sources of express
SAPJVMEXPRESS_PLATFORM_SRC=$(JDK_TOPDIR)/../../common/j2se/src/solaris

# platform specific include files
PLATFORM_INCLUDE_NAME = $(PLATFORM)
PLATFORM_INCLUDE      = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)

# SAPJVM: OBJECT_SUFFIX, LIBRARY_SUFFIX, EXE_SUFFICS etc. are set in
# j2se/make/common/shared/Platform.gmk . Just override those which differ for AIX.
# suffix used for make dependencies files.
# SAPJVM AIX: -qmakedep outputs .u, not .d 
override DEPEND_SUFFIX = u
# suffix used for lint files
LINT_SUFFIX = ln
# The suffix applied to the library name for FDLIBM
FDDLIBM_SUFFIX = a
# The suffix applied to scripts (.bat for windows, nothing for unix)
SCRIPT_SUFFIX =
# CC compiler object code output directive flag value
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!

# On AIX we don't have any issues using javah and javah_g.
JAVAH_SUFFIX = $(SUFFIX)

#
# Default optimization
#

ifndef OPTIMIZATION_LEVEL
  ifeq ($(PRODUCT), java)
    OPTIMIZATION_LEVEL = HIGHER
  else
    OPTIMIZATION_LEVEL = LOWER
  endif
endif
ifndef FASTDEBUG_OPTIMIZATION_LEVEL
  FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
endif

CC_OPT/LOWER    = -O2
CC_OPT/HIGHER   = -O3

CC_OPT          = $(CC_OPT/$(OPTIMIZATION_LEVEL))

#
# Selection of warning messages
#
CFLAGS_SHARED_OPTION=-qmkshrobj
CXXFLAGS_SHARED_OPTION=-qmkshrobj

#
# If -Xa is in CFLAGS_COMMON it will end up ahead of $(POPT) for the
# optimized build, and that ordering of the flags completely freaks
# out cc.  Hence, -Xa is instead in each CFLAGS variant.
# The extra options to the C++ compiler prevent it from:
#   - adding runpath (dump -Lv) to *your* C++ compile install dir
#   - adding stubs to various things such as thr_getspecific (hence -nolib)
#   - creating Templates.DB in current directory (arch specific)
CFLAGS_COMMON   = -qchars=signed 
PIC_CODE_LARGE = -qpic=large
PIC_CODE_SMALL = -qpic=small
GLOBAL_KPIC = $(PIC_CODE_LARGE)
CFLAGS_COMMON   += $(GLOBAL_KPIC) $(GCC_WARNINGS)
# SAPJVM:
# save compiler options into object file
CFLAGS_COMMON += -qsaveopt 

# SAPJVM
# preserve absolute source file infos in debug infos
CFLAGS_COMMON += -qfullpath

# SAPJVM
# We want to be able to debug an opt build as well.
CFLAGS_OPT      = -g $(POPT)
CFLAGS_DBG      = -g

CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
# SAPJVM
# We want to be able to debug an opt build as well.
CXXFLAGS_OPT	= -g $(POPT)
CXXFLAGS_DBG	= -g

# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
ifeq ($(FASTDEBUG), true)
  CFLAGS_DBG    += -O2
  CXXFLAGS_DBG	+= -O2
endif

CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'

# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
ifneq ($(ARCH),alpha)
  CPP_ARCH_FLAGS += -D$(ARCH)
else
  CPP_ARCH_FLAGS += -D_$(ARCH)_
endif

# SAPJVM. turn `=' into `+='.
CPPFLAGS_COMMON += -D$(ARCH) -DARCH='"$(ARCH)"' -DAIX $(VERSION_DEFINES) \
		  -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT

# SAPJVM: AIX port: zip lib
CPPFLAGS_COMMON +=  -DSTDC

# turn on USE_PTHREADS
CPPFLAGS_COMMON += -DUSE_PTHREADS
CFLAGS_COMMON   += -DUSE_PTHREADS

CFLAGS_COMMON += -q64
CPPFLAGS_COMMON += -q64

# SAPJVM. define PPC64
CFLAGS_COMMON += -DPPC64
CPPFLAGS_COMMON += -DPPC64

# SAPJVM
LDFLAGS_COMMON += -b64

# SAPJVM: enable dynamic runtime linking & strip the absolute paths from the coff section
LDFLAGS_COMMON += -brtl -bnolibpath

# SAPJVM: Additional link parameters for AIX
LDFLAGS_COMMON += -liconv

CPPFLAGS_OPT    =
CPPFLAGS_DBG    += -DDEBUG

LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
LDFLAGS_OPT     =
LDFLAGS_DBG     =

# SAPJVM
# Export symbols
OTHER_LDFLAGS += -bexpall

#
# Post Processing of libraries/executables
#
ifeq ($(VARIANT), OPT)
  ifneq ($(NO_STRIP), true)
    ifneq ($(DEBUG_BINARIES), true)
      # Debug 'strip -g' leaves local function Elf symbols (better stack
      # traces)
      # SAPJVM
      # We want to be able to debug an opt build as well.
      # POST_STRIP_PROCESS = $(STRIP) -g
    endif
  endif
endif

# javac Boot Flags
JAVAC_BOOT_FLAGS = -J-Xmx128m 

#
# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
#
LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker

#
# Support for Quantify.
#
ifdef QUANTIFY
QUANTIFY_CMD = quantify
QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
endif

#
# Path and option to link against the VM, if you have to.  Note that
# there are libraries that link against only -ljava, but they do get
# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
# the library itself should not.
#
VM_NAME         = server
JVMLIB          = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm$(SUFFIX) 
JAVALIB         = -ljava$(SUFFIX) $(JVMLIB)

# Part of INCREMENTAL_BUILD mechanism.
#   Compiler emits things like:  path/file.o: file.h
#   We want something like: relative_path/file.o relative_path/file.d: file.h
CC_DEPEND	 = -qmakedep
#CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
CC_DEPEND_FILTER = $(SED) -e '/:[ 	]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u

# Runtime graphics library search paths...
OPENWIN_RUNTIME_LIB = 
AWT_RUNPATH = 

#
# We want to privatize JVM symbols on Solaris. This is so the user can
# write a function called FindClass and this should not override the 
# FindClass that is inside the JVM. At this point in time we are not
# concerned with other JNI libraries because we hope that there will
# not be as many clashes there.
#
PRIVATIZE_JVM_SYMBOLS = false

USE_PTHREADS = true
#override ALT_CODESET_KEY         = _NL_CTYPE_CODESET_NAME
override AWT_RUNPATH             =
override HAVE_ALTZONE            = false
override HAVE_FILIOH             = false
override HAVE_GETHRTIME          = false
override HAVE_GETHRVTIME         = false
override HAVE_SIGIGNORE          = true
override LEX_LIBRARY             = -lfl
ifeq ($(STATIC_CXX),true)
override LIBCXX                  = -Wl,-bstatic -lc_r -Wl,-bdynamic
else
override LIBCXX                  =
endif
override LIBPOSIX4               =
override LIBSOCKET               =
override LIBNSL                  =
override LIBTHREAD               =
override MOOT_PRIORITIES         = true
override OPENWIN_LIB             = $(OPENWIN_HOME)/lib
override SUN_CMM_SUBDIR          =
override THREADS_FLAG            = native
override USE_GNU_M4              = true
override USING_GNU_TAR           = true
override WRITE_LIBVERSION        = false

# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
# resulting resolved absolute name of the executable in the environment
# variable EXECNAME.  That executable name is then used that to locate the
# installation area.
override USE_EXECNAME            = true

# If your platform has DPS, it will have Type1 fonts too, in which case
# it is best to enable DPS support until such time as 2D's rasteriser
# can fully handle Type1 fonts in all cases. Default is "yes".
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
# DPS (Displayable PostScript) is available on Solaris machines
HAVE_DPS = no

#
# Japanese manpages
#
JA_SOURCE_ENCODING = eucJP
JA_TARGET_ENCODINGS = eucJP UTF-8 PCK

# Settings for the JDI - Serviceability Agent binding.
HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
OPTIMIZED_SALIB_NAME = $(LIB_PREFIX)saproc$(OPT_SUFFIX).$(LIBRARY_SUFFIX)
DEBUG_SALIB_NAME     = $(LIB_PREFIX)saproc$(DBG_SUFFIX).$(LIBRARY_SUFFIX)

INCLUDE_SA = false
export OBJECT_MODE=64