Merge branch 'dyninst_proccontrol_bw'
[dyninst.git] / make.config
1 # -*- makefile -*-
2 # Paradyn overall build configuration (unix)
3 #
4 # $Id: make.config,v 1.242 2008/09/20 03:56:08 jaw Exp $
5 #
6
7 SUITE_NAME      = Paradyn
8 RELEASE_NUM     = 8.0
9
10 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
11
12 # Include any per-user configuration changes; this "local" config file
13 # should *not* be under CVS control, so that it never gets committed.
14 ifndef TO_CORE
15 TO_CORE         = ../..
16 endif
17 include $(TO_CORE)/$(PLATFORM)/make.config.local
18
19 Everything = dynutil common symtabAPI instructionAPI parseAPI proccontrol stackwalk dyninstAPI_RT dyninstAPI 
20 SymtabAPI       = dynutil common symtabAPI
21 StackwalkerAPI = dynutil common proccontrol stackwalk
22 DyninstAPI      = dynutil common symtabAPI instructionAPI parseAPI stackwalk dyninstAPI_RT dyninstAPI
23 DynC_API = dynutil common symtabAPI instructionAPI parseAPI dyninstAPI_RT dyninstAPI dynC_API
24 InstructionAPI  = dynutil common instructionAPI
25 ProcControlAPI = dynutil common proccontrol
26 DepGraphAPI = depGraphAPI
27 ParseAPI = dynutil common symtabAPI instructionAPI parseAPI
28 ValueAdded = valueAdded/sharedMem
29 DataflowAPI = ParseAPI
30
31 DEFAULT_COMPONENT ?= default
32 ifeq ($(DEFAULT_COMPONENT),default)
33 fullSystem      += $(Everything)
34 BUILD_PARSETHAT = true
35 else
36 ifeq ($(DEFAULT_COMPONENT),SymtabAPI)
37 fullSystem += $(SymtabAPI)
38 else
39 ifeq ($(DEFAULT_COMPONENT),StackwalkerAPI)
40 fullSystem += $(StackwalkerAPI)
41 else
42 ifeq ($(DEFAULT_COMPONENT),DyninstAPI)
43 fullSystem      += $(DyninstAPI)
44 BUILD_PARSETHAT = true
45 else
46 ifeq ($(DEFAULT_COMPONENT),InstructionAPI)
47 fullSystem += $(InstructionAPI)
48 else
49 ifeq ($(DEFAULT_COMPONENT),ProcControlAPI)
50 fullSystem += $(ProcControlAPI)
51 else
52 ifeq ($(DEFAULT_COMPONENT),ParseAPI)
53 fullSystem += $(ParseAPI)
54 else
55 ifeq ($(DEFAULT_COMPONENT),DataflowAPI)
56 fullSystem += $(ParseAPI)
57 else
58 default:
59         @echo Error: Build system does not have a valid default component: $(DEFAULT_COMPONENT)
60 endif
61 endif
62 endif
63 endif
64 endif
65 endif
66 endif
67 endif
68
69 ifndef DONT_BUILD_NEWTESTSUITE
70 testsuites += testsuite
71 allSubdirs_noinstall += testsuite 
72 fullSystem += testsuite
73 ifdef BUILD_PARSETHAT
74 testsuites += parseThat
75 fullSystem += parseThat
76 endif
77 endif
78
79 #BUILD_MARK     =
80 EXPLICIT_DEPENDS = 1
81 #USE_DEPRECATED_BPATCH_VECTOR   = 1
82 #IBM_BPATCH_COMPAT = 1
83 # Apart from actual "full" releases, don't modify these build Id components.
84 # For personal/experimental builds, feel free to use your 
85 # dyninst/make.config.local file to (re-)define BUILD_MARK as you desire.
86
87 # most "main" modules are only two levels deep, but we need to be able to
88 # change this for those that are deeper in the tree
89 ifndef TO_SCRIPTS
90 TO_SCRIPTS = $(TO_CORE)/scripts
91 endif
92
93 # If the PLATFORM environment variable isn't set, we'll try to figure it out.
94 ifndef PLATFORM
95
96 ifdef build
97 CURPLAT = $(build)
98 else
99 SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi )
100 ifdef SNAME
101 CURPLAT = $(shell ${SNAME})
102 endif
103 endif
104
105 # i386/Linux, x86-64/Linux, ppc/Linux, ppc64/Linux
106 ifneq (,$(findstring linux,$(CURPLAT)))
107 ifneq (,$(findstring i686,$(CURPLAT)))
108 PLATFORM = i386-unknown-linux2.4
109 endif
110 ifneq (,$(findstring i586,$(CURPLAT)))
111 PLATFORM = i386-unknown-linux2.4
112 endif
113 ifneq (,$(findstring i486,$(CURPLAT)))
114 PLATFORM = i386-unknown-linux2.4
115 endif
116 ifneq (,$(findstring i386,$(CURPLAT)))
117 PLATFORM = i386-unknown-linux2.4
118 endif
119 ifneq (,$(findstring x86_64,$(CURPLAT)))
120 PLATFORM = x86_64-unknown-linux2.4
121 endif
122 ifneq (,$(findstring, ppc64,$(CURPLAT)))
123 PLATFORM = ppc64_linux
124 endif
125 ifneq (,$(findstring, powerpc64,$(CURPLAT)))
126 PLATFORM = ppc64_linux
127 endif
128 ifneq (,$(findstring, powerpc-,$(CURPLAT)))
129 PLATFORM = ppc32_linux
130 endif
131 ifneq (,$(findstring, ppc-,$(CURPLAT)))
132 PLATFORM = ppc32_linux
133 endif
134 endif
135
136 # Freebsd
137 ifneq (,$(findstring freebsd,$(CURPLAT)))
138 ifneq (,$(findstring i686,$(CURPLAT)))
139 PLATFORM = i386-unknown-freebsd7.2
140 endif
141 ifneq (,$(findstring i586,$(CURPLAT)))
142 PLATFORM = i386-unknown-freebsd7.2
143 endif
144 ifneq (,$(findstring i486,$(CURPLAT)))
145 PLATFORM = i386-unknown-freebsd7.2
146 endif
147 ifneq (,$(findstring i386,$(CURPLAT)))
148 PLATFORM = i386-unknown-freebsd7.2
149 endif
150 ifneq (,$(findstring x86_64,$(CURPLAT)))
151 PLATFORM = amd64-unknown-freebsd7.2
152 endif
153 endif
154
155 # VxWorks
156 ifneq (,$(findstring vxworks,$(CURPLAT)))
157 ifneq (,$(findstring i686,$(CURPLAT)))
158 PLATFORM = i386-unknown-vxworks6.x
159 endif
160 ifneq (,$(findstring i586,$(CURPLAT)))
161 PLATFORM = i386-unknown-vxworks6.x
162 endif
163 ifneq (,$(findstring i486,$(CURPLAT)))
164 PLATFORM = i386-unknown-vxworks6.x
165 endif
166 ifneq (,$(findstring i386,$(CURPLAT)))
167 PLATFORM = i386-unknown-vxworks6.x
168 endif
169 ifneq (,$(findstring powerpc-,$(CURPLAT)))
170 PLATFORM = ppc32-unknown-vxworks6.x
171 endif
172 endif
173
174 ifndef PLATFORM
175 ifdef build
176 PLATFORM = $(build)
177 endif
178 endif
179
180 endif
181
182 ifndef PLATFORM
183 $(error Could not determine you current platform.  Please set your PLATFORM environment variable to whichever closest matches your platform: amd64-unknown-freebsd7.2 i386-unknown-freebsd7.2 i386-unknown-linux2.4 i386-unknown-vxworks6.x ppc32-unknown-vxworks6.x ppc32_bgl_ion ppc32_bgp ppc32_bgp_ion ppc32_linux ppc64_bgq_ion ppc64_linux x86_64-unknown-linux2.4)
184 endif
185
186 # Choose default development directories if necessary variables are unset
187
188 LIBRARY_DEST ?= $(libdir)
189 PROGRAM_DEST ?= $(bindir)
190 INCLUDE_DEST ?= $(includedir)
191
192 ifdef prefix
193 ifeq (x$(LIBRARY_DEST),x)
194 LIBRARY_DEST = $(prefix)/lib
195 endif
196 ifeq (x$(PROGRAM_DEST),x)
197 PROGRAM_DEST = $(prefix)/bin
198 endif
199 ifeq (x$(INCLUDE_DEST),x)
200 LIBRARY_DEST = $(prefix)/include
201 endif
202 endif
203
204 # Destinations for library and executable installation (relative to "dyninst"!)
205 #  These are here for backwards compatibility with old make.config.locals
206 LIBRARY_DEST    ?= ${TO_CORE}/../${PLATFORM}/lib
207 PROGRAM_DEST    ?= ${TO_CORE}/../${PLATFORM}/bin
208 INCLUDE_DEST   ?= ${TO_CORE}/../include
209
210 # DESTDIR is a standard name to do a staged install
211 ifdef DESTDIR
212 LIBRARY_DEST := ${DESTDIR}${LIBRARY_DEST}
213 PROGRAM_DEST := ${DESTDIR}${PROGRAM_DEST}
214 INCLUDE_DEST := ${DESTDIR}${INCLUDE_DEST}
215 endif
216
217 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
218 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
219 # with cvs), then we should look in a backup location.  That's what this vrble
220 # is about.  It's used several times below in this file.
221 ifeq ($(PLATFORM),ppc32_bgl_compute)
222 GCC         = mpgcc
223 GXX         = mpg++
224 CC          = mpgcc
225 CXX         = mpg++
226 endif
227 ifeq ($(PLATFORM),ppc32_bgp_compute)
228 GCC         = powerpc-bgp-linux-gcc
229 GXX         = powerpc-bgp-linux-g++
230 CC          = powerpc-bgp-linux-gcc
231 CXX         = powerpc-bgp-linux-g++
232 endif
233
234 GCC      ?= gcc
235 GXX      ?= g++
236 LINKER   = ld
237 AS              = as
238 CC       ?= $(GCC)
239 CXX      ?= $(GXX)
240 LEX      = flex
241 RANLIB   = ranlib
242 AR       = ar
243 YFLAGS   = -d -y
244 YACC     = bison
245 MV       = mv
246 CP       = cp
247 RM       = rm -f
248 LN       = ln -s
249 MKDIR           = mkdir -p
250 CHMOD    = chmod
251 PERL            = perl          # NB: perl v5 or higher required!
252
253 # COLLECTOR is only used by purify & quantify
254 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
255 # BUILDSTAMP is used to generate local build vouchers
256 BUILDSTAMP      = $(TO_CORE)/scripts/buildstamp
257
258 ifndef PLATFORM
259 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
260 endif
261
262 # Define all tags based on the platform string. When a new platform
263 # is added, add it to the list
264
265 #
266 # Brief description of -Ds:
267 #
268 # CAP
269 # cap_save_the_world: support for creating a patched binary
270 # cap_relocation: function relocation
271 # cap_stripped_binaries: recursive parsing and function discovery without symbols
272 # cap_async_events: 
273 # cap_ptrace: uses ptrace interface
274 # cap_proc: uses /proc interface
275 # cap_proc_ioctl: uses ioctl interface to proc
276 # cap_proc_fd: uses solaris-style multiple-fd proc interface
277 # cap_threads: support for threaded applications
278 # cap_dynamic_heap: support for a dynamically growing inferior heap
279 # cap_threaded_times: (Linux only) times() returns per-thread information.
280 # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call.
281 # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature
282 # cap_32_64: platforms that support 32- and 64-bit mutatees
283 # cap_liveness: liveness analysis
284 # cap_fixpoint_gen: Generate code using a fixpoint method that saves space
285 # cap_noaddr_gen: Allow code generation before determining the address code is going into
286 # cap_mutatee_traps: Traps can be handled mutatee side
287 # cap_instruction_api: System uses instruction API
288 # cap_registers: User can access registers in snippets
289 # cap_instruction_replacement: we use the replaceCode concept to implement (e.g.,) function call replacement
290 # cap_tramp_liveness: we can run liveness over our trampolines to determine what's used
291 # cap_toc: platform uses a TOC pointer that must be updated in inter-module control transfers
292 # cap_toc_32: "" for 32-bit mode
293 # cap_toc_64: "" for 64-bit mode
294 #
295 # BUG
296 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
297 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
298 #   the change occurs within a system call; reported by SGI.
299 # bug_freebsd_missing_sigstop: A stop followed by a continue and a new SIGSTOP 
300 #   results in the new SIGSTOP event never being returned from waitpid
301 # bug_freebsd_mt_suspend: threads do not suspend after an attach
302 # bug_freebsd_change_pc: when changing the PC for a thread, the OS may not
303 #   schedule the thread if it is blocked in the kernel.
304 # bug_phdrs_first_page: the OS requires that the program headers for a ELF
305 #   binary must reside in the first page of the binary on disk
306 # bug_registers_after_exit: Linux throws an oops and kills the culprit thread
307 #   when it attempts to read registers via ptrace after a pre-Exit
308 # bug_force_terminate_failure: during a ForceTerminate on Linux, there exists
309 # an OS-level race condition where we will receive a Post-Exit event but the 
310 # process remains stopped
311
312 ifeq ($(PLATFORM),i386-unknown-linux2.4)
313 OLD_DEF     = -Di386_unknown_linux2_0
314 ARCH_DEF    = -Darch_x86
315 OS_DEF      = -Dos_linux
316 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
317 BUG_DEF     = -Dbug_syscall_changepc_rewind
318 endif
319
320 ifeq ($(PLATFORM),i386-unknown-linux2.6)
321 OLD_DEF     = -Di386_unknown_linux2_0
322 ARCH_DEF    = -Darch_x86
323 OS_DEF      = -Dos_linux
324 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
325 BUG_DEF     = -Dbug_syscall_changepc_rewind
326 endif
327
328 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
329 OLD_DEF     = -Dx86_64_unknown_linux2_4
330 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
331 OS_DEF      = -Dos_linux
332 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
333 BUG_DEF     = -Dbug_syscall_changepc_rewind
334 endif
335
336 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
337 OLD_DEF     = -Dsparc_sun_solaris2_4
338 ARCH_DEF    = -Darch_sparc
339 OS_DEF      = -Dos_solaris
340 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
341 -Dcap_syscall_trap -Dcap_serialization
342 BUG_DEF     =
343 endif
344
345 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
346 OLD_DEF     = -Dsparc_sun_solaris2_4
347 ARCH_DEF    = -Darch_sparc
348 OS_DEF      = -Dos_solaris
349 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
350 -Dcap_syscall_trap -Dcap_serialization
351 BUG_DEF     =
352 endif
353
354 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
355 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
356 ARCH_DEF    = -Darch_power
357 OS_DEF      = -Dos_aix
358 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap \
359 -Dcap_liveness -Dcap_use_pdvector -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \
360 -Dcap_stackwalker_use_symtab
361 BUG_DEF     =
362 endif
363
364 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
365 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
366 ARCH_DEF    = -Darch_power -Darch_64bit
367 OS_DEF      = -Dos_aix
368 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap \
369 -Dcap_liveness -Dcap_use_pdvector -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement \
370 -Dcap_instruction_api -Dcap_32_64
371 BUG_DEF     = 
372 endif
373
374 ifeq ($(PLATFORM),ppc64_linux)
375 OLD_DEF     = -Dppc64_linux
376 ARCH_DEF    = -Darch_power -Darch_64bit
377 OS_DEF      = -Dos_linux
378 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
379 -Dcap_32_64 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_binary_rewriter -Dcap_instruction_api -Dcap_toc_64
380 BUG_DEF     = -Dbug_syscall_changepc_rewind -Dbug_registers_after_exit -Dbug_force_terminate_failure
381 endif
382
383 ifeq ($(PLATFORM),ppc32_linux)
384 OLD_DEF     = -Dppc32_linux
385 ARCH_DEF    = -Darch_power
386 OS_DEF      = -Dos_linux
387 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
388 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \
389 -Dcap_binary_rewriter
390 BUG_DEF     = -Dbug_syscall_changepc_rewind -Dbug_registers_after_exit -Dbug_force_terminate_failure
391 endif
392
393 ifeq ($(PLATFORM),ppc32_bgp)
394 OLD_DEF     = -Dppc32_linux
395 ARCH_DEF    = -Darch_power
396 OS_DEF      = -Dos_linux
397 CAP_DEF     = -Dcap_ptrace -Dcap_mutatee_traps -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
398 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \
399 -Dcap_binary_rewriter
400 BUG_DEF     = -Dbug_syscall_changepc_rewind
401 endif
402
403
404 ifeq ($(PLATFORM),ppc32_bgl_ion)
405 OLD_DEF     = -Dppc32_bluegene
406 ARCH_DEF    = -Darch_power
407 OS_DEF      = -Dos_bg -Dos_bgl -Dos_bg_ion
408 CAP_DEF     = -Dcap_dwarf
409 BUG_DEF     = 
410 endif
411
412 ifeq ($(PLATFORM),ppc32_bgl_compute)
413 OLD_DEF     = -Dppc32_bluegene
414 ARCH_DEF    = -Darch_powerO
415 OS_DEF      = -Dos_bg -Dos_bgl -Dos_bg_compute
416 CAP_DEF     = -Dcap_dwarf
417 BUG_DEF     = 
418 endif
419
420 ifeq ($(PLATFORM),ppc32_bgp_ion)
421 OLD_DEF     = -Dppc32_bluegene
422 ARCH_DEF    = -Darch_power
423 OS_DEF      = -Dos_bg -Dos_bgp -Dos_bg_ion
424 CAP_DEF     = -Dcap_dwarf
425 BUG_DEF     = 
426 endif
427
428 ifeq ($(PLATFORM),ppc64_bgq_ion)
429 OLD_DEF     = -Dppc64_bluegene
430 ARCH_DEF    = -Darch_power -Darch_64bit
431 OS_DEF      = -Dos_bg -Dos_bgq -Dos_bgq_ion
432 CAP_DEF     = -Dcap_dwarf -Dcap_instruction_api
433 BUF_DEF     =
434 endif
435
436 ifeq ($(PLATFORM),ppc32_bgp_compute)
437 OLD_DEF     = -Dppc32_bluegene
438 ARCH_DEF    = -Darch_power
439 OS_DEF      = -Dos_bg -Dos_bgp -Dos_bg_compute
440 CAP_DEF     = -Dcap_dwarf
441 BUG_DEF     = 
442 endif
443
444 ifeq ($(PLATFORM),x86_64_catamount)
445 OLD_DEF     = -Dx86_64_catamount
446 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
447 OS_DEF      = -Dos_catamount
448 CAP_DEF     = -Dcap_dwarf
449 BUG_DEF     = 
450 endif
451 ifeq ($(PLATFORM),x86_64_cnl)
452 OLD_DEF     = -Dx86_64_cnl -Dx86_64_unknown_linux2_4
453 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
454 OS_DEF      = -Dos_linux -Dos_cnl
455 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
456 BUG_DEF     = -Dbug_syscall_changepc_rewind
457 STATIC_COMPS = true
458 DONT_BUILD_NEWTESTSUITE = true
459 endif
460 #
461
462 ifeq ($(PLATFORM),ppc32-unknown-vxworks6.x)
463 OLD_DEF     = -Dppc32_vxworks
464 ARCH_DEF    = -Darch_power -Dtarget_ppc32 -Dtarget_smallmem -Dendian_mismatch
465 OS_DEF      = -Dos_vxworks
466 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
467 #CAP_DEF     = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_stripped_binaries
468 BUG_DEF     =
469 endif
470
471 ifeq ($(PLATFORM),i386-unknown-vxworks6.x)
472 OLD_DEF     = -Di386_vxworks
473 ARCH_DEF    = -Darch_x86 -Dtarget_smallmem
474 OS_DEF      = -Dos_vxworks -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
475 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
476 #CAP_DEF     = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_stripped_binaries
477 BUG_DEF     =
478 endif
479
480 ifeq ($(PLATFORM),i386-unknown-freebsd7.2)
481 OLD_DEF     = -Di386_unknown_freebsd7_0
482 ARCH_DEF    = -Darch_x86
483 OS_DEF      = -Dos_freebsd
484 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_threads -Dcap_mutatee_traps
485 BUG_DEF     = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page -Dbug_syscall_changepc_rewind -Dbug_freebsd_attach_stop
486 endif
487
488 ifeq ($(PLATFORM),amd64-unknown-freebsd7.2)
489 OLD_DEF     = -Damd64_unknown_freebsd7_0
490 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
491 OS_DEF      = -Dos_freebsd
492 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 -Dcap_threads -Dcap_mutatee_traps
493 BUG_DEF     = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page -Dbug_syscall_changepc_rewind -Dbug_freebsd_attach_stop
494 endif
495
496
497 ifdef HAVE_THREAD_DB
498 CAP_DEF    += -Dcap_thread_db
499 endif
500
501 # Combine all the #defines for ease of use
502 UNIFIED_DEF     = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) $(AC_DEF)
503 UNIFIED_TEST_DEF        = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
504
505 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
506 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
507 #AS             = /usr/ccs/bin/as
508 RANLIB          = true
509 endif
510
511 ifeq (linux,$(findstring linux,$(OS_DEF)))
512 AS              = /usr/bin/as
513 RANLIB          = true 
514 ASFLAGS         =
515 else
516 ASFLAGS         = -P $(UNIFIED_DEF) 
517 endif 
518
519 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
520 ASFLAGS         += -m64
521 endif
522
523 # set the macros that control whether the stdint limit and constant
524 # macros are defined for C++ on the compilers command line so that
525 # we don't have to worry about the ordering of #includes.
526 ifeq (linux,$(findstring linux,$(PLATFORM)))
527 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
528 else
529 ifeq (freebsd,$(findstring freebsd,$(PLATFORM)))
530 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
531 else
532 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
533 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
534 else
535 ifeq (cnl,$(findstring cnl,$(PLATFORM)))
536 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
537 else
538 ifeq (bgp,$(findstring bgp,$(PLATFORM)))
539 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
540 else
541 STDINT_MACROS   = 
542 endif
543 endif
544 endif
545 endif
546 endif
547
548 # Default module compiler; modules which want $(CC) should redefine
549 # this, **NOT** CC
550
551 MODCC           = $(CXX)
552 MODCFLAGS       = $(CXXFLAGS)
553 DEPCC       = $(MODCC)
554
555 .SUFFIXES:      .I
556
557 # Added dyninst/external for included external dependencies - bernat, 11JUN07
558 IFLAGS          = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/dynutil/h -I$(TO_CORE)/external
559
560 # uncomment/comment the line below to build with/without compilation warnings
561 # SILENCE_WARNINGS=true
562
563 ifndef SILENCE_WARNINGS
564 BASICWARNINGS   = -W -Wall
565
566 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
567                 -Wcast-qual            \
568                 -Wredundant-decls -Woverloaded-virtual
569
570 # not as strict as above, but can actually be used -- mdc
571 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
572                 -Wcast-qual            \
573                 -Woverloaded-virtual
574
575 # being nice to poor old pathetic tcl/tk header files --ari
576 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
577                 -Wcast-qual \
578                 -Woverloaded-virtual
579
580 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
581 COMMONWARNINGS       += -Wno-unknown-pragmas
582 USEFULWARNINGS       += -Wno-unknown-pragmas
583 TCLFRIENDLYWARNINGS  += -Wno-unknown-pragmas
584 else   # STL on Solaris with cast-align generates a warning with much output
585 COMMONWARNINGS       += -Wcast-align
586 USEFULWARNINGS       += -Wcast-align
587 endif
588 endif # SILENCE_WARNINGS
589
590
591 ifndef GCC_2_95
592 GCC_VER := $(shell gcc --version)
593 ifneq (,$(findstring 2.95,$(GCC_VER)))
594 GCC_2_95 = true
595 endif
596 endif
597
598 ifndef OLD_GCC
599 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
600 versionNumbers = $(sort $(GCC_VER) 2.95)
601 versionNumber  = $(firstword $(versionNumbers))
602 ifneq (2.95, $(versionNumber))
603 OLD_GCC = true
604 endif
605 endif
606
607 ifndef OLD_GCC
608 COMMONWARNINGS += -Wno-non-template-friend
609 USEFULWARNINGS += -Wno-non-template-friend
610 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
611 endif
612
613 #don't inline -- for the files that won't emit template code
614 INLINE_DEFINES = 
615
616 #inline the private members of the class -- templates.o can use this
617 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
618
619 # inline everything -- the way things should be
620 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
621
622
623 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
624 USES_LIBDYNINST_SO = true
625 endif
626 ifeq (linux,$(findstring linux,$(PLATFORM)))
627 USES_LIBDYNINST_SO = true
628 endif
629
630 # Set this variable if it's desired that dyninst be built with the native
631 # compiler on Solaris
632 SOLARIS_NATIVE =  #1
633
634 ifdef SOLARIS_NATIVE
635 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
636 USES_LIBDYNINST_SO = true
637 USES_NATIVE_CC = true
638 NATIVE_CC      = cc
639 NATIVE_CXX     = CC
640 endif
641 endif
642
643 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
644 ifndef IBM_BPATCH_COMPAT
645   USES_LIBDYNINST_SO = true
646 endif
647
648 USES_PERF_LIBRARY = true
649 # No longer used, because of relocation.
650 #USES_LIB_TEXT_HEAP = true
651
652 ifdef IBM_BPATCH_COMPAT
653   ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
654     USES_NATIVE_CC = true
655     NATIVE_CC = xlc
656     NATIVE_CXX = xlC
657     DEPCC = xlC
658     DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
659   endif
660 endif
661
662 # As of AIX 5, the pm_init function in libpmapi takes more
663 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
664 # and handled in the paradyn runtime library
665 PMAPI_VERSION := $(shell uname -v )
666 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
667 USES_PMAPI_GROUPS = true
668 endif
669 endif
670
671 ifndef STATIC_COMPS
672 ifndef USES_NATIVE_CC
673 ifneq ($(SUITE_NAME),testsuite)
674 MYFLAGS += -fPIC
675 endif
676 endif
677 endif
678
679 # if we don't want OPT_FLAG defined for a particular part of the code
680 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
681 # the include of make.config - naim
682 ifndef NO_OPT_FLAG
683 OPT_FLAG        = -O2
684 endif
685
686 VERBOSE_COMPILATION     = true
687
688 # Do we shorten compile lines?
689 ifndef VERBOSE_COMPILATION
690 HIDE_COMP       = @
691 endif
692
693 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
694     ARCH_FLAGS   = -maix64 -Drs6000_ibm_aix64
695 endif
696
697 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
698     ARCH_FLAGS = -m64
699 endif
700
701 # flags for normal (non-kludge) files, with common warnings
702 CFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
703 CXXFLAGS        = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
704 LDFLAGS         = $(ARCH_FLAGS)
705
706 # flags for kludge files, won't have warnings generated
707 KFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
708
709 ifdef COVERAGE
710
711 CFLAGS += -fprofile-arcs -ftest-coverage
712 CXXFLAGS += -fprofile-arcs -ftest-coverage
713 LDFLAGS += -fprofile-arcs -ftest-coverage
714
715 endif
716
717 ifdef USING_PURIFY
718 CFLAGS          += -DPURE_BUILD
719 CXXFLAGS        += -DPURE_BUILD
720 endif
721
722 ifdef USES_PERF_LIBRARY
723 # Add any platform-specific performance libraries here
724 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
725 USES_PMAPI = true
726 CFLAGS          += -DUSES_PMAPI
727 CXXFLAGS        += -DUSES_PMAPI
728 LDFLAGS         += -lpmapi
729 ifdef USES_PMAPI_GROUPS
730 CFLAGS          += -DPMAPI_GROUPS
731 CXXFLAGS        += -DPMAPI_GROUPS
732 endif # USES_PMAPI_GROUPS
733 endif # ibm-aix
734 endif # perf_library
735
736 ifdef USE_DEPRECATED_BPATCH_VECTOR
737 CXXFLAGS        += -DUSE_DEPRECATED_BPATCH_VECTOR
738 CFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
739 TFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
740 else
741 #CFLAGS        += -fimplicit-templates
742 CXXFLAGS        += -fimplicit-templates
743 TFLAGS        += -fimplicit-templates
744 endif
745
746 ifndef STATIC_COMPS 
747 SONAME_FLAGS = -Wl,-soname,$(TARGET).$(RELEASE_NUM)
748 endif
749
750 ifdef IBM_BPATCH_COMPAT
751 CXXFLAGS        += -DIBM_BPATCH_COMPAT
752 CFLAGS          += -DIBM_BPATCH_COMPAT
753 endif
754
755 ifndef OPT_FLAG
756 KFLAGS          += -g
757 DEBUG_FLAG = -g
758 endif
759
760 ifeq ($(DEBUG_FLAG),none)
761 DEBUG_FLAG =
762 endif
763
764 ifdef DEBUG_FLAG
765 CFLAGS   += $(DEBUG_FLAG)
766 CXXFLAGS += $(DEBUG_FLAG)
767 KFLAGS   += $(DEBUG_FLAG)
768 endif
769
770 ifdef VERBOSE_CFG_ACCOUNTING
771 CFLAGS   += -DVERBOSE_CFG_FACTORY
772 CXXFLAGS += -DVERBOSE_CFG_FACTORY
773 endif
774
775 # flags for template files, don't define external template flags
776 # -g is optional in this case -- should be defined at module level
777 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
778
779 ifdef DO_INLINE_ALL
780 CFLAGS         += $(ALL_INLINE_DEFINES)
781 CXXFLAGS       += $(ALL_INLINE_DEFINES)
782 endif
783
784 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
785 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
786 LIBDIR          = $(FIRST_LIBDIR) \
787                  -L$(TO_CORE)/../$(PLATFORM)/lib 
788
789 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
790 # else set it to just "igen" (i.e. assume it's in the user's path)
791 ifdef CROSSCOMPILER
792 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 )
793 else
794 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 )
795 endif
796
797 ifdef NO_IMPLICIT_TEMPLATES
798 ifdef USE_DEPRECATED_BPATCH_VECTOR
799 #  CFLAGS               += -fno-implicit-templates
800   CXXFLAGS      += -fno-implicit-templates
801   KFLAGS                += -fno-implicit-templates
802 endif
803 endif
804
805 ifndef INSTANTIATE_TEMPLATES
806 ifndef NO_IMPLICIT_TEMPLATES
807 # -fexternal-templates and -Dexternal_templates should both be used or
808 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
809 # (but not to TFLAGS).
810 #
811 #CFLAGS         +=  -fexternal-templates -Dexternal_templates
812 #CXXFLAGS       +=  -fexternal-templates -Dexternal_templates
813 #KFLAGS         +=  -fexternal-templates -Dexternal_templates
814 endif
815 endif
816
817 THREADSLIB      =
818 USE_PTHREADS    = yes
819
820 ifeq (xyes,x$(USE_PTHREADS))
821 THREADSLIB      += -lpthread
822
823 # On Linux, programs using pthreads are supposed to define _REENTRANT
824 ifeq (linux,$(findstring linux,$(PLATFORM)))
825 CFLAGS                  += -D_REENTRANT=1
826 CXXFLAGS                += -D_REENTRANT=1
827 KFLAGS                  += -D_REENTRANT=1
828 TFLAGS                  += -D_REENTRANT=1
829 endif
830
831 # Ditto for FreeBSD
832 ifeq (freebsd,$(findstring freebsd,$(PLATFORM)))
833 CFLAGS                  += -D_REENTRANT=1
834 CXXFLAGS                += -D_REENTRANT=1
835 KFLAGS                  += -D_REENTRANT=1
836 TFLAGS                  += -D_REENTRANT=1
837 endif
838
839 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
840 #CFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
841 #CXXFLAGS               += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
842 #KFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
843 #TFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
844 endif
845
846 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
847 CFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
848 CXXFLAGS                += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
849 KFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
850 TFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
851 endif
852
853 endif
854
855 # System build constraints
856 #Build the MT daemon on AIX, Solaris, and Linux/x86
857 DONT_BUILD_PD_MT = true
858 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
859 DONT_BUILD_PD_MT =
860 endif
861 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
862 DONT_BUILD_PD_MT =
863 endif
864 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
865 DONT_BUILD_PD_MT =
866 endif
867
868 ifeq (ppc32_bgp,$(findstring ppc32_bgp,$(PLATFORM)))
869 DONT_BUILD_NEWTESTSUITE = true
870 endif
871 ifdef USES_MMTIMER
872 CFLAGS             += -Dcap_mmtimer
873 CXXFLAGS           += -Dcap_mmtimer
874 endif
875
876 ifdef USES_UNWIND_LIB
877 CFLAGS         += -Dcap_unwind
878 CXXFLAGS       += -Dcap_unwind 
879 LIBUNWIND_LIB  ?= $(LIBUNWINDDIR)/lib
880 LIBUNWIND_INC  ?= $(LIBUNWINDDIR)/include
881 endif
882
883 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
884 LIBELF_PLATFORM = "true"
885 LIBDWARF_PLATFORM = "true"
886 endif
887 ifeq (linux,$(findstring linux,$(PLATFORM)))
888 LIBELF_PLATFORM = "true"
889 LIBDWARF_PLATFORM = "true"
890 endif
891 ifeq (freebsd,$(findstring freebsd,$(PLATFORM)))
892 LIBELF_PLATFORM = "true"
893 LIBDWARF_PLATFORM = "true"
894 endif
895 ifeq (vxworks,$(findstring vxworks,$(PLATFORM)))
896 LIBELF_PLATFORM = "true"
897 LIBDWARF_PLATFORM = "true"
898 endif
899 ifeq (_bgq,$(findstring _bgq,$(PLATFORM)))
900 LIBELF_PLATFORM = "true"
901 LIBDWARF_PLATFORM = "true"
902 endif
903 ifeq (_bgp,$(findstring _bgp,$(PLATFORM)))
904 LIBELF_PLATFORM = "true"
905 LIBDWARF_PLATFORM = "true"
906 endif
907 ifeq (_bgl,$(findstring _bgl,$(PLATFORM)))
908 LIBELF_PLATFORM = "true"
909 LIBDWARF_PLATFORM = "true"
910 endif
911 ifeq (_cnl,$(findstring _cnl,$(PLATFORM)))
912 LIBELF_PLATFORM = "true"
913 LIBDWARF_PLATFORM = "true"
914 endif
915
916 ifdef HAVE_NATIVE_DEMANGLER
917 LDFLAGS += -ldemangle
918 CAP_DEF += -Dcap_native_demangler
919 endif
920
921 ifdef GNU_DEMANGLER
922 CAP_DEF += -Dcap_gnu_demangler
923 endif
924
925 ifdef USE_LIBERTY
926 CAP_DEF += -Dcap_liberty
927 ifdef LINK_LIBERTY
928 ifdef LIBIBERTY_LIB
929 DEMANGLER_LINK = -L$(LIBIBERTY_LIB) -liberty
930 else
931 DEMANGLER_LINK = -liberty
932 endif
933 else
934 CAP_DEF += -Dcap_liberty_exec
935 ifdef LIBIBERTY_LIB
936 DEMANGLER_EXEC_LINK = -L$(LIBIBERTY_LIB) -liberty
937 else
938 DEMANGLER_EXEC_LINK = -liberty
939 endif
940 endif
941 endif
942
943 ifdef USES_FLEX
944 ifdef FLEX_DIR
945 WITHLIBFL       = --with-libfldir=$(FLEX_DIR)
946 else
947 WITHLIBFL       =
948 endif
949 endif
950
951 #Build other variables based off of the above defaults
952
953 ifdef USES_TCLTK
954 # use the first set if using tcl8.4,
955 # use the second set if still using tcl8.3
956 ifndef USE_TCL83
957
958 TCLTK_LIBVER_ID = 8.4
959 CFLAGS      += -DTCLCONST=const
960 CXXFLAGS    += -DTCLCONST=const
961 KFLAGS      += -DTCLCONST=const
962 TFLAGS      += -DTCLCONST=const
963
964 else
965
966 TCLTK_LIBVER_ID = 8.3
967 CFLAGS      += -DTCLCONST=""
968 CXXFLAGS    += -DTCLCONST=""
969 KFLAGS      += -DTCLCONST=""
970 TFLAGS      += -DTCLCONST=""
971
972 endif
973
974 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
975 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
976
977 ifdef LIBTCLTKSTATIC
978 TCLTK_LIBS      += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
979 else
980 TCLTK_LIBS      += $(TCL_LIB) $(TK_LIB)
981 endif
982
983 # TCL2C is used to generate compilable sources from tcl files
984 TCL2C           = $(TO_CORE)/../scripts/tcl2c
985 TCL2C_GEN_SRCS  = tcl2c.C
986
987 IFLAGS          += -I$(TCLTK_INC_DIR)
988 ifdef CROSSCOMPILER
989 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
990 else
991 LIBDIR      += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
992 endif
993
994 endif # USES_TCLTK
995
996 ifdef USES_PAPI
997 PAPI_INCDIR     = $(PAPI_ROOT)
998 PAPI_LIBDIR     = $(PAPI_ROOT)
999 #PAPI_LIB       = -Wl,-static -lpapi -Wl,-Bdynamic
1000 #PAPI_LIB       = $(PAPI_LIBDIR)/libpapi.a
1001 PAPI_LIB        = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi  
1002 IFLAGS          += -I$(PAPI_INCDIR)
1003 LIBDIR          += $(patsubst %,-L%,$(PAPI_LIBDIR))
1004 CFLAGS          += -DPAPI 
1005 CXXFLAGS        += -DPAPI
1006 TFLAGS          += -DPAPI 
1007 endif
1008
1009 ifdef USES_FLEX
1010 FLEX_LIB        = -lfl
1011 ifdef FLEX_DIR
1012 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
1013 VPATH           += $(FLEX_DIR)
1014 endif
1015 endif
1016
1017 ifdef CROSSCOMPILER
1018 # no /s or /p allowed here
1019 #FLEX_DIR       = /s/flex/rs_aix41/lib
1020 #LIBDIR         += -L/p/sp2/gcc/lib 
1021 endif
1022
1023 ifdef LIBDWARF_HASSETFRAME
1024         CAP_DEF += -Ddwarf_has_setframe
1025 endif
1026
1027 ifdef USES_X11
1028 X11_LIB         = -lX11
1029
1030 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
1031 X11DIR          = /usr/openwin
1032 CFLAGS          += -I$(X11DIR)/include
1033 CXXFLAGS        += -I$(X11DIR)/include
1034 TFLAGS          += -I$(X11DIR)/include
1035 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
1036 endif
1037
1038 ifeq (linux,$(findstring linux,$(PLATFORM)))
1039 X11DIR          = /usr/X11R6
1040 CFLAGS          += -I$(X11DIR)/include/X11
1041 CXXFLAGS        += -I$(X11DIR)/include/X11
1042 TFLAGS          += -I$(X11DIR)/include/X11
1043 LIBDIR          += -L$(X11DIR)/lib
1044 endif
1045
1046 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
1047 LIBDIR          += -L$(X11DIR)/lib64
1048 endif
1049 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
1050 X11DIR          = /usr
1051 endif
1052
1053 endif # USES_X11
1054
1055
1056 #End with the default target, prereqs specified elsewhere
1057 all: