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