1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
# $Id: platform_aix_ibm.GNU 93986 2011-04-22 18:40:06Z shuston $
# This file is for use with AIX 5.x and up, using either of the IBM
# compilers (Visual Age C++ 6 or newer XL C++ compiler).
debug ?= 1
distrib ?= 0
optimize ?= 0
threads ?= 1
buildbits ?= 32
ifeq (,$(inline))
ifeq (1,$(debug))
inline = 0
else
inline = 1
endif
endif
# First, find out which compiler we're building with. The settings we
# use for compiling, as well as how to build shared libraries, depend on
# the compiler version. There's no easy way to ask lslpp which is installed.
# Instead, compile a file and see which compiler is set up for use. This
# trick was submitted by Craig Rodrigues <rodrigc@mediaone.net>, originally
# from the vacpp compiler newsgroup.
# It relies on the preprocessor defining __xlC__ to the proper version
# number of the compiler.
XLCVERSION := $(shell echo "__xlC__" > ./testxlCvers.cpp;xlC -E ./testxlCvers.cpp | tail -n 1;$(RM) testxlCvers.cpp)
#XLCVERSION := $(shell xlC -E ./testAIXCompilerVersion.cpp | tail -1')
#ACE_AIX_CLEAN := $(shell $(RM) ./testAIXCompilerVersion.cpp)
# In case anything here or in the config depends on OS version number,
# grab it here and pass it all to the compiler as well.
AIX_MAJOR_VERS := $(shell uname -v)
AIX_MINOR_VERS := $(shell uname -r)
AIX_VERS := $(AIX_MAJOR_VERS)0$(AIX_MINOR_VERS)
SOEXT = so
SOFLAGS += -G
LDFLAGS += -brtl
#SHR_FILTER=$(ACE_ROOT)/bin/aix_shr
ifeq ($(threads),1)
# Note - the _r form of the compiler command turns on -qthreads and the
# thread-required preprocessor defines, as well as -lpthreads for linking.
# If this is Visual Age C++ 5, DLD will get reset below.
CC = xlc_r
CXX = xlC_r
DLD = makeC++SharedLib_r
else
CC = xlc
CXX = xlC
DLD = makeC++SharedLib
endif
ARFLAGS = ruv
AR = ar
LD = $(SHR_FILTER) $(CXX)
RANLIB = ranlib
CPPFLAGS += -DACE_AIX_VERS=$(AIX_VERS)
# AIX 5.2 offers POSIX aio, but the Visual Age C++ compiler can't grok the
# aio.h header file. This is a known problem and will be addressed in
# May 2004 (per IBM). This is a workaround for it, supplied by IBM.
# When the compiler fix is released, this workaround (and the change
# to -qflag, below) can be removed. (Steve Huston)
ifeq (502,$(AIX_VERS))
CPPFLAGS += -U__C99_RESTRICT
endif
# -qinitauto seems like an interesting option, but some tests (specifically
# Process_Strategy_Test) hang with it turned on. This should be investigated
# at some point.
DCCFLAGS += -g -qcheck=nobounds:div:null
DCFLAGS += -g
ifeq ($(XLCVERSION),0x0600)
# This is just for the workaround for aio, above. Without it, the
# compiler warns that __C99_RESTRICT is reserved. When that workaround
# is gone, this ifeq can be removed also. -qflag=w:w is what we want
# in the end.
CCFLAGS += -qtemplateregistry=templateregistry.$(MAKEFILE)
ifeq (502,$(AIX_VERS))
CCFLAGS += -qflag=e:e
else
CCFLAGS += -qflag=w:w
endif
else
ifeq ($(XLCVERSION),0x0700)
CCFLAGS += -qflag=w:w
ifeq ($(templates),manual)
CCFLAGS += -qnotempinc -qnotemplateregistry
else
CCFLAGS += -qtemplateregistry=templateregistry.$(MAKEFILE)
endif
# According to documentation, default is -qeh, which is equivalent
# to -qeh=v5. Apparently 6.0 fixed some problems with nested
# try-catch blocks.
CCFLAGS += -qeh=v6
else
ifeq ($(XLCVERSION),0x0800)
CCFLAGS += -qflag=w:w
ifeq ($(templates),manual)
CCFLAGS += -qnotempinc -qnotemplateregistry
else
CCFLAGS += -qtemplateregistry=templateregistry.$(MAKEFILE)
endif
# According to documentation, default is -qeh, which is equivalent
# to -qeh=v5. Apparently 6.0 fixed some problems with nested
# try-catch blocks.
CCFLAGS += -qeh=v6
else
# Until there's a reason to change, use the V9 settings for V10.1 and 11.
ifeq ($(XLCVERSION),0x0a01)
XLCVERSION = 0x0900
endif
ifeq ($(XLCVERSION),0x0b01)
XLCVERSION = 0x0900
endif
ifeq ($(XLCVERSION),0x0900)
CCFLAGS += -qflag=w:w
ifeq ($(templates),manual)
CCFLAGS += -qnotempinc -qnotemplateregistry
else
CCFLAGS += -qtemplateregistry=templateregistry.$(MAKEFILE)
endif
# According to documentation, default is -qeh, which is equivalent
# to -qeh=v5. Apparently 6.0 fixed some problems with nested
# try-catch blocks.
CCFLAGS += -qeh=v6
else
CXX = echo "Unrecognized compiler version $(XLCVERSION)\n"
endif
endif
endif
endif
DLD = $(CXX) -qmkshrobj
SOFLAGS += $(CCFLAGS) $(CPPFLAGS) $(INCLDIRS)
ifeq ($(buildbits),64)
DLD += -q64
CFLAGS += -q64 -qwarn64
CCFLAGS += -q64 -qwarn64
ARFLAGS := -X64 $(ARFLAGS)
# This option results in a crash of TAO when building 64bit with
# Visual Age 6. No idea why but don't use it when using Visual Age 6.
ifneq ($(XLCVERSION),0x0600)
# CCFLAGS += -qstaticinline
endif
else
# Using 32bit the staticinline option works.
#CCFLAGS += -qstaticinline
endif
# The Visual Age preprocessor is not usable with the TAO_IDL compiler.
# At the moment an idl file just contains includes of other idl files
# the Visual Age preprocessor doesn't report that file in the list of
# files that is used. The only way we can workaround this is using the
# gcc preprocessor, do this in your platform_macros.GNU is this
# causes problems
# TAO_IDL_PREPROCESSOR = gcc
ifeq ($(exceptions),0)
CCFLAGS += -qnoeh
endif
CCFLAGS += -qrtti=all
ifeq ($(shared_libs),1)
ACELIB = -lACE
else
ACELIB = -lACEns
endif
LIBS += -lxti -ldl
SONAME =
SOVERSION =
# Default OCCFLAGS builds common code for all RS/6000 architectures but
# this can be set to optimize for your particular computer. The commented
# out example optimizes for RS/6000 43P.
# OCCFLAGS is not used by default. To used it, set optimize=1
# either in this file or on the command line.
#OCCFLAGS += -qarch=ppc -qtune=604
OCCFLAGS += -qlibansi -O2 -qarch=com
|