2 # Paradyn overall build configuration (unix)
4 # $Id: make.config,v 1.242 2008/09/20 03:56:08 jaw Exp $
10 Everything = dynutil common symtabAPI instructionAPI parseAPI proccontrol stackwalk dyninstAPI_RT dyninstAPI
11 SymtabAPI = dynutil common symtabAPI
12 StackwalkerAPI = dynutil common symtabAPI stackwalk
13 DyninstAPI = dynutil common symtabAPI instructionAPI parseAPI dyninstAPI_RT dyninstAPI
14 InstructionAPI = dynutil common instructionAPI
15 ProcControlAPI = dynutil common proccontrol
16 DepGraphAPI = depGraphAPI
17 ParseAPI = dynutil common symtabAPI instructionAPI parseAPI
18 ValueAdded = valueAdded/sharedMem
19 DataflowAPI = ParseAPI
21 DEFAULT_COMPONENT ?= default
22 ifeq ($(DEFAULT_COMPONENT),default)
23 fullSystem += $(Everything)
24 BUILD_PARSETHAT = true
26 ifeq ($(DEFAULT_COMPONENT),SymtabAPI)
27 fullSystem += $(SymtabAPI)
29 ifeq ($(DEFAULT_COMPONENT),StackwalkerAPI)
30 fullSystem += $(StackwalkerAPI)
32 ifeq ($(DEFAULT_COMPONENT),DyninstAPI)
33 fullSystem += $(DyninstAPI)
34 BUILD_PARSETHAT = true
36 ifeq ($(DEFAULT_COMPONENT),InstructionAPI)
37 fullSystem += $(InstructionAPI)
39 ifeq ($(DEFAULT_COMPONENT),ProcControlAPI)
40 fullSystem += $(ProcControlAPI)
42 ifeq ($(DEFAULT_COMPONENT),ParseAPI)
43 fullSystem += $(ParseAPI)
45 ifeq ($(DEFAULT_COMPONENT),DataflowAPI)
46 fullSystem += $(ParseAPI)
49 @echo Error: Build system does not have a valid default component: $(DEFAULT_COMPONENT)
59 ifndef DONT_BUILD_NEWTESTSUITE
60 testsuites += testsuite
61 allSubdirs_noinstall += testsuite
62 fullSystem += testsuite
64 testsuites += parseThat
65 fullSystem += parseThat
71 #USE_DEPRECATED_BPATCH_VECTOR = 1
72 #IBM_BPATCH_COMPAT = 1
73 # Apart from actual "full" releases, don't modify these build Id components.
74 # For personal/experimental builds, feel free to use your
75 # dyninst/make.config.local file to (re-)define BUILD_MARK as you desire.
77 # most "main" modules are only two levels deep, but we need to be able to
78 # change this for those that are deeper in the tree
83 TO_SCRIPTS = $(TO_CORE)/../scripts
86 # If the PLATFORM environment variable isn't set, we'll try to figure it out.
88 SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi )
90 CURPLAT = $(shell ${SNAME})
92 # IA64/Linux, i386/Linux, x86-64/Linux, ppc/Linux
93 ifneq (,$(findstring linux,$(CURPLAT)))
95 ifneq (,$(findstring i686,$(CURPLAT)))
96 PLATFORM = i386-unknown-linux2.4
98 ifneq (,$(findstring i586,$(CURPLAT)))
99 PLATFORM = i386-unknown-linux2.4
101 ifneq (,$(findstring i486,$(CURPLAT)))
102 PLATFORM = i386-unknown-linux2.4
104 ifneq (,$(findstring i386,$(CURPLAT)))
105 PLATFORM = i386-unknown-linux2.4
107 ifneq (,$(findstring x86_64,$(CURPLAT)))
108 PLATFORM = x86_64-unknown-linux2.4
110 ifneq (,$(findstring, ppc64,$(CURPLAT)))
111 PLATFORM = ppc64_linux
117 ifneq (,$(findstring aix,$(CURPLAT)))
118 PLATFORM = rs6000-ibm-aix5.1
121 ifneq (,$(findstring solaris,$(CURPLAT)))
122 PLATFORM = sparc-sun-solaris2.8
129 $(error Could not determine you current platform. Please set your PLATFORM environment variable to whichever closest matches your platform: i386-unknown-linux2.4 i386-unknown-nt4.0 x86_64-unknown-linux2.4 ppc32_linux ppc64_linux rs6000-ibm-aix5.1 rs6000-ibm-aix64-5.2 ppc32_bgl_ion ppc32_bgl_compute ppc32_bgp_ion ppc32_bgp_compute x86_64_catamount x86_64_cnl i386-unknown-freebsd7.2 amd64-unknown-freebsd7.2 ppc32-unknown-vxworks6.x)
132 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
134 # Include any per-user configuration changes; this "local" config file
135 # should *not* be under CVS control, so that it never gets committed.
136 include $(TO_CORE)/make.config.local
138 # Choose default development directories if necessary variables are unset
142 # Destinations for library and executable installation (relative to "dyninst"!)
143 # Warning: modification of the build/install structure is not recommended!
144 LIBRARY_DEST ?= ${TO_CORE}/../${PLATFORM}/lib
145 PROGRAM_DEST ?= ${TO_CORE}/../${PLATFORM}/bin
146 INCLUDE_DEST ?= ${TO_CORE}/../include
148 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
149 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
150 # with cvs), then we should look in a backup location. That's what this vrble
151 # is about. It's used several times below in this file.
152 ifeq ($(PLATFORM),ppc32_bgl_compute)
153 GCC = powerpc-bgp-linux-gcc
154 GXX = powerpc-bgp-linux-g++
155 CC = powerpc-bgp-linux-gcc
156 CXX = powerpc-bgp-linux-g++
158 ifeq ($(PLATFORM),ppc32_bgp_compute)
159 GCC = powerpc-bgp-linux-gcc
160 GXX = powerpc-bgp-linux-g++
161 CC = powerpc-bgp-linux-gcc
162 CXX = powerpc-bgp-linux-g++
182 PERL = perl # NB: perl v5 or higher required!
184 # COLLECTOR is only used by purify & quantify
185 COLLECTOR = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
186 # BUILDSTAMP is used to generate local build vouchers
187 BUILDSTAMP = $(TO_CORE)/../scripts/buildstamp
190 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
193 # Define all tags based on the platform string. When a new platform
194 # is added, add it to the list
197 # Brief description of -Ds:
200 # cap_save_the_world: support for creating a patched binary
201 # cap_relocation: function relocation
202 # cap_stripped_binaries: recursive parsing and function discovery without symbols
204 # cap_ptrace: uses ptrace interface
205 # cap_proc: uses /proc interface
206 # cap_proc_ioctl: uses ioctl interface to proc
207 # cap_proc_fd: uses solaris-style multiple-fd proc interface
208 # cap_threads: support for threaded applications
209 # cap_dynamic_heap: support for a dynamically growing inferior heap
210 # cap_threaded_times: (Linux only) times() returns per-thread information.
211 # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call.
212 # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature
213 # cap_32_64: platforms that support 32- and 64-bit mutatees
214 # cap_liveness: liveness analysis
215 # cap_fixpoint_gen: Generate code using a fixpoint method that saves space
216 # cap_noaddr_gen: Allow code generation before determining the address code is going into
217 # cap_mutatee_traps: Traps can be handled mutatee side
218 # cap_instruction_api: System uses instruction API
219 # cap_registers: User can access registers in snippets
220 # cap_instruction_replacement: we use the replaceCode concept to implement (e.g.,) function call replacement
221 # cap_tramp_liveness: we can run liveness over our trampolines to determine what's used
224 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
225 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
226 # the change occurs within a system call; reported by SGI.
227 # bug_freebsd_missing_sigstop: A stop followed by a continue and a new SIGSTOP
228 # results in the new SIGSTOP event never being returned from waitpid
229 # bug_freebsd_mt_suspend: threads do not suspend after an attach
230 # bug_freebsd_change_pc: when changing the PC for a thread, the OS may not
231 # schedule the thread if it is blocked in the kernel.
232 # bug_phdrs_first_page: the OS requires that the program headers for a ELF
233 # binary must reside in the first page of the binary on disk
235 ifeq ($(PLATFORM),i386-unknown-linux2.4)
236 OLD_DEF = -Di386_unknown_linux2_0
237 ARCH_DEF = -Darch_x86
239 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dcap_serialization -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_tramp_liveness
240 BUG_DEF = -Dbug_syscall_changepc_rewind
243 ifeq ($(PLATFORM),i386-unknown-linux2.6)
244 OLD_DEF = -Di386_unknown_linux2_0
245 ARCH_DEF = -Darch_x86
247 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dcap_serialization -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_instruction_replacement -Dcap_tramp_liveness
248 BUG_DEF = -Dbug_syscall_changepc_rewind
251 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
252 OLD_DEF = -Dx86_64_unknown_linux2_4
253 ARCH_DEF = -Darch_x86_64 -Darch_64bit
255 CAP_DEF = -Dcap_ptrace -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_relocation -Dcap_dwarf -Dcap_32_64 -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_registers -Dcap_instruction_api -Dcap_serialization -Dcap_instruction_replacement -Dcap_tramp_liveness
256 BUG_DEF = -Dbug_syscall_changepc_rewind
259 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
260 OLD_DEF = -Dsparc_sun_solaris2_4
261 ARCH_DEF = -Darch_sparc
262 OS_DEF = -Dos_solaris
263 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
264 -Dcap_syscall_trap -Dcap_serialization
268 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
269 OLD_DEF = -Dsparc_sun_solaris2_4
270 ARCH_DEF = -Darch_sparc
271 OS_DEF = -Dos_solaris
272 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
273 -Dcap_syscall_trap -Dcap_serialization
277 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
278 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
279 ARCH_DEF = -Darch_power
281 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap \
282 -Dcap_liveness -Dcap_use_pdvector -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \
283 -Dcap_stackwalker_use_symtab
287 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
288 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
289 ARCH_DEF = -Darch_power -Darch_64bit
291 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap \
292 -Dcap_liveness -Dcap_use_pdvector -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement \
293 -Dcap_instruction_api -Dcap_32_64
297 ifeq ($(PLATFORM),ppc64_linux)
298 OLD_DEF = -Dppc64_linux
299 ARCH_DEF = -Darch_power -Darch_64bit
301 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
302 -Dcap_32_64 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_binary_rewriter -Dcap_instruction_api
303 BUG_DEF = -Dbug_syscall_changepc_rewind
306 ifeq ($(PLATFORM),ppc32_linux)
307 OLD_DEF = -Dppc32_linux
308 ARCH_DEF = -Darch_power
310 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
311 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \
312 -Dcap_binary_rewriter
313 BUG_DEF = -Dbug_syscall_changepc_rewind
316 ifeq ($(PLATFORM),ppc32_bgl_ion)
317 OLD_DEF = -Dppc32_bluegene
318 ARCH_DEF = -Darch_power
319 OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_ion
320 CAP_DEF = -Dcap_dwarf
324 ifeq ($(PLATFORM),ppc32_bgl_compute)
325 OLD_DEF = -Dppc32_bluegene
326 ARCH_DEF = -Darch_powerO
327 OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_compute
328 CAP_DEF = -Dcap_dwarf
332 ifeq ($(PLATFORM),ppc32_bgp_ion)
333 OLD_DEF = -Dppc32_bluegene
334 ARCH_DEF = -Darch_power
335 OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_ion
336 CAP_DEF = -Dcap_dwarf
340 ifeq ($(PLATFORM),ppc32_bgp_compute)
341 OLD_DEF = -Dppc32_bluegene
342 ARCH_DEF = -Darch_power
343 OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_compute
344 CAP_DEF = -Dcap_dwarf
348 ifeq ($(PLATFORM),x86_64_catamount)
349 OLD_DEF = -Dx86_64_catamount
350 ARCH_DEF = -Darch_x86_64 -Darch_64bit
351 OS_DEF = -Dos_catamount
352 CAP_DEF = -Dcap_dwarf
355 ifeq ($(PLATFORM),x86_64_cnl)
356 OLD_DEF = -Dx86_64_cnl
357 ARCH_DEF = -Darch_x86_64 -Darch_64bit
358 OS_DEF = -Dos_linux -Dos_cnl
359 CAP_DEF = -Dcap_ptrace -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_relocation \
360 -Dcap_dwarf -Dcap_32_64 -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps \
361 -Dcap_instruction_api
362 BUG_DEF = -Dbug_syscall_changepc_rewind
366 ifeq ($(PLATFORM),ppc32-unknown-vxworks6.x)
367 OLD_DEF = -Dppc32_vxworks
368 ARCH_DEF = -Darch_power -Dtarget_ppc32 -Dtarget_smallmem -Dendian_mismatch
369 OS_DEF = -Dos_vxworks
370 CAP_DEF = -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dno_cap_serialization -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_instruction_api
371 #CAP_DEF = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_stripped_binaries
375 ifeq ($(PLATFORM),i386-unknown-freebsd7.2)
376 OLD_DEF = -Di386_unknown_freebsd7_0
377 ARCH_DEF = -Darch_x86
378 OS_DEF = -Dos_freebsd
379 CAP_DEF = -Dcap_instruction_api -Dcap_noaddr_gen -Dcap_dwarf -Dcap_binary_rewriter -Dcap_liveness -Dcap_fixpoint_gen -Dcap_registers -Dcap_instruction_replacement -Dcap_tramp_liveness -Dcap_relocation -Dcap_virtual_registers -Dcap_stripped_binaries
380 BUG_DEF = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page
383 ifeq ($(PLATFORM),amd64-unknown-freebsd7.2)
384 OLD_DEF = -Damd64_unknown_freebsd7_0
385 ARCH_DEF = -Darch_x86_64 -Darch_64bit
386 OS_DEF = -Dos_freebsd
387 CAP_DEF = -Dcap_instruction_api -Dcap_noaddr_gen -Dcap_dwarf -Dcap_binary_rewriter -Dcap_liveness -Dcap_fixpoint_gen -Dcap_registers -Dcap_instruction_replacement -Dcap_tramp_liveness -Dcap_relocation -Dcap_virtual_registers -Dcap_stripped_binaries -Dcap_32_64
388 BUG_DEF = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page
393 CAP_DEF += -Dcap_thread_db
396 # Combine all the #defines for ease of use
397 UNIFIED_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) $(AC_DEF)
398 UNIFIED_TEST_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
400 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
401 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
402 #AS = /usr/ccs/bin/as
406 ifeq (linux,$(findstring linux,$(OS_DEF)))
411 ASFLAGS = -P $(UNIFIED_DEF)
414 # set the macros that control whether the stdint limit and constant
415 # macros are defined for C++ on the compilers command line so that
416 # we don't have to worry about the ordering of #includes.
417 ifeq (linux,$(findstring linux,$(PLATFORM)))
418 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
420 ifeq (freebsd,$(findstring freebsd,$(PLATFORM)))
421 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
423 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
424 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
431 # Default module compiler; modules which want $(CC) should redefine
435 MODCFLAGS = $(CXXFLAGS)
440 # Added dyninst/external for included external dependencies - bernat, 11JUN07
441 IFLAGS = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/dynutil/h -I$(TO_CORE)/external
443 # uncomment/comment the line below to build with/without compilation warnings
444 # SILENCE_WARNINGS=true
446 ifndef SILENCE_WARNINGS
447 BASICWARNINGS = -W -Wall
449 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
451 -Wredundant-decls -Woverloaded-virtual
453 # not as strict as above, but can actually be used -- mdc
454 USEFULWARNINGS = -W -Wall -Wpointer-arith \
458 # being nice to poor old pathetic tcl/tk header files --ari
459 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
463 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
464 COMMONWARNINGS += -Wno-unknown-pragmas
465 USEFULWARNINGS += -Wno-unknown-pragmas
466 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
467 else # STL on Solaris with cast-align generates a warning with much output
468 COMMONWARNINGS += -Wcast-align
469 USEFULWARNINGS += -Wcast-align
471 endif # SILENCE_WARNINGS
475 GCC_VER := $(shell gcc --version)
476 ifneq (,$(findstring 2.95,$(GCC_VER)))
482 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
483 versionNumbers = $(sort $(GCC_VER) 2.95)
484 versionNumber = $(firstword $(versionNumbers))
485 ifneq (2.95, $(versionNumber))
491 COMMONWARNINGS += -Wno-non-template-friend
492 USEFULWARNINGS += -Wno-non-template-friend
493 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
496 #don't inline -- for the files that won't emit template code
499 #inline the private members of the class -- templates.o can use this
500 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
502 # inline everything -- the way things should be
503 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
506 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
507 USES_LIBDYNINST_SO = true
509 ifeq (linux,$(findstring linux,$(PLATFORM)))
510 USES_LIBDYNINST_SO = true
513 # Set this variable if it's desired that dyninst be built with the native
514 # compiler on Solaris
518 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
519 USES_LIBDYNINST_SO = true
520 USES_NATIVE_CC = true
526 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
527 ifndef IBM_BPATCH_COMPAT
528 USES_LIBDYNINST_SO = true
531 USES_PERF_LIBRARY = true
532 # No longer used, because of relocation.
533 #USES_LIB_TEXT_HEAP = true
535 ifdef IBM_BPATCH_COMPAT
536 ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
537 USES_NATIVE_CC = true
541 DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
545 # As of AIX 5, the pm_init function in libpmapi takes more
546 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
547 # and handled in the paradyn runtime library
548 PMAPI_VERSION := $(shell uname -v )
549 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
550 USES_PMAPI_GROUPS = true
554 # if we don't want OPT_FLAG defined for a particular part of the code
555 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
556 # the include of make.config - naim
561 # Do we shorten compile lines?
562 ifndef VERBOSE_COMPILATION
566 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
567 ARCH_FLAGS = -maix64 -Drs6000_ibm_aix64
570 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
574 # flags for normal (non-kludge) files, with common warnings
575 CFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
576 CXXFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
577 LDFLAGS = $(ARCH_FLAGS)
579 # flags for kludge files, won't have warnings generated
580 KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
584 CFLAGS += -fprofile-arcs -ftest-coverage
585 CXXFLAGS += -fprofile-arcs -ftest-coverage
586 LDFLAGS += -fprofile-arcs -ftest-coverage
591 CFLAGS += -DPURE_BUILD
592 CXXFLAGS += -DPURE_BUILD
595 ifdef USES_PERF_LIBRARY
596 # Add any platform-specific performance libraries here
597 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
599 CFLAGS += -DUSES_PMAPI
600 CXXFLAGS += -DUSES_PMAPI
602 ifdef USES_PMAPI_GROUPS
603 CFLAGS += -DPMAPI_GROUPS
604 CXXFLAGS += -DPMAPI_GROUPS
605 endif # USES_PMAPI_GROUPS
609 ifdef USE_DEPRECATED_BPATCH_VECTOR
610 CXXFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
611 CFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
612 TFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
614 #CFLAGS += -fimplicit-templates
615 CXXFLAGS += -fimplicit-templates
616 TFLAGS += -fimplicit-templates
619 ifdef IBM_BPATCH_COMPAT
620 CXXFLAGS += -DIBM_BPATCH_COMPAT
621 CFLAGS += -DIBM_BPATCH_COMPAT
629 ifeq ($(DEBUG_FLAG),none)
634 CFLAGS += $(DEBUG_FLAG)
635 CXXFLAGS += $(DEBUG_FLAG)
636 KFLAGS += $(DEBUG_FLAG)
639 ifdef VERBOSE_CFG_ACCOUNTING
640 CFLAGS += -DVERBOSE_CFG_FACTORY
641 CXXFLAGS += -DVERBOSE_CFG_FACTORY
644 # flags for template files, don't define external template flags
645 # -g is optional in this case -- should be defined at module level
646 TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
649 CFLAGS += $(ALL_INLINE_DEFINES)
650 CXXFLAGS += $(ALL_INLINE_DEFINES)
653 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
654 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
655 LIBDIR = $(FIRST_LIBDIR) \
656 -L$(TO_CORE)/../$(PLATFORM)/lib
658 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
659 # else set it to just "igen" (i.e. assume it's in the user's path)
661 IGEN = $(shell if [ -f ${TO_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${TO_CORE}/../${BASEPLATFORM}/bin/igen; else if [ -f ${TO_CORE}/igen/${BASEPLATFORM}/igen ]; then echo ${TO_CORE}/igen/${BASEPLATFORM}/igen; else echo igen; fi; fi )
663 IGEN = $(shell if [ -f ${TO_CORE}/${PROGRAM_DEST}/igen ]; then echo ${TO_CORE}/${PROGRAM_DEST}/igen; else if [ -f ${TO_CORE}/igen/$(PLATFORM)/igen ]; then echo ${TO_CORE}/igen/${PLATFORM}/igen; else echo igen; fi; fi )
666 ifdef NO_IMPLICIT_TEMPLATES
667 ifdef USE_DEPRECATED_BPATCH_VECTOR
668 # CFLAGS += -fno-implicit-templates
669 CXXFLAGS += -fno-implicit-templates
670 KFLAGS += -fno-implicit-templates
674 ifndef INSTANTIATE_TEMPLATES
675 ifndef NO_IMPLICIT_TEMPLATES
676 # -fexternal-templates and -Dexternal_templates should both be used or
677 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
678 # (but not to TFLAGS).
680 #CFLAGS += -fexternal-templates -Dexternal_templates
681 #CXXFLAGS += -fexternal-templates -Dexternal_templates
682 #KFLAGS += -fexternal-templates -Dexternal_templates
689 ifeq (xyes,x$(USE_PTHREADS))
690 THREADSLIB += -lpthread
692 # On Linux, programs using pthreads are supposed to define _REENTRANT
693 ifeq (linux,$(findstring linux,$(PLATFORM)))
694 CFLAGS += -D_REENTRANT=1
695 CXXFLAGS += -D_REENTRANT=1
696 KFLAGS += -D_REENTRANT=1
697 TFLAGS += -D_REENTRANT=1
701 ifeq (freebsd,$(findstring freebsd,$(PLATFORM)))
702 CFLAGS += -D_REENTRANT=1
703 CXXFLAGS += -D_REENTRANT=1
704 KFLAGS += -D_REENTRANT=1
705 TFLAGS += -D_REENTRANT=1
708 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
709 #CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
710 #CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
711 #KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
712 #TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
715 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
716 CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
717 CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
718 KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
719 TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
724 # System build constraints
725 #Build the MT daemon on AIX, Solaris, and Linux/x86
726 DONT_BUILD_PD_MT = true
727 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
730 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
733 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
737 # Build newtestsuite on i386, x86_64 and ia64 linux
738 #DONT_BUILD_NEWTESTSUITE = true
739 #ifeq (i386-unknown-linux,$(findstring i386-unknown-linux,$(PLATFORM)))
740 #DONT_BUILD_NEWTESTSUITE = false
742 #ifeq (ia64-unknown-linux,$(findstring ia64-unknown-linux,$(PLATFORM)))
743 #DONT_BUILD_NEWTESTSUITE = false
745 #ifeq (x86_64-unknown-linux,$(findstring x86_64-unknown-linux,$(PLATFORM)))
746 #DONT_BUILD_NEWTESTSUITE = false
748 #ifeq (ppc32_linux,$(findstring ppc32_linux,$(PLATFORM)))
749 #DONT_BUILD_NEWTESTSUITE = false
751 #ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
752 #DONT_BUILD_NEWTESTSUITE = false
754 #ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
755 #DONT_BUILD_NEWTESTSUITE = false
759 CFLAGS += -Dcap_mmtimer
760 CXXFLAGS += -Dcap_mmtimer
765 $(error error: TCLTK_DIR is not set. Please set in make.config.local)
767 TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib
768 TCLTK_INC_DIR ?= $(TCLTK_DIR)/include
771 ifdef USES_UNWIND_LIB
772 CFLAGS += -Dcap_unwind
773 CXXFLAGS += -Dcap_unwind
774 LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib
775 LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include
778 ifdef USES_DWARF_DEBUG
779 LIBDWARF_INC ?= $(LIBDWARFDIR)/include
780 LIBDWARF_LIB ?= $(LIBDWARFDIR)/lib
784 LIBELF_INC ?= $(LIBELFDIR)/include
785 LIBELF_LIB ?= $(LIBELFDIR)/lib
788 ifdef HAVE_NATIVE_DEMANGLER
789 LDFLAGS += -ldemangle
790 CAP_DEF += -Dcap_native_demangler
794 CAP_DEF += -Dcap_gnu_demangler
798 CAP_DEF += -Dcap_liberty
801 DEMANGLER_LINK = -L$(LIBIBERTY_LIB) -liberty
803 DEMANGLER_LINK = -liberty
807 DEMANGLER_EXEC_LINK = -L$(LIBIBERTY_LIB) -liberty
809 DEMANGLER_EXEC_LINK = -liberty
816 WITHLIBFL = --with-libfldir=$(FLEX_DIR)
822 #Build other variables based off of the above defaults
825 # use the first set if using tcl8.4,
826 # use the second set if still using tcl8.3
829 TCLTK_LIBVER_ID = 8.4
830 CFLAGS += -DTCLCONST=const
831 CXXFLAGS += -DTCLCONST=const
832 KFLAGS += -DTCLCONST=const
833 TFLAGS += -DTCLCONST=const
837 TCLTK_LIBVER_ID = 8.3
838 CFLAGS += -DTCLCONST=""
839 CXXFLAGS += -DTCLCONST=""
840 KFLAGS += -DTCLCONST=""
841 TFLAGS += -DTCLCONST=""
845 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
846 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
849 TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
851 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
854 # TCL2C is used to generate compilable sources from tcl files
855 TCL2C = $(TO_CORE)/../scripts/tcl2c
856 TCL2C_GEN_SRCS = tcl2c.C
858 IFLAGS += -I$(TCLTK_INC_DIR)
860 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
862 LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
868 PAPI_INCDIR = $(PAPI_ROOT)
869 PAPI_LIBDIR = $(PAPI_ROOT)
870 #PAPI_LIB = -Wl,-static -lpapi -Wl,-Bdynamic
871 #PAPI_LIB = $(PAPI_LIBDIR)/libpapi.a
872 PAPI_LIB = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi
873 IFLAGS += -I$(PAPI_INCDIR)
874 LIBDIR += $(patsubst %,-L%,$(PAPI_LIBDIR))
883 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
889 # no /s or /p allowed here
890 #FLEX_DIR = /s/flex/rs_aix41/lib
891 #LIBDIR += -L/p/sp2/gcc/lib
894 ifdef LIBDWARF_HASSETFRAME
895 CAP_DEF += -Ddwarf_has_setframe
901 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
902 X11DIR = /usr/openwin
903 CFLAGS += -I$(X11DIR)/include
904 CXXFLAGS += -I$(X11DIR)/include
905 TFLAGS += -I$(X11DIR)/include
906 LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib
909 ifeq (linux,$(findstring linux,$(PLATFORM)))
911 CFLAGS += -I$(X11DIR)/include/X11
912 CXXFLAGS += -I$(X11DIR)/include/X11
913 TFLAGS += -I$(X11DIR)/include/X11
914 LIBDIR += -L$(X11DIR)/lib
917 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
918 LIBDIR += -L$(X11DIR)/lib64
920 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))