Updates various textual references to reflect the core directory name change.
[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     = 5.2
9
10 #BUILD_MARK     =
11 EXPLICIT_DEPENDS = 1
12 #USE_DEPRECATED_BPATCH_VECTOR   = 1
13 #IBM_BPATCH_COMPAT = 1
14 # Apart from actual "full" releases, don't modify these build Id components.
15 # For personal/experimental builds, feel free to use your 
16 # dyninst/make.config.local file to (re-)define BUILD_MARK as you desire.
17
18 # most "main" modules are only two levels deep, but we need to be able to
19 # change this for those that are deeper in the tree
20 ifndef TO_CORE
21 TO_CORE         = ../..
22 endif
23 TO_SCRIPTS = $(TO_CORE)/../scripts
24
25 # If the PLATFORM environment variable isn't set, we'll try to figure it out.
26 ifndef PLATFORM
27 SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi )
28 ifdef SNAME
29 CURPLAT = $(shell ${SNAME})
30
31 # IA64/Linux, i386/Linux, x86-64/Linux, ppc/Linux
32 ifneq (,$(findstring linux,$(CURPLAT)))
33
34 ifneq (,$(findstring ia64,$(CURPLAT)))
35 PLATFORM = ia64-unknown-linux2.4
36 endif 
37 ifneq (,$(findstring i686,$(CURPLAT)))
38 PLATFORM = i386-unknown-linux2.4
39 endif
40 ifneq (,$(findstring i586,$(CURPLAT)))
41 PLATFORM = i386-unknown-linux2.4
42 endif
43 ifneq (,$(findstring i486,$(CURPLAT)))
44 PLATFORM = i386-unknown-linux2.4
45 endif
46 ifneq (,$(findstring i386,$(CURPLAT)))
47 PLATFORM = i386-unknown-linux2.4
48 endif
49 ifneq (,$(findstring x86_64,$(CURPLAT)))
50 PLATFORM = x86_64-unknown-linux2.4
51 endif
52 ifneq (,$(findstring, ppc64,$(CURPLAT)))
53 PLATFORM = ppc64_linux
54 endif
55
56 endif
57
58 # AIX
59 ifneq (,$(findstring aix,$(CURPLAT)))
60 PLATFORM = rs6000-ibm-aix5.1
61 endif
62 # Solaris
63 ifneq (,$(findstring solaris,$(CURPLAT)))
64 PLATFORM = sparc-sun-solaris2.8
65 endif
66 # Irix
67 ifneq (,$(findstring irix,$(CURPLAT)))
68 PLATFORM = mips-sgi-irix6.5
69 endif
70 ifneq (,$(findstring osf,$(CURPLAT)))
71 PLATFORM = alpha-dec-osf5.1
72 endif
73
74 endif
75 endif
76
77 ifndef PLATFORM
78 $(error Could not determine you current platform.  Please set your PLATFORM environment variable to whichever closest matches your platform:  alpha-dec-osf5.1 i386-unknown-linux2.4 i386-unknown-nt4.0 ia64-unknown-linux2.4 x86_64-unknown-linux2.4 mips-sgi-irix6.5 rs6000-ibm-aix5.1 rs6000-ibm-aix64-5.2 sparc-sun-solaris2.8 )
79 endif
80
81 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
82
83 # Include any per-user configuration changes; this "local" config file
84 # should *not* be under CVS control, so that it never gets committed.
85 -include $(TO_CORE)/make.config.local
86
87 # Choose default development directories if necessary variables are unset
88
89
90
91 # Destinations for library and executable installation (relative to "dyninst"!)
92 # Warning: modification of the build/install structure is not recommended!
93 LIBRARY_DEST    ?= ${TO_CORE}/../${PLATFORM}/lib
94 PROGRAM_DEST    ?= ${TO_CORE}/../${PLATFORM}/bin
95 INCLUDE_DEST   ?= ${TO_CORE}/../include
96
97 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
98 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
99 # with cvs), then we should look in a backup location.  That's what this vrble
100 # is about.  It's used several times below in this file.
101 GCC      ?= gcc
102 GXX      ?= g++
103 LINKER   = ld
104 AS              = as
105 CC       ?= $(GCC)
106 CXX      ?= $(GXX)
107 LEX      = flex
108 RANLIB   = ranlib
109 AR       = ar
110 YFLAGS   = -d -y
111 YACC     = bison
112 MV       = mv
113 CP       = cp
114 RM       = rm -f
115 LN       = ln -s
116 MKDIR           = mkdir -p
117 CHMOD    = chmod
118 PERL            = perl          # NB: perl v5 or higher required!
119
120 # COLLECTOR is only used by purify & quantify
121 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
122 # BUILDSTAMP is used to generate local build vouchers
123 BUILDSTAMP      = $(TO_CORE)/../scripts/buildstamp
124
125 ifndef PLATFORM
126 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
127 endif
128
129 # Define all tags based on the platform string. When a new platform
130 # is added, add it to the list
131
132 #
133 # Brief description of -Ds:
134 #
135 # CAP
136 # cap_save_the_world: support for creating a patched binary
137 # cap_relocation: function relocation
138 # cap_stripped_binaries: recursive parsing and function discovery without symbols
139 # cap_async_events: 
140 # cap_ptrace: uses ptrace interface
141 # cap_proc: uses /proc interface
142 # cap_proc_ioctl: uses ioctl interface to proc
143 # cap_proc_fd: uses solaris-style multiple-fd proc interface
144 # cap_threads: support for threaded applications
145 # cap_dynamic_heap: support for a dynamically growing inferior heap
146 # cap_threaded_times: (Linux only) times() returns per-thread information.
147 # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call.
148 # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature
149 # cap_32_64: platforms that support 32- and 64-bit mutatees
150 # cap_liveness: liveness analysis
151 # cap_fixpoint_gen: Generate code using a fixpoint method that saves space
152 # cap_noaddr_gen: Allow code generation before determining the address code is going into
153 # cap_mutatee_traps: Traps can be handled mutatee side
154 # cap_instruction_api: System uses instruction API
155 # cap_registers: User can access registers in snippets
156 # cap_instruction_replacement: we use the replaceCode concept to implement (e.g.,) function call replacement
157 #
158 # BUG
159 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
160 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
161 #   the change occurs within a system call; reported by SGI.
162
163 ifeq ($(PLATFORM),i386-unknown-linux2.4)
164 OLD_DEF     = -Di386_unknown_linux2_0
165 ARCH_DEF    = -Darch_x86
166 OS_DEF      = -Dos_linux
167 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dno_cap_serialization -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts
168 BUG_DEF     = -Dbug_syscall_changepc_rewind
169 endif
170
171 ifeq ($(PLATFORM),i386-unknown-linux2.6)
172 OLD_DEF     = -Di386_unknown_linux2_0
173 ARCH_DEF    = -Darch_x86
174 OS_DEF      = -Dos_linux
175 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_stackwalker_use_symtab
176 BUG_DEF     = -Dbug_syscall_changepc_rewind
177 endif
178
179 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
180 OLD_DEF     = -Dx86_64_unknown_linux2_4
181 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
182 OS_DEF      = -Dos_linux
183 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_stackwalker_use_symtab
184 BUG_DEF     = -Dbug_syscall_changepc_rewind
185 endif
186
187 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
188 OLD_DEF     = -Dia64_unknown_linux2_4
189 ARCH_DEF    = -Darch_ia64 -Darch_64bit
190 OS_DEF      = -Dos_linux
191 CAP_DEF     = -Dcap_ptrace -Dcap_async_events -Dcap_unwind -Dcap_dynamic_heap -Dcap_threads -Dcap_dwarf -Dno_cap_serialization -Dcap_stackwalker_use_symtab
192 BUG_DEF     =
193 endif
194
195 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
196 OLD_DEF     = -Dsparc_sun_solaris2_4
197 ARCH_DEF    = -Darch_sparc
198 OS_DEF      = -Dos_solaris
199 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf -Dcap_syscall_trap -Dcap_slicing -Dno_cap_serialization
200 BUG_DEF     =
201 endif
202
203 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
204 OLD_DEF     = -Dsparc_sun_solaris2_4
205 ARCH_DEF    = -Darch_sparc
206 OS_DEF      = -Dos_solaris
207 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf -Dcap_syscall_trap -Dcap_slicing -Dno_cap_serialization
208 BUG_DEF     =
209 endif
210
211 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
212 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
213 ARCH_DEF    = -Darch_power
214 OS_DEF      = -Dos_aix
215 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap -Dcap_liveness -Dcap_use_pdvector -Dno_cap_serialization -Dcap_registers -Dcap_instruction_replacement
216 BUG_DEF     = 
217 endif
218
219 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
220 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
221 ARCH_DEF    = -Darch_power -Darch_64bit
222 OS_DEF      = -Dos_aix
223 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap -Dcap_32_64 -Dcap_liveness -Dcap_use_pdvector -Dno_cap_serialization -Dcap_registers -Dcap_instruction_replacement
224 BUG_DEF     = 
225 endif
226
227 ifeq ($(PLATFORM),ppc64_linux)
228 OLD_DEF     = -Dppc64_linux
229 ARCH_DEF    = -Darch_power -Darch_64bit
230 OS_DEF      = -Dos_linux
231 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_32_64 -Dno_cap_serialization -Dcap_registers -Dcap_instruction_replacement
232 BUG_DEF     = -Dbug_syscall_changepc_rewind
233 endif
234
235 ifeq ($(PLATFORM),ppc32_linux)
236 OLD_DEF     = -Dppc32_linux
237 ARCH_DEF    = -Darch_power
238 OS_DEF      = -Dos_linux
239 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dno_cap_serialization -Dcap_registers -Dcap_stackwalker_use_symtab -Dcap_instruction_replacement
240 BUG_DEF     = -Dbug_syscall_changepc_rewind
241 endif
242
243 ifeq ($(PLATFORM),ppc32_bluegene)
244 OLD_DEF     = -Dppc32_bluegene
245 ARCH_DEF    = -Darch_power
246 OS_DEF      = -Dos_bluegene
247 CAP_DEF     = -Dcap_dwarf -Dcap_stackwalker_use_symtab
248 BUG_DEF     = 
249 endif
250
251 ifeq ($(PLATFORM),ppc32_bgcompute)
252 OLD_DEF     = -Dppc32_bluegene
253 ARCH_DEF    = -Darch_power
254 OS_DEF      = -Dos_bgcompute
255 CAP_DEF     = -Dcap_dwarf
256 BUG_DEF     = 
257 endif
258
259 ifeq ($(PLATFORM),x86_64_catamount)
260 OLD_DEF     = -Dx86_64_catamount
261 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
262 OS_DEF      = -Dos_catamount
263 CAP_DEF     = -Dcap_dwarf
264 BUG_DEF     = 
265 endif
266 ifeq ($(PLATFORM),x86_64_cnl)
267 OLD_DEF     = -Dx86_64_cnl
268 ARCH_DEF    = -Darch_x86_64 -Darch_64bit
269 OS_DEF      = -Dos_linux -Dos_cnl
270 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_stackwalker_use_symtab
271 BUG_DEF     = -Dbug_syscall_changepc_rewind
272 endif
273 #
274
275 # Combine all the #defines for ease of use
276 UNIFIED_DEF     = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) $(AC_DEF)
277 UNIFIED_TEST_DEF        = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
278
279 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
280 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
281 AS              = /usr/ccs/bin/as
282 RANLIB          = true
283 endif
284
285 ifeq (linux,$(findstring linux,$(OS_DEF)))
286 AS              = /usr/bin/as
287 RANLIB          = true 
288 ASFLAGS         =
289 else
290 ASFLAGS         = -P $(UNIFIED_DEF) 
291 endif 
292
293 # set the macros that control whether the stdint limit and constant
294 # macros are defined for C++ on the compilers command line so that
295 # we don't have to worry about the ordering of #includes.
296 ifeq (linux,$(findstring linux,$(PLATFORM)))
297 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
298 else
299 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
300 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
301 else
302 STDINT_MACROS   = 
303 endif
304 endif
305
306 # Default module compiler; modules which want $(CC) should redefine
307 # this, **NOT** CC
308
309 MODCC           = $(CXX)
310 MODCFLAGS       = $(CXXFLAGS)
311 DEPCC       = $(MODCC)
312
313 .SUFFIXES:      .I
314
315 # Added dyninst/external for included external dependencies - bernat, 11JUN07
316 IFLAGS          = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/external -I$(TO_CORE)/dynutil/h
317
318 # uncomment/comment the line below to build with/without compilation warnings
319 # SILENCE_WARNINGS=true
320
321 ifndef SILENCE_WARNINGS
322 BASICWARNINGS   = -W -Wall
323
324 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
325                 -Wcast-qual            \
326                 -Wredundant-decls -Woverloaded-virtual
327
328 # not as strict as above, but can actually be used -- mdc
329 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
330                 -Wcast-qual            \
331                 -Woverloaded-virtual
332
333 # being nice to poor old pathetic tcl/tk header files --ari
334 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
335                 -Wcast-qual \
336                 -Woverloaded-virtual
337
338 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
339 COMMONWARNINGS       += -Wno-unknown-pragmas
340 USEFULWARNINGS       += -Wno-unknown-pragmas
341 TCLFRIENDLYWARNINGS  += -Wno-unknown-pragmas
342 else   # STL on Solaris with cast-align generates a warning with much output
343 COMMONWARNINGS       += -Wcast-align
344 USEFULWARNINGS       += -Wcast-align
345 endif
346 endif # SILENCE_WARNINGS
347
348
349 ifndef GCC_2_95
350 GCC_VER := $(shell gcc --version)
351 ifneq (,$(findstring 2.95,$(GCC_VER)))
352 GCC_2_95 = true
353 endif
354 endif
355
356 ifndef OLD_GCC
357 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
358 versionNumbers = $(sort $(GCC_VER) 2.95)
359 versionNumber  = $(firstword $(versionNumbers))
360 ifneq (2.95, $(versionNumber))
361 OLD_GCC = true
362 endif
363 endif
364
365 ifndef OLD_GCC
366 COMMONWARNINGS += -Wno-non-template-friend
367 USEFULWARNINGS += -Wno-non-template-friend
368 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
369 endif
370
371 #don't inline -- for the files that won't emit template code
372 INLINE_DEFINES = 
373
374 #inline the private members of the class -- templates.o can use this
375 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
376
377 # inline everything -- the way things should be
378 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
379
380
381 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
382 USES_LIBDYNINST_SO = true
383 endif
384 ifeq (linux,$(findstring linux,$(PLATFORM)))
385 USES_LIBDYNINST_SO = true
386 endif
387
388 # Set this variable if it's desired that dyninst be built with the native
389 # compiler on Solaris
390 SOLARIS_NATIVE =  #1
391
392 ifdef SOLARIS_NATIVE
393 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
394 USES_LIBDYNINST_SO = true
395 USES_NATIVE_CC = true
396 NATIVE_CC      = cc
397 NATIVE_CXX     = CC
398 endif
399 endif
400
401 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
402 ifndef IBM_BPATCH_COMPAT
403   USES_LIBDYNINST_SO = true
404 endif
405
406 USES_PERF_LIBRARY = true
407 # No longer used, because of relocation.
408 #USES_LIB_TEXT_HEAP = true
409
410 ifdef IBM_BPATCH_COMPAT
411   ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
412     USES_NATIVE_CC = true
413     NATIVE_CC = xlc
414     NATIVE_CXX = xlC
415     DEPCC = xlC
416     DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
417   endif
418 endif
419
420 # As of AIX 5, the pm_init function in libpmapi takes more
421 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
422 # and handled in the paradyn runtime library
423 PMAPI_VERSION := $(shell uname -v )
424 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
425 USES_PMAPI_GROUPS = true
426 endif
427 endif
428
429 # if we don't want OPT_FLAG defined for a particular part of the code
430 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
431 # the include of make.config - naim
432 ifndef NO_OPT_FLAG
433 OPT_FLAG        = -O2
434 endif
435
436 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
437     ARCH_FLAGS   = -maix64 -Drs6000_ibm_aix64
438 endif
439
440 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
441     ARCH_FLAGS = -m64
442 endif
443
444 # flags for normal (non-kludge) files, with common warnings
445 CFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
446 CXXFLAGS        = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
447 LDFLAGS         = $(ARCH_FLAGS)
448
449 # flags for kludge files, won't have warnings generated
450 KFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
451
452 ifdef COVERAGE
453
454 CFLAGS += -fprofile-arcs -ftest-coverage
455 CXXFLAGS += -fprofile-arcs -ftest-coverage
456 LDFLAGS += -fprofile-arcs -ftest-coverage
457
458 endif
459
460 ifdef USING_PURIFY
461 CFLAGS          += -DPURE_BUILD
462 CXXFLAGS        += -DPURE_BUILD
463 endif
464
465 ifdef USES_PERF_LIBRARY
466 # Add any platform-specific performance libraries here
467 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
468 USES_PMAPI = true
469 CFLAGS          += -DUSES_PMAPI
470 CXXFLAGS        += -DUSES_PMAPI
471 LDFLAGS         += -lpmapi
472 ifdef USES_PMAPI_GROUPS
473 CFLAGS          += -DPMAPI_GROUPS
474 CXXFLAGS        += -DPMAPI_GROUPS
475 endif # USES_PMAPI_GROUPS
476 endif # ibm-aix
477 endif # perf_library
478
479 ifdef USE_DEPRECATED_BPATCH_VECTOR
480 CXXFLAGS        += -DUSE_DEPRECATED_BPATCH_VECTOR
481 CFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
482 TFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
483 else
484 #CFLAGS        += -fimplicit-templates
485 CXXFLAGS        += -fimplicit-templates
486 TFLAGS        += -fimplicit-templates
487 endif
488
489 ifdef IBM_BPATCH_COMPAT
490 CXXFLAGS        += -DIBM_BPATCH_COMPAT
491 CFLAGS          += -DIBM_BPATCH_COMPAT
492 endif
493
494 ifndef OPT_FLAG
495 KFLAGS          += -g
496 DEBUG_FLAG = -g
497 endif
498
499 ifeq ($(DEBUG_FLAG),none)
500 DEBUG_FLAG =
501 endif
502
503 ifdef DEBUG_FLAG
504 CFLAGS   += $(DEBUG_FLAG)
505 CXXFLAGS += $(DEBUG_FLAG)
506 KFLAGS   += $(DEBUG_FLAG)
507 endif
508
509 # flags for template files, don't define external template flags
510 # -g is optional in this case -- should be defined at module level
511 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
512
513 ifdef DO_INLINE_ALL
514 CFLAGS         += $(ALL_INLINE_DEFINES)
515 CXXFLAGS       += $(ALL_INLINE_DEFINES)
516 endif
517
518 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
519 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
520 LIBDIR          = $(FIRST_LIBDIR) \
521                  -L$(TO_CORE)/../$(PLATFORM)/lib 
522
523 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
524 # else set it to just "igen" (i.e. assume it's in the user's path)
525 ifdef CROSSCOMPILER
526 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 )
527 else
528 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 )
529 endif
530
531 ifdef NO_IMPLICIT_TEMPLATES
532 ifdef USE_DEPRECATED_BPATCH_VECTOR
533 #  CFLAGS               += -fno-implicit-templates
534   CXXFLAGS      += -fno-implicit-templates
535   KFLAGS                += -fno-implicit-templates
536 endif
537 endif
538
539 ifndef INSTANTIATE_TEMPLATES
540 ifndef NO_IMPLICIT_TEMPLATES
541 # -fexternal-templates and -Dexternal_templates should both be used or
542 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
543 # (but not to TFLAGS).
544 #
545 #CFLAGS         +=  -fexternal-templates -Dexternal_templates
546 #CXXFLAGS       +=  -fexternal-templates -Dexternal_templates
547 #KFLAGS         +=  -fexternal-templates -Dexternal_templates
548 endif
549 endif
550
551 THREADSLIB      =
552 USE_PTHREADS    = yes
553
554 ifeq (xyes,x$(USE_PTHREADS))
555 THREADSLIB      += -lpthread
556
557 # On Linux, programs using pthreads are supposed to define _REENTRANT
558 ifeq (linux,$(findstring linux,$(PLATFORM)))
559 CFLAGS                  += -D_REENTRANT=1
560 CXXFLAGS                += -D_REENTRANT=1
561 KFLAGS                  += -D_REENTRANT=1
562 TFLAGS                  += -D_REENTRANT=1
563 endif
564
565 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
566 #CFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
567 #CXXFLAGS               += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
568 #KFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
569 #TFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
570 endif
571
572 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
573 CFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
574 CXXFLAGS                += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
575 KFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
576 TFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
577 endif
578
579 endif
580
581 # System build constraints
582 #Build the MT daemon on AIX, Solaris, and Linux/x86
583 DONT_BUILD_PD_MT = true
584 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
585 DONT_BUILD_PD_MT =
586 endif
587 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
588 DONT_BUILD_PD_MT =
589 endif
590 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
591 DONT_BUILD_PD_MT =
592 endif
593
594 # Build newtestsuite on i386, x86_64 and ia64 linux
595 #DONT_BUILD_NEWTESTSUITE = true
596 #ifeq (i386-unknown-linux,$(findstring i386-unknown-linux,$(PLATFORM)))
597 #DONT_BUILD_NEWTESTSUITE = false
598 #endif
599 #ifeq (ia64-unknown-linux,$(findstring ia64-unknown-linux,$(PLATFORM)))
600 #DONT_BUILD_NEWTESTSUITE = false
601 #endif
602 #ifeq (x86_64-unknown-linux,$(findstring x86_64-unknown-linux,$(PLATFORM)))
603 #DONT_BUILD_NEWTESTSUITE = false
604 #endif
605 #ifeq (ppc32_linux,$(findstring ppc32_linux,$(PLATFORM)))
606 #DONT_BUILD_NEWTESTSUITE = false
607 #endif
608 #ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
609 #DONT_BUILD_NEWTESTSUITE = false
610 #endif
611 #ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
612 #DONT_BUILD_NEWTESTSUITE = false
613 #endif
614
615 ifdef USES_MMTIMER
616 CFLAGS             += -Dcap_mmtimer
617 CXXFLAGS           += -Dcap_mmtimer
618 endif
619
620 ifdef USES_TCLTK
621 ifndef TCLTK_DIR
622 $(error error: TCLTK_DIR is not set.  Please set in make.config.local)
623 endif
624 TCLTK_LIB_DIR  ?= $(TCLTK_DIR)/lib
625 TCLTK_INC_DIR  ?= $(TCLTK_DIR)/include
626 endif
627
628 ifdef USES_UNWIND_LIB
629 CFLAGS         += -Dcap_unwind
630 CXXFLAGS       += -Dcap_unwind 
631 LIBUNWIND_LIB  ?= $(LIBUNWINDDIR)/lib
632 LIBUNWIND_INC  ?= $(LIBUNWINDDIR)/include
633 endif
634
635 ifdef USES_DWARF_DEBUG
636 LIBDWARF_INC   ?= $(LIBDWARFDIR)/include
637 LIBDWARF_LIB   ?= $(LIBDWARFDIR)/lib
638 endif
639
640 ifdef USES_LIBELF
641 LIBELF_INC     ?= $(LIBELFDIR)/include
642 LIBELF_LIB     ?= $(LIBELFDIR)/lib
643 endif
644
645 ifdef USES_FLEX
646 ifdef FLEX_DIR
647 WITHLIBFL       = --with-libfldir=$(FLEX_DIR)
648 else
649 WITHLIBFL       =
650 endif
651 endif
652
653 #Build other variables based off of the above defaults
654
655 ifdef USES_TCLTK
656 # use the first set if using tcl8.4,
657 # use the second set if still using tcl8.3
658 ifndef USE_TCL83
659
660 TCLTK_LIBVER_ID = 8.4
661 CFLAGS      += -DTCLCONST=const
662 CXXFLAGS    += -DTCLCONST=const
663 KFLAGS      += -DTCLCONST=const
664 TFLAGS      += -DTCLCONST=const
665
666 else
667
668 TCLTK_LIBVER_ID = 8.3
669 CFLAGS      += -DTCLCONST=""
670 CXXFLAGS    += -DTCLCONST=""
671 KFLAGS      += -DTCLCONST=""
672 TFLAGS      += -DTCLCONST=""
673
674 endif
675
676 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
677 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
678
679 ifdef LIBTCLTKSTATIC
680 TCLTK_LIBS      += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
681 else
682 TCLTK_LIBS      += $(TCL_LIB) $(TK_LIB)
683 endif
684
685 # TCL2C is used to generate compilable sources from tcl files
686 TCL2C           = $(TO_CORE)/../scripts/tcl2c
687 TCL2C_GEN_SRCS  = tcl2c.C
688
689 IFLAGS          += -I$(TCLTK_INC_DIR)
690 ifdef CROSSCOMPILER
691 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
692 else
693 LIBDIR      += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
694 endif
695
696 endif # USES_TCLTK
697
698 ifdef USES_PAPI
699 PAPI_INCDIR     = $(PAPI_ROOT)
700 PAPI_LIBDIR     = $(PAPI_ROOT)
701 #PAPI_LIB       = -Wl,-static -lpapi -Wl,-Bdynamic
702 #PAPI_LIB       = $(PAPI_LIBDIR)/libpapi.a
703 PAPI_LIB        = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi  
704 IFLAGS          += -I$(PAPI_INCDIR)
705 LIBDIR          += $(patsubst %,-L%,$(PAPI_LIBDIR))
706 CFLAGS          += -DPAPI 
707 CXXFLAGS        += -DPAPI
708 TFLAGS          += -DPAPI 
709 endif
710
711 ifdef USES_FLEX
712 FLEX_LIB        = -lfl
713 ifdef FLEX_DIR
714 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
715 VPATH           += $(FLEX_DIR)
716 endif
717 endif
718
719 ifdef CROSSCOMPILER
720 # no /s or /p allowed here
721 #FLEX_DIR       = /s/flex/rs_aix41/lib
722 #LIBDIR         += -L/p/sp2/gcc/lib 
723 endif
724
725 ifdef USES_LIBERTY
726 # Since libiberty.a is in the same g++ directory as libstdc++.a and
727 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
728 endif
729
730 ifdef USES_X11
731 X11_LIB         = -lX11
732
733 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
734 X11DIR          = /usr/openwin
735 CFLAGS          += -I$(X11DIR)/include
736 CXXFLAGS        += -I$(X11DIR)/include
737 TFLAGS          += -I$(X11DIR)/include
738 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
739 endif
740
741 ifeq (linux,$(findstring linux,$(PLATFORM)))
742 X11DIR          = /usr/X11R6
743 CFLAGS          += -I$(X11DIR)/include/X11
744 CXXFLAGS        += -I$(X11DIR)/include/X11
745 TFLAGS          += -I$(X11DIR)/include/X11
746 LIBDIR          += -L$(X11DIR)/lib
747 endif
748
749 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
750 LIBDIR          += -L$(X11DIR)/lib64
751 endif
752 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
753 X11DIR          = /usr
754 endif
755
756 endif # USES_X11