2 # Paradyn overall build configuration (unix)
4 # $Id: make.config,v 1.242 2008/09/20 03:56:08 jaw Exp $
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.
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
23 TO_SCRIPTS = $(TO_CORE)/../scripts
25 # If the PLATFORM environment variable isn't set, we'll try to figure it out.
27 SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi )
29 CURPLAT = $(shell ${SNAME})
31 # IA64/Linux, i386/Linux, x86-64/Linux, ppc/Linux
32 ifneq (,$(findstring linux,$(CURPLAT)))
34 ifneq (,$(findstring ia64,$(CURPLAT)))
35 PLATFORM = ia64-unknown-linux2.4
37 ifneq (,$(findstring i686,$(CURPLAT)))
38 PLATFORM = i386-unknown-linux2.4
40 ifneq (,$(findstring i586,$(CURPLAT)))
41 PLATFORM = i386-unknown-linux2.4
43 ifneq (,$(findstring i486,$(CURPLAT)))
44 PLATFORM = i386-unknown-linux2.4
46 ifneq (,$(findstring i386,$(CURPLAT)))
47 PLATFORM = i386-unknown-linux2.4
49 ifneq (,$(findstring x86_64,$(CURPLAT)))
50 PLATFORM = x86_64-unknown-linux2.4
52 ifneq (,$(findstring, ppc64,$(CURPLAT)))
53 PLATFORM = ppc64_linux
59 ifneq (,$(findstring aix,$(CURPLAT)))
60 PLATFORM = rs6000-ibm-aix5.1
63 ifneq (,$(findstring solaris,$(CURPLAT)))
64 PLATFORM = sparc-sun-solaris2.8
67 ifneq (,$(findstring irix,$(CURPLAT)))
68 PLATFORM = mips-sgi-irix6.5
70 ifneq (,$(findstring osf,$(CURPLAT)))
71 PLATFORM = alpha-dec-osf5.1
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 )
81 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
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
87 # Choose default development directories if necessary variables are unset
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
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.
118 PERL = perl # NB: perl v5 or higher required!
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
126 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
129 # Define all tags based on the platform string. When a new platform
130 # is added, add it to the list
133 # Brief description of -Ds:
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
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
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.
163 ifeq ($(PLATFORM),i386-unknown-linux2.4)
164 OLD_DEF = -Di386_unknown_linux2_0
165 ARCH_DEF = -Darch_x86
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
171 ifeq ($(PLATFORM),i386-unknown-linux2.6)
172 OLD_DEF = -Di386_unknown_linux2_0
173 ARCH_DEF = -Darch_x86
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
179 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
180 OLD_DEF = -Dx86_64_unknown_linux2_4
181 ARCH_DEF = -Darch_x86_64 -Darch_64bit
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
187 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
188 OLD_DEF = -Dia64_unknown_linux2_4
189 ARCH_DEF = -Darch_ia64 -Darch_64bit
191 CAP_DEF = -Dcap_ptrace -Dcap_async_events -Dcap_unwind -Dcap_dynamic_heap -Dcap_threads -Dcap_dwarf -Dno_cap_serialization -Dcap_stackwalker_use_symtab
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
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
211 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
212 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
213 ARCH_DEF = -Darch_power
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
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
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
227 ifeq ($(PLATFORM),ppc64_linux)
228 OLD_DEF = -Dppc64_linux
229 ARCH_DEF = -Darch_power -Darch_64bit
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
235 ifeq ($(PLATFORM),ppc32_linux)
236 OLD_DEF = -Dppc32_linux
237 ARCH_DEF = -Darch_power
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
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
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
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
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
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)
279 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
280 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
285 ifeq (linux,$(findstring linux,$(OS_DEF)))
290 ASFLAGS = -P $(UNIFIED_DEF)
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
299 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
300 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
306 # Default module compiler; modules which want $(CC) should redefine
310 MODCFLAGS = $(CXXFLAGS)
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
318 # uncomment/comment the line below to build with/without compilation warnings
319 # SILENCE_WARNINGS=true
321 ifndef SILENCE_WARNINGS
322 BASICWARNINGS = -W -Wall
324 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
326 -Wredundant-decls -Woverloaded-virtual
328 # not as strict as above, but can actually be used -- mdc
329 USEFULWARNINGS = -W -Wall -Wpointer-arith \
333 # being nice to poor old pathetic tcl/tk header files --ari
334 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
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
346 endif # SILENCE_WARNINGS
350 GCC_VER := $(shell gcc --version)
351 ifneq (,$(findstring 2.95,$(GCC_VER)))
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))
366 COMMONWARNINGS += -Wno-non-template-friend
367 USEFULWARNINGS += -Wno-non-template-friend
368 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
371 #don't inline -- for the files that won't emit template code
374 #inline the private members of the class -- templates.o can use this
375 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
377 # inline everything -- the way things should be
378 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
381 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
382 USES_LIBDYNINST_SO = true
384 ifeq (linux,$(findstring linux,$(PLATFORM)))
385 USES_LIBDYNINST_SO = true
388 # Set this variable if it's desired that dyninst be built with the native
389 # compiler on Solaris
393 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
394 USES_LIBDYNINST_SO = true
395 USES_NATIVE_CC = true
401 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
402 ifndef IBM_BPATCH_COMPAT
403 USES_LIBDYNINST_SO = true
406 USES_PERF_LIBRARY = true
407 # No longer used, because of relocation.
408 #USES_LIB_TEXT_HEAP = true
410 ifdef IBM_BPATCH_COMPAT
411 ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
412 USES_NATIVE_CC = true
416 DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
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
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
436 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
437 ARCH_FLAGS = -maix64 -Drs6000_ibm_aix64
440 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
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)
449 # flags for kludge files, won't have warnings generated
450 KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
454 CFLAGS += -fprofile-arcs -ftest-coverage
455 CXXFLAGS += -fprofile-arcs -ftest-coverage
456 LDFLAGS += -fprofile-arcs -ftest-coverage
461 CFLAGS += -DPURE_BUILD
462 CXXFLAGS += -DPURE_BUILD
465 ifdef USES_PERF_LIBRARY
466 # Add any platform-specific performance libraries here
467 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
469 CFLAGS += -DUSES_PMAPI
470 CXXFLAGS += -DUSES_PMAPI
472 ifdef USES_PMAPI_GROUPS
473 CFLAGS += -DPMAPI_GROUPS
474 CXXFLAGS += -DPMAPI_GROUPS
475 endif # USES_PMAPI_GROUPS
479 ifdef USE_DEPRECATED_BPATCH_VECTOR
480 CXXFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
481 CFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
482 TFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
484 #CFLAGS += -fimplicit-templates
485 CXXFLAGS += -fimplicit-templates
486 TFLAGS += -fimplicit-templates
489 ifdef IBM_BPATCH_COMPAT
490 CXXFLAGS += -DIBM_BPATCH_COMPAT
491 CFLAGS += -DIBM_BPATCH_COMPAT
499 ifeq ($(DEBUG_FLAG),none)
504 CFLAGS += $(DEBUG_FLAG)
505 CXXFLAGS += $(DEBUG_FLAG)
506 KFLAGS += $(DEBUG_FLAG)
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)
514 CFLAGS += $(ALL_INLINE_DEFINES)
515 CXXFLAGS += $(ALL_INLINE_DEFINES)
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
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)
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 )
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 )
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
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).
545 #CFLAGS += -fexternal-templates -Dexternal_templates
546 #CXXFLAGS += -fexternal-templates -Dexternal_templates
547 #KFLAGS += -fexternal-templates -Dexternal_templates
554 ifeq (xyes,x$(USE_PTHREADS))
555 THREADSLIB += -lpthread
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
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
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
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)))
587 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
590 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
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
599 #ifeq (ia64-unknown-linux,$(findstring ia64-unknown-linux,$(PLATFORM)))
600 #DONT_BUILD_NEWTESTSUITE = false
602 #ifeq (x86_64-unknown-linux,$(findstring x86_64-unknown-linux,$(PLATFORM)))
603 #DONT_BUILD_NEWTESTSUITE = false
605 #ifeq (ppc32_linux,$(findstring ppc32_linux,$(PLATFORM)))
606 #DONT_BUILD_NEWTESTSUITE = false
608 #ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
609 #DONT_BUILD_NEWTESTSUITE = false
611 #ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
612 #DONT_BUILD_NEWTESTSUITE = false
616 CFLAGS += -Dcap_mmtimer
617 CXXFLAGS += -Dcap_mmtimer
622 $(error error: TCLTK_DIR is not set. Please set in make.config.local)
624 TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib
625 TCLTK_INC_DIR ?= $(TCLTK_DIR)/include
628 ifdef USES_UNWIND_LIB
629 CFLAGS += -Dcap_unwind
630 CXXFLAGS += -Dcap_unwind
631 LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib
632 LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include
635 ifdef USES_DWARF_DEBUG
636 LIBDWARF_INC ?= $(LIBDWARFDIR)/include
637 LIBDWARF_LIB ?= $(LIBDWARFDIR)/lib
641 LIBELF_INC ?= $(LIBELFDIR)/include
642 LIBELF_LIB ?= $(LIBELFDIR)/lib
647 WITHLIBFL = --with-libfldir=$(FLEX_DIR)
653 #Build other variables based off of the above defaults
656 # use the first set if using tcl8.4,
657 # use the second set if still using tcl8.3
660 TCLTK_LIBVER_ID = 8.4
661 CFLAGS += -DTCLCONST=const
662 CXXFLAGS += -DTCLCONST=const
663 KFLAGS += -DTCLCONST=const
664 TFLAGS += -DTCLCONST=const
668 TCLTK_LIBVER_ID = 8.3
669 CFLAGS += -DTCLCONST=""
670 CXXFLAGS += -DTCLCONST=""
671 KFLAGS += -DTCLCONST=""
672 TFLAGS += -DTCLCONST=""
676 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
677 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
680 TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
682 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
685 # TCL2C is used to generate compilable sources from tcl files
686 TCL2C = $(TO_CORE)/../scripts/tcl2c
687 TCL2C_GEN_SRCS = tcl2c.C
689 IFLAGS += -I$(TCLTK_INC_DIR)
691 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
693 LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
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))
714 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
720 # no /s or /p allowed here
721 #FLEX_DIR = /s/flex/rs_aix41/lib
722 #LIBDIR += -L/p/sp2/gcc/lib
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
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
741 ifeq (linux,$(findstring linux,$(PLATFORM)))
743 CFLAGS += -I$(X11DIR)/include/X11
744 CXXFLAGS += -I$(X11DIR)/include/X11
745 TFLAGS += -I$(X11DIR)/include/X11
746 LIBDIR += -L$(X11DIR)/lib
749 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
750 LIBDIR += -L$(X11DIR)/lib64
752 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))