blob: dc09cab4269571b69b644032397462d770b7ba24 [file] [log] [blame]
sewardj01262142006-01-04 01:20:28 +00001
sewardj944fbf22007-11-16 10:05:47 +00002# Baseline flags for all compilations. Aim here is to maximise
3# performance and get whatever useful warnings we can out of gcc.
sewardj8cd42de2007-11-16 12:31:27 +00004AM_CFLAGS_BASE = -O2 -g -Wmissing-prototypes -Wall -Wshadow \
sewardjb5f29642007-11-16 12:02:43 +00005 -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \
bart9d865fa2008-06-23 12:11:49 +00006 @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \
sewardjb5f29642007-11-16 12:02:43 +00007 -fno-strict-aliasing
tomfb7bcde2005-11-07 15:24:38 +00008
sewardj944fbf22007-11-16 10:05:47 +00009# These flags are used for building the preload shared objects.
10# The aim is to give reasonable performance but also to have good
11# stack traces, since users often see stack traces extending
12# into (and through) the preloads.
sewardjb5f29642007-11-16 12:02:43 +000013AM_CFLAGS_PIC = -O -g -fpic -fno-omit-frame-pointer -fno-strict-aliasing
tomfb7bcde2005-11-07 15:24:38 +000014
njnf6ded8c2009-02-06 04:49:14 +000015# Flags for specific targets.
njn058f6352009-04-15 23:58:26 +000016#
njnf6ded8c2009-02-06 04:49:14 +000017# Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs.
18# For building the core, coregrind/Makefile.am files add some extra things.
njn058f6352009-04-15 23:58:26 +000019#
20# Also: in newer versions of automake (1.10 onwards?) asm files ending with
21# '.S' are considered "pre-processed" (as opposed to those ending in '.s')
22# and so the CPPFLAGS are passed to the assembler. But this is not true for
23# older automakes (e.g. 1.8.5, 1.9.6), sigh. So we include
24# AM_CPPFLAGS_<PLATFORM> in each AM_CCASFLAGS_<PLATFORM> variable. This
25# means some of the flags are duplicated on systems with newer versions of
26# automake, but this does not really matter and seems hard to avoid.
27
njnf6ded8c2009-02-06 04:49:14 +000028AM_CPPFLAGS_COMMON = \
njn058f6352009-04-15 23:58:26 +000029 -I$(top_srcdir) \
njnf6ded8c2009-02-06 04:49:14 +000030 -I$(top_srcdir)/include \
31 -I@VEX_DIR@/pub
32
sewardj01262142006-01-04 01:20:28 +000033AM_FLAG_M3264_X86_LINUX = @FLAG_M32@
njnf6ded8c2009-02-06 04:49:14 +000034AM_CPPFLAGS_X86_LINUX = $(AM_CPPFLAGS_COMMON) \
35 -DVGA_x86=1 \
36 -DVGO_linux=1 \
37 -DVGP_x86_linux=1
njn8d1181d2009-02-25 23:19:46 +000038AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \
sewardj01262142006-01-04 01:20:28 +000039 $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000040AM_CCASFLAGS_X86_LINUX = $(AM_CPPFLAGS_X86_LINUX) @FLAG_M32@ -g
tomfb7bcde2005-11-07 15:24:38 +000041
sewardj01262142006-01-04 01:20:28 +000042AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@
njnf6ded8c2009-02-06 04:49:14 +000043AM_CPPFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_COMMON) \
44 -DVGA_amd64=1 \
45 -DVGO_linux=1 \
46 -DVGP_amd64_linux=1
njn8d1181d2009-02-25 23:19:46 +000047AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ -fomit-frame-pointer \
sewardj1eff82b2006-10-17 00:56:43 +000048 @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000049AM_CCASFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_AMD64_LINUX) @FLAG_M64@ -g
tomfb7bcde2005-11-07 15:24:38 +000050
sewardj01262142006-01-04 01:20:28 +000051AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@
njnf6ded8c2009-02-06 04:49:14 +000052AM_CPPFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_COMMON) \
53 -DVGA_ppc32=1 \
54 -DVGO_linux=1 \
55 -DVGP_ppc32_linux=1
njn8d1181d2009-02-25 23:19:46 +000056AM_CFLAGS_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000057AM_CCASFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_PPC32_LINUX) @FLAG_M32@ -g
sewardj2c48c7b2005-11-29 13:05:56 +000058
sewardj01262142006-01-04 01:20:28 +000059AM_FLAG_M3264_PPC64_LINUX = @FLAG_M64@
njnf6ded8c2009-02-06 04:49:14 +000060AM_CPPFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_COMMON) \
61 -DVGA_ppc64=1 \
62 -DVGO_linux=1 \
63 -DVGP_ppc64_linux=1
njn8d1181d2009-02-25 23:19:46 +000064AM_CFLAGS_PPC64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000065AM_CCASFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_PPC64_LINUX) @FLAG_M64@ -g
sewardj1eff82b2006-10-17 00:56:43 +000066
67AM_FLAG_M3264_PPC32_AIX5 = @FLAG_MAIX32@
njnf6ded8c2009-02-06 04:49:14 +000068AM_CPPFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_COMMON) \
69 -DVGA_ppc32=1 \
70 -DVGO_aix5=1 \
71 -DVGP_ppc32_aix5=1
njn8d1181d2009-02-25 23:19:46 +000072AM_CFLAGS_PPC32_AIX5 = @FLAG_MAIX32@ -mcpu=powerpc $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000073AM_CCASFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_PPC32_AIX5) \
74 @FLAG_MAIX32@ -mcpu=powerpc -g
sewardj1eff82b2006-10-17 00:56:43 +000075
76AM_FLAG_M3264_PPC64_AIX5 = @FLAG_MAIX64@
njnf6ded8c2009-02-06 04:49:14 +000077AM_CPPFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_COMMON) \
78 -DVGA_ppc64=1 \
79 -DVGO_aix5=1 \
80 -DVGP_ppc64_aix5=1
njn8d1181d2009-02-25 23:19:46 +000081AM_CFLAGS_PPC64_AIX5 = @FLAG_MAIX64@ -mcpu=powerpc64 $(AM_CFLAGS_BASE)
njn058f6352009-04-15 23:58:26 +000082AM_CCASFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_PPC64_AIX5) \
83 @FLAG_MAIX64@ -mcpu=powerpc64 -g
tomfb7bcde2005-11-07 15:24:38 +000084
sewardj01262142006-01-04 01:20:28 +000085# Flags for the primary target. These must be used to build the
86# regtests and performance tests. In fact, these must be used to
87# build anything which is built only once on a dual-arch build.
88#
njn7fd6d382009-01-22 21:56:32 +000089AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@)
90AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
91AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
92AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@)
sewardj1eff82b2006-10-17 00:56:43 +000093
njn7fd6d382009-01-22 21:56:32 +000094if VGCONF_HAVE_PLATFORM_SEC_CAPS
95 AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@)
sewardj1eff82b2006-10-17 00:56:43 +000096else
97 AM_FLAG_M3264_SEC =
98endif
99
100
101# Baseline link flags for making dynamic shared objects.
102#
bart44ceea22008-04-16 18:19:45 +0000103PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst
104PRELOAD_LDFLAGS_COMMON_AIX5 = -nodefaultlibs -shared -Wl,-G -Wl,-bnogc
sewardj1eff82b2006-10-17 00:56:43 +0000105PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
106PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
107PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
108PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
109PRELOAD_LDFLAGS_PPC32_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@
110PRELOAD_LDFLAGS_PPC64_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@