2 # Paradyn overall build configuration (unix)
4 # $Id: make.config,v 1.242 2008/09/20 03:56:08 jaw Exp $
11 #USE_DEPRECATED_BPATCH_VECTOR = 1
12 # Apart from actual "full" releases, don't modify these build Id components.
13 # For personal/experimental builds, feel free to use your
14 # dyninst/make.config.local file to (re-)define BUILD_MARK as you desire.
16 # most "main" modules are only two levels deep, but we need to be able to
17 # change this for those that are deeper in the tree
22 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
157 # cap_tramp_liveness: we can run liveness over our trampolines to determine what's used
160 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
161 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
162 # the change occurs within a system call; reported by SGI.
164 ifeq ($(PLATFORM),i386-unknown-linux2.4)
165 OLD_DEF = -Di386_unknown_linux2_0
166 ARCH_DEF = -Darch_x86
168 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_stackwalker_use_symtab -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_tramp_liveness
169 BUG_DEF = -Dbug_syscall_changepc_rewind
172 ifeq ($(PLATFORM),i386-unknown-linux2.6)
173 OLD_DEF = -Di386_unknown_linux2_0
174 ARCH_DEF = -Darch_x86
176 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_stackwalker_use_symtab -Dcap_instruction_replacement -Dcap_tramp_liveness
177 BUG_DEF = -Dbug_syscall_changepc_rewind
180 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
181 OLD_DEF = -Dx86_64_unknown_linux2_4
182 ARCH_DEF = -Darch_x86_64 -Darch_64bit
184 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_stackwalker_use_symtab -Dcap_instruction_replacement -Dcap_tramp_liveness
185 BUG_DEF = -Dbug_syscall_changepc_rewind
188 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
189 OLD_DEF = -Dia64_unknown_linux2_4
190 ARCH_DEF = -Darch_ia64 -Darch_64bit
192 CAP_DEF = -Dcap_ptrace -Dcap_async_events -Dcap_unwind -Dcap_dynamic_heap -Dcap_threads -Dcap_dwarf -Dcap_serialization -Dcap_stackwalker_use_symtab
196 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
197 OLD_DEF = -Dsparc_sun_solaris2_4
198 ARCH_DEF = -Darch_sparc
199 OS_DEF = -Dos_solaris
200 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
201 -Dcap_syscall_trap -Dcap_serialization
205 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
206 OLD_DEF = -Dsparc_sun_solaris2_4
207 ARCH_DEF = -Darch_sparc
208 OS_DEF = -Dos_solaris
209 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \
210 -Dcap_syscall_trap -Dcap_serialization
214 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
215 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
216 ARCH_DEF = -Darch_power
218 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 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api_liveness -Dcap_stackwalker_use_symtab
222 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
223 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
224 ARCH_DEF = -Darch_power -Darch_64bit
226 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap \
227 -Dcap_32_64 -Dcap_liveness -Dcap_use_pdvector -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_stackwalker_use_symtab
231 ifeq ($(PLATFORM),ppc64_linux)
232 OLD_DEF = -Dppc64_linux
233 ARCH_DEF = -Darch_power -Darch_64bit
235 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \
236 -Dcap_32_64 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement
237 BUG_DEF = -Dbug_syscall_changepc_rewind
240 ifeq ($(PLATFORM),ppc32_linux)
241 OLD_DEF = -Dppc32_linux
242 ARCH_DEF = -Darch_power
244 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_serialization -Dcap_registers -Dcap_stackwalker_use_symtab -Dcap_instruction_replacement -Dcap_instruction_api_liveness
245 BUG_DEF = -Dbug_syscall_changepc_rewind
248 ifeq ($(PLATFORM),ppc32_bgl_ion)
249 OLD_DEF = -Dppc32_bluegene
250 ARCH_DEF = -Darch_power
251 OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_ion
252 CAP_DEF = -Dcap_dwarf -Dcap_stackwalker_use_symtab
256 ifeq ($(PLATFORM),ppc32_bgl_compute)
257 OLD_DEF = -Dppc32_bluegene
258 ARCH_DEF = -Darch_powerO
259 OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_compute
260 CAP_DEF = -Dcap_dwarf
264 ifeq ($(PLATFORM),ppc32_bgp_ion)
265 OLD_DEF = -Dppc32_bluegene
266 ARCH_DEF = -Darch_power
267 OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_ion
268 CAP_DEF = -Dcap_dwarf -Dcap_stackwalker_use_symtab
272 ifeq ($(PLATFORM),ppc32_bgp_compute)
273 OLD_DEF = -Dppc32_bluegene
274 ARCH_DEF = -Darch_power
275 OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_compute
276 CAP_DEF = -Dcap_dwarf
280 ifeq ($(PLATFORM),x86_64_catamount)
281 OLD_DEF = -Dx86_64_catamount
282 ARCH_DEF = -Darch_x86_64 -Darch_64bit
283 OS_DEF = -Dos_catamount
284 CAP_DEF = -Dcap_dwarf
288 ifeq ($(PLATFORM),x86_64_cnl)
289 OLD_DEF = -Dx86_64_cnl
290 ARCH_DEF = -Darch_x86_64 -Darch_64bit
291 OS_DEF = -Dos_linux -Dos_cnl
292 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
293 BUG_DEF = -Dbug_syscall_changepc_rewind
296 ifeq ($(PLATFORM),ppc32-unknown-vxworks6.x)
297 OLD_DEF = -Dppc32_vxworks
298 ARCH_DEF = -Darch_power -Dtarget_ppc32 -Dtarget_smallmem -Dendian_mismatch
299 OS_DEF = -Dos_vxworks
300 CAP_DEF = -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 -Dno_cap_serialization -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts -Dcap_instruction_replacement
301 #CAP_DEF = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_instruction_api
306 ifneq ($(XLC_BUILD),true)
307 CAP_DEF += -Dcap_liberty
310 # Combine all the #defines for ease of use
311 UNIFIED_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) $(AC_DEF)
312 UNIFIED_TEST_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
314 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
315 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
320 ifeq (linux,$(findstring linux,$(OS_DEF)))
325 ASFLAGS = -P $(UNIFIED_DEF)
328 # set the macros that control whether the stdint limit and constant
329 # macros are defined for C++ on the compilers command line so that
330 # we don't have to worry about the ordering of #includes.
331 ifeq (linux,$(findstring linux,$(PLATFORM)))
332 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
334 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
335 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
341 # Default module compiler; modules which want $(CC) should redefine
345 MODCFLAGS = $(CXXFLAGS)
350 # Added dyninst/external for included external dependencies - bernat, 11JUN07
351 IFLAGS = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/dynutil/h -I$(TO_CORE)/external
353 # uncomment/comment the line below to build with/without compilation warnings
354 # SILENCE_WARNINGS=true
356 ifndef SILENCE_WARNINGS
357 BASICWARNINGS = -W -Wall
359 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
361 -Wredundant-decls -Woverloaded-virtual
363 # not as strict as above, but can actually be used -- mdc
364 USEFULWARNINGS = -W -Wall -Wpointer-arith \
368 # being nice to poor old pathetic tcl/tk header files --ari
369 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
373 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
374 COMMONWARNINGS += -Wno-unknown-pragmas
375 USEFULWARNINGS += -Wno-unknown-pragmas
376 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
377 else # STL on Solaris with cast-align generates a warning with much output
378 COMMONWARNINGS += -Wcast-align
379 USEFULWARNINGS += -Wcast-align
381 endif # SILENCE_WARNINGS
385 GCC_VER := $(shell gcc --version)
386 ifneq (,$(findstring 2.95,$(GCC_VER)))
392 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
393 versionNumbers = $(sort $(GCC_VER) 2.95)
394 versionNumber = $(firstword $(versionNumbers))
395 ifneq (2.95, $(versionNumber))
401 COMMONWARNINGS += -Wno-non-template-friend
402 USEFULWARNINGS += -Wno-non-template-friend
403 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
406 #don't inline -- for the files that won't emit template code
409 #inline the private members of the class -- templates.o can use this
410 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
412 # inline everything -- the way things should be
413 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
415 # Set this variable if it's desired that dyninst be built with the native
416 # compiler on Solaris
420 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
421 USES_NATIVE_CC = true
427 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
430 USES_NATIVE_CC = true
434 DEPENDFLAGS = -M -E -qrtti=all -qro -DCOMPILER="xlC"
435 AUTO_TEMPLATES = true
440 # if we don't want OPT_FLAG defined for a particular part of the code
441 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
442 # the include of make.config - naim
447 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
448 ARCH_FLAGS = -maix64 -Drs6000_ibm_aix64
451 ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM)))
455 # flags for normal (non-kludge) files, with common warnings
456 CFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
457 CXXFLAGS += $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
458 LDFLAGS += $(ARCH_FLAGS)
460 # flags for kludge files, won't have warnings generated
461 KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
465 CFLAGS += -fprofile-arcs -ftest-coverage
466 CXXFLAGS += -fprofile-arcs -ftest-coverage
467 LDFLAGS += -fprofile-arcs -ftest-coverage
471 ifdef USES_PERF_LIBRARY
472 # Add any platform-specific performance libraries here
473 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
475 CFLAGS += -DUSES_PMAPI
476 CXXFLAGS += -DUSES_PMAPI
478 ifdef USES_PMAPI_GROUPS
479 CFLAGS += -DPMAPI_GROUPS
480 CXXFLAGS += -DPMAPI_GROUPS
481 endif # USES_PMAPI_GROUPS
485 ifdef USE_DEPRECATED_BPATCH_VECTOR
486 CXXFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
487 CFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
488 TFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
490 #CFLAGS += -fimplicit-templates
491 CXXFLAGS += -fimplicit-templates
492 TFLAGS += -fimplicit-templates
500 ifeq ($(DEBUG_FLAG),none)
505 CFLAGS += $(DEBUG_FLAG)
506 CXXFLAGS += $(DEBUG_FLAG)
507 KFLAGS += $(DEBUG_FLAG)
510 # flags for template files, don't define external template flags
511 # -g is optional in this case -- should be defined at module level
512 TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
515 CFLAGS += $(ALL_INLINE_DEFINES)
516 CXXFLAGS += $(ALL_INLINE_DEFINES)
519 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
520 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
521 LIBDIR = $(FIRST_LIBDIR) \
522 -L$(TO_CORE)/../$(PLATFORM)/lib
524 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
525 # else set it to just "igen" (i.e. assume it's in the user's path)
527 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 )
529 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 )
532 ifdef NO_IMPLICIT_TEMPLATES
533 ifdef USE_DEPRECATED_BPATCH_VECTOR
534 # CFLAGS += -fno-implicit-templates
535 CXXFLAGS += -fno-implicit-templates
536 KFLAGS += -fno-implicit-templates
540 ifndef INSTANTIATE_TEMPLATES
541 ifndef NO_IMPLICIT_TEMPLATES
542 # -fexternal-templates and -Dexternal_templates should both be used or
543 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
544 # (but not to TFLAGS).
546 #CFLAGS += -fexternal-templates -Dexternal_templates
547 #CXXFLAGS += -fexternal-templates -Dexternal_templates
548 #KFLAGS += -fexternal-templates -Dexternal_templates
555 ifeq (xyes,x$(USE_PTHREADS))
556 THREADSLIB += -lpthread
558 # On Linux, programs using pthreads are supposed to define _REENTRANT
559 ifeq (linux,$(findstring linux,$(PLATFORM)))
560 CFLAGS += -D_REENTRANT=1
561 CXXFLAGS += -D_REENTRANT=1
562 KFLAGS += -D_REENTRANT=1
563 TFLAGS += -D_REENTRANT=1
566 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
567 #CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
568 #CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
569 #KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
570 #TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
573 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
574 CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
575 CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
576 KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
577 TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
582 # System build constraints
583 #Build the MT daemon on AIX, Solaris, and Linux/x86
584 DONT_BUILD_PD_MT = true
585 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
588 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
591 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
595 # Build newtestsuite on i386, x86_64 and ia64 linux
596 #DONT_BUILD_NEWTESTSUITE = true
597 #ifeq (i386-unknown-linux,$(findstring i386-unknown-linux,$(PLATFORM)))
598 #DONT_BUILD_NEWTESTSUITE = false
600 #ifeq (ia64-unknown-linux,$(findstring ia64-unknown-linux,$(PLATFORM)))
601 #DONT_BUILD_NEWTESTSUITE = false
603 #ifeq (x86_64-unknown-linux,$(findstring x86_64-unknown-linux,$(PLATFORM)))
604 #DONT_BUILD_NEWTESTSUITE = false
606 #ifeq (ppc32_linux,$(findstring ppc32_linux,$(PLATFORM)))
607 #DONT_BUILD_NEWTESTSUITE = false
609 #ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
610 #DONT_BUILD_NEWTESTSUITE = false
612 #ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
613 #DONT_BUILD_NEWTESTSUITE = false
617 CFLAGS += -Dcap_mmtimer
618 CXXFLAGS += -Dcap_mmtimer
623 $(error error: TCLTK_DIR is not set. Please set in make.config.local)
625 TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib
626 TCLTK_INC_DIR ?= $(TCLTK_DIR)/include
629 ifdef USES_UNWIND_LIB
630 CFLAGS += -Dcap_unwind
631 CXXFLAGS += -Dcap_unwind
632 LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib
633 LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include
636 ifdef USES_DWARF_DEBUG
637 LIBDWARF_INC ?= $(LIBDWARFDIR)/include
638 LIBDWARF_LIB ?= $(LIBDWARFDIR)/lib
641 ifdef LIBDWARF_HASSETFRAME
642 CFLAGS += -Ddwarf_has_setframe
643 CXXFLAGS += -Ddwarf_has_setframe
648 LIBELF_INC ?= $(LIBELFDIR)/include
649 LIBELF_LIB ?= $(LIBELFDIR)/lib
654 WITHLIBFL = --with-libfldir=$(FLEX_DIR)
660 #Build other variables based off of the above defaults
663 # use the first set if using tcl8.4,
664 # use the second set if still using tcl8.3
667 TCLTK_LIBVER_ID = 8.4
668 CFLAGS += -DTCLCONST=const
669 CXXFLAGS += -DTCLCONST=const
670 KFLAGS += -DTCLCONST=const
671 TFLAGS += -DTCLCONST=const
675 TCLTK_LIBVER_ID = 8.3
676 CFLAGS += -DTCLCONST=""
677 CXXFLAGS += -DTCLCONST=""
678 KFLAGS += -DTCLCONST=""
679 TFLAGS += -DTCLCONST=""
683 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
684 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
687 TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
689 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
692 # TCL2C is used to generate compilable sources from tcl files
693 TCL2C = $(TO_CORE)/../scripts/tcl2c
694 TCL2C_GEN_SRCS = tcl2c.C
696 IFLAGS += -I$(TCLTK_INC_DIR)
698 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
700 LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
706 PAPI_INCDIR = $(PAPI_ROOT)
707 PAPI_LIBDIR = $(PAPI_ROOT)
708 #PAPI_LIB = -Wl,-static -lpapi -Wl,-Bdynamic
709 #PAPI_LIB = $(PAPI_LIBDIR)/libpapi.a
710 PAPI_LIB = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi
711 IFLAGS += -I$(PAPI_INCDIR)
712 LIBDIR += $(patsubst %,-L%,$(PAPI_LIBDIR))
721 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
727 # no /s or /p allowed here
728 #FLEX_DIR = /s/flex/rs_aix41/lib
729 #LIBDIR += -L/p/sp2/gcc/lib
733 # Since libiberty.a is in the same g++ directory as libstdc++.a and
734 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
740 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
741 X11DIR = /usr/openwin
742 CFLAGS += -I$(X11DIR)/include
743 CXXFLAGS += -I$(X11DIR)/include
744 TFLAGS += -I$(X11DIR)/include
745 LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib
748 ifeq (linux,$(findstring linux,$(PLATFORM)))
750 CFLAGS += -I$(X11DIR)/include/X11
751 CXXFLAGS += -I$(X11DIR)/include/X11
752 TFLAGS += -I$(X11DIR)/include/X11
753 LIBDIR += -L$(X11DIR)/lib
756 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
757 LIBDIR += -L$(X11DIR)/lib64
759 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))