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 core/make.config.local
16 # 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.4cv
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 # Destinations for library and executable installation (relative to core!)
82 # Warning: modification of the build/install structure is not recommended!
83 LIBRARY_DEST = ../${PLATFORM}/lib
84 PROGRAM_DEST = ../${PLATFORM}/bin
85 INCLUDE_DEST = ../include
87 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
88 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
89 # with cvs), then we should look in a backup location. That's what this vrble
90 # is about. It's used several times below in this file.
108 PERL = perl # NB: perl v5 or higher required!
110 # COLLECTOR is only used by purify & quantify
111 COLLECTOR = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
112 # BUILDSTAMP is used to generate local build vouchers
113 BUILDSTAMP = $(TO_CORE)/../scripts/buildstamp
116 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
119 # Define all tags based on the platform string. When a new platform
120 # is added, add it to the list
123 # Brief description of -Ds:
126 # cap_save_the_world: support for creating a patched binary
127 # cap_relocation: function relocation
128 # cap_stripped_binaries: recursive parsing and function discovery without symbols
130 # cap_ptrace: uses ptrace interface
131 # cap_proc: uses /proc interface
132 # cap_proc_ioctl: uses ioctl interface to proc
133 # cap_proc_fd: uses solaris-style multiple-fd proc interface
134 # cap_threads: support for threaded applications
135 # cap_dynamic_heap: support for a dynamically growing inferior heap
136 # cap_threaded_times: (Linux only) times() returns per-thread information.
137 # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call.
138 # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature
139 # cap_32_64: platforms that support 32- and 64-bit mutatees
140 # cap_liveness: liveness analysis
141 # cap_fixpoint_gen: Generate code using a fixpoint method that saves space
142 # cap_noaddr_gen: Allow code generation before determining the address code is going into
143 # cap_mutatee_traps: Traps can be handled mutatee side
144 # cap_instruction_api: System uses instruction API
145 # cap_registers: User can access registers in snippets
148 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
149 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
150 # the change occurs within a system call; reported by SGI.
152 ifeq ($(PLATFORM),i386-unknown-linux2.4)
153 OLD_DEF = -Di386_unknown_linux2_0
154 ARCH_DEF = -Darch_x86
156 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_have_libxml -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts
157 BUG_DEF = -Dbug_syscall_changepc_rewind
160 ifeq ($(PLATFORM),i386-unknown-linux2.6)
161 OLD_DEF = -Di386_unknown_linux2_0
162 ARCH_DEF = -Darch_x86
164 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_have_xml -Dcap_virtual_registers -Dcap_stackwalker_use_symtab
165 BUG_DEF = -Dbug_syscall_changepc_rewind
168 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
169 OLD_DEF = -Dx86_64_unknown_linux2_4
170 ARCH_DEF = -Darch_x86_64 -Darch_64bit
172 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_have_libxml -Dcap_registers -Dcap_instruction_api -Dcap_stackwalker_use_symtab
173 BUG_DEF = -Dbug_syscall_changepc_rewind
176 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
177 OLD_DEF = -Dia64_unknown_linux2_4
178 ARCH_DEF = -Darch_ia64 -Darch_64bit
180 CAP_DEF = -Dcap_ptrace -Dcap_async_events -Dcap_unwind -Dcap_dynamic_heap -Dcap_threads -Dcap_dwarf -Dno_cap_serialization -Dcap_have_libxml -Dcap_stackwalker_use_symtab
184 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
185 OLD_DEF = -Dsparc_sun_solaris2_4
186 ARCH_DEF = -Darch_sparc
187 OS_DEF = -Dos_solaris
188 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 -Dcap_have_libxml
192 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
193 OLD_DEF = -Dsparc_sun_solaris2_4
194 ARCH_DEF = -Darch_sparc
195 OS_DEF = -Dos_solaris
196 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 -Dcap_have_libxml
200 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
201 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
202 ARCH_DEF = -Darch_power
204 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_have_libxml -Dcap_registers
208 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
209 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
210 ARCH_DEF = -Darch_power -Darch_64bit
212 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world -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_have_libxml -Dcap_registers
216 ifeq ($(PLATFORM),ppc64_linux)
217 OLD_DEF = -Dppc64_linux
218 ARCH_DEF = -Darch_power -Darch_64bit
220 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_have_libxml -Dcap_registers
221 BUG_DEF = -Dbug_syscall_changepc_rewind
224 ifeq ($(PLATFORM),ppc32_linux)
225 OLD_DEF = -Dppc32_linux
226 ARCH_DEF = -Darch_power
228 CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dno_cap_serialization -Dcap_have_libxml -Dcap_registers -Dcap_stackwalker_use_symtab
229 BUG_DEF = -Dbug_syscall_changepc_rewind
232 ifeq ($(PLATFORM),ppc32_bluegene)
233 OLD_DEF = -Dppc32_bluegene
234 ARCH_DEF = -Darch_power
235 OS_DEF = -Dos_bluegene
236 CAP_DEF = -Dcap_dwarf -Dcap_stackwalker_use_symtab
240 ifeq ($(PLATFORM),ppc32_bgcompute)
241 OLD_DEF = -Dppc32_bluegene
242 ARCH_DEF = -Darch_power
243 OS_DEF = -Dos_bgcompute
244 CAP_DEF = -Dcap_dwarf
248 ifeq ($(PLATFORM),x86_64_catamount)
249 OLD_DEF = -Dx86_64_catamount
250 ARCH_DEF = -Darch_x86_64 -Darch_64bit
251 OS_DEF = -Dos_catamount
252 CAP_DEF = -Dcap_dwarf
255 ifeq ($(PLATFORM),x86_64_cnl)
256 OLD_DEF = -Dx86_64_cnl
257 ARCH_DEF = -Darch_x86_64 -Darch_64bit
258 OS_DEF = -Dos_linux -Dos_cnl
259 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
260 BUG_DEF = -Dbug_syscall_changepc_rewind
264 # Combine all the #defines for ease of use
265 UNIFIED_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
267 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
268 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
273 ifeq (linux,$(findstring linux,$(OS_DEF)))
278 ASFLAGS = -P $(UNIFIED_DEF)
281 # set the macros that control whether the stdint limit and constant
282 # macros are defined for C++ on the compilers command line so that
283 # we don't have to worry about the ordering of #includes.
284 ifeq (linux,$(findstring linux,$(PLATFORM)))
285 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
287 ifeq (bluegene,$(findstring bluegene,$(PLATFORM)))
288 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
294 # Default module compiler; modules which want $(CC) should redefine
298 MODCFLAGS = $(CXXFLAGS)
303 # Added core/external for included external dependencies - bernat, 11JUN07
304 IFLAGS = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/../include -I$(TO_CORE)/external -I$(TO_CORE)/dynutil/h
306 # uncomment/comment the line below to build with/without compilation warnings
307 # SILENCE_WARNINGS=true
309 ifndef SILENCE_WARNINGS
310 BASICWARNINGS = -W -Wall
312 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
314 -Wredundant-decls -Woverloaded-virtual
316 # not as strict as above, but can actually be used -- mdc
317 USEFULWARNINGS = -W -Wall -Wpointer-arith \
321 # being nice to poor old pathetic tcl/tk header files --ari
322 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
326 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
327 COMMONWARNINGS += -Wno-unknown-pragmas
328 USEFULWARNINGS += -Wno-unknown-pragmas
329 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
330 else # STL on Solaris with cast-align generates a warning with much output
331 COMMONWARNINGS += -Wcast-align
332 USEFULWARNINGS += -Wcast-align
334 endif # SILENCE_WARNINGS
338 GCC_VER := $(shell gcc --version)
339 ifneq (,$(findstring 2.95,$(GCC_VER)))
345 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
346 versionNumbers = $(sort $(GCC_VER) 2.95)
347 versionNumber = $(firstword $(versionNumbers))
348 ifneq (2.95, $(versionNumber))
354 COMMONWARNINGS += -Wno-non-template-friend
355 USEFULWARNINGS += -Wno-non-template-friend
356 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
359 #don't inline -- for the files that won't emit template code
362 #inline the private members of the class -- templates.o can use this
363 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
365 # inline everything -- the way things should be
366 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
369 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
370 USES_LIBDYNINST_SO = true
372 ifeq (linux,$(findstring linux,$(PLATFORM)))
373 USES_LIBDYNINST_SO = true
376 # Set this variable if it's desired that dyninst be built with the native
377 # compiler on Solaris
381 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
382 USES_LIBDYNINST_SO = true
383 USES_NATIVE_CC = true
389 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
390 ifndef IBM_BPATCH_COMPAT
391 USES_LIBDYNINST_SO = true
394 USES_PERF_LIBRARY = true
395 # No longer used, because of relocation.
396 #USES_LIB_TEXT_HEAP = true
398 ifdef IBM_BPATCH_COMPAT
399 ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
400 USES_NATIVE_CC = true
404 DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
408 # As of AIX 5, the pm_init function in libpmapi takes more
409 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
410 # and handled in the paradyn runtime library
411 PMAPI_VERSION := $(shell uname -v )
412 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
413 USES_PMAPI_GROUPS = true
417 # if we don't want OPT_FLAG defined for a particular part of the code
418 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
419 # the include of make.config - naim
424 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
425 ARCH_FLAGS = -maix64 -Drs6000_ibm_aix64
428 # flags for normal (non-kludge) files, with common warnings
429 CFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
430 CXXFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
431 LDFLAGS = $(ARCH_FLAGS)
433 # flags for kludge files, won't have warnings generated
434 KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
438 CFLAGS += -fprofile-arcs -ftest-coverage
439 CXXFLAGS += -fprofile-arcs -ftest-coverage
440 LDFLAGS += -fprofile-arcs -ftest-coverage
445 CFLAGS += -DPURE_BUILD
446 CXXFLAGS += -DPURE_BUILD
449 ifdef USES_PERF_LIBRARY
450 # Add any platform-specific performance libraries here
451 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
453 CFLAGS += -DUSES_PMAPI
454 CXXFLAGS += -DUSES_PMAPI
456 ifdef USES_PMAPI_GROUPS
457 CFLAGS += -DPMAPI_GROUPS
458 CXXFLAGS += -DPMAPI_GROUPS
459 endif # USES_PMAPI_GROUPS
463 ifdef USE_DEPRECATED_BPATCH_VECTOR
464 CXXFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
465 CFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
466 TFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR
468 #CFLAGS += -fimplicit-templates
469 CXXFLAGS += -fimplicit-templates
470 TFLAGS += -fimplicit-templates
473 ifdef IBM_BPATCH_COMPAT
474 CXXFLAGS += -DIBM_BPATCH_COMPAT
475 CFLAGS += -DIBM_BPATCH_COMPAT
483 ifeq ($(DEBUG_FLAG),none)
488 CFLAGS += $(DEBUG_FLAG)
489 CXXFLAGS += $(DEBUG_FLAG)
490 KFLAGS += $(DEBUG_FLAG)
493 # flags for template files, don't define external template flags
494 # -g is optional in this case -- should be defined at module level
495 TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
498 CFLAGS += $(ALL_INLINE_DEFINES)
499 CXXFLAGS += $(ALL_INLINE_DEFINES)
502 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
503 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
504 LIBDIR = $(FIRST_LIBDIR) \
505 -L$(TO_CORE)/../$(PLATFORM)/lib
507 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
508 # else set it to just "igen" (i.e. assume it's in the user's path)
510 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 )
512 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 )
515 ifdef NO_IMPLICIT_TEMPLATES
516 ifdef USE_DEPRECATED_BPATCH_VECTOR
517 # CFLAGS += -fno-implicit-templates
518 CXXFLAGS += -fno-implicit-templates
519 KFLAGS += -fno-implicit-templates
523 ifndef INSTANTIATE_TEMPLATES
524 ifndef NO_IMPLICIT_TEMPLATES
525 # -fexternal-templates and -Dexternal_templates should both be used or
526 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
527 # (but not to TFLAGS).
529 #CFLAGS += -fexternal-templates -Dexternal_templates
530 #CXXFLAGS += -fexternal-templates -Dexternal_templates
531 #KFLAGS += -fexternal-templates -Dexternal_templates
538 ifeq (xyes,x$(USE_PTHREADS))
539 THREADSLIB += -lpthread
541 # On Linux, programs using pthreads are supposed to define _REENTRANT
542 ifeq (linux,$(findstring linux,$(PLATFORM)))
543 CFLAGS += -D_REENTRANT=1
544 CXXFLAGS += -D_REENTRANT=1
545 KFLAGS += -D_REENTRANT=1
546 TFLAGS += -D_REENTRANT=1
549 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
550 #CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
551 #CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
552 #KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
553 #TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
556 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
557 CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
558 CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
559 KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
560 TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
565 # System build constraints
566 #Build the MT daemon on AIX, Solaris, and Linux/x86
567 DONT_BUILD_PD_MT = true
568 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
571 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
574 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
578 # Build newtestsuite on i386, x86_64 and ia64 linux
579 DONT_BUILD_NEWTESTSUITE = true
580 ifeq (i386-unknown-linux,$(findstring i386-unknown-linux,$(PLATFORM)))
581 DONT_BUILD_NEWTESTSUITE = false
583 ifeq (ia64-unknown-linux,$(findstring ia64-unknown-linux,$(PLATFORM)))
584 DONT_BUILD_NEWTESTSUITE = false
586 ifeq (x86_64-unknown-linux,$(findstring x86_64-unknown-linux,$(PLATFORM)))
587 DONT_BUILD_NEWTESTSUITE = false
589 ifeq (ppc32_linux,$(findstring ppc32_linux,$(PLATFORM)))
590 DONT_BUILD_NEWTESTSUITE = false
592 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
593 DONT_BUILD_NEWTESTSUITE = false
595 ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
596 DONT_BUILD_NEWTESTSUITE = false
599 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
601 # Include any per-user configuration changes; this "local" config file
602 # should *not* be under CVS control, so that it never gets committed.
603 -include $(TO_CORE)/make.config.local
605 # Choose default development directories if necessary variables are unset
608 CFLAGS += -Dcap_mmtimer
609 CXXFLAGS += -Dcap_mmtimer
614 $(error error: TCLTK_DIR is not set. Please set in make.config.local)
616 TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib
617 TCLTK_INC_DIR ?= $(TCLTK_DIR)/include
620 ifdef USES_UNWIND_LIB
621 CFLAGS += -Dcap_unwind
622 CXXFLAGS += -Dcap_unwind
623 LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib
624 LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include
627 ifdef USES_DWARF_DEBUG
628 LIBDWARF_INC ?= $(LIBDWARFDIR)/include
629 LIBDWARF_LIB ?= $(LIBDWARFDIR)/lib
633 LIBELF_INC ?= $(LIBELFDIR)/include
634 LIBELF_LIB ?= $(LIBELFDIR)/lib
639 WITHLIBFL = --with-libfldir=$(FLEX_DIR)
645 #Build other variables based off of the above defaults
648 # use the first set if using tcl8.4,
649 # use the second set if still using tcl8.3
652 TCLTK_LIBVER_ID = 8.4
653 CFLAGS += -DTCLCONST=const
654 CXXFLAGS += -DTCLCONST=const
655 KFLAGS += -DTCLCONST=const
656 TFLAGS += -DTCLCONST=const
660 TCLTK_LIBVER_ID = 8.3
661 CFLAGS += -DTCLCONST=""
662 CXXFLAGS += -DTCLCONST=""
663 KFLAGS += -DTCLCONST=""
664 TFLAGS += -DTCLCONST=""
668 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
669 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
672 TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
674 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
677 # TCL2C is used to generate compilable sources from tcl files
678 TCL2C = $(TO_CORE)/../scripts/tcl2c
679 TCL2C_GEN_SRCS = tcl2c.C
681 IFLAGS += -I$(TCLTK_INC_DIR)
683 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
685 LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
691 PAPI_INCDIR = $(PAPI_ROOT)
692 PAPI_LIBDIR = $(PAPI_ROOT)
693 #PAPI_LIB = -Wl,-static -lpapi -Wl,-Bdynamic
694 #PAPI_LIB = $(PAPI_LIBDIR)/libpapi.a
695 PAPI_LIB = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi
696 IFLAGS += -I$(PAPI_INCDIR)
697 LIBDIR += $(patsubst %,-L%,$(PAPI_LIBDIR))
706 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
712 # no /s or /p allowed here
713 #FLEX_DIR = /s/flex/rs_aix41/lib
714 #LIBDIR += -L/p/sp2/gcc/lib
718 # Since libiberty.a is in the same g++ directory as libstdc++.a and
719 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
725 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
726 X11DIR = /usr/openwin
727 CFLAGS += -I$(X11DIR)/include
728 CXXFLAGS += -I$(X11DIR)/include
729 TFLAGS += -I$(X11DIR)/include
730 LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib
733 ifeq (linux,$(findstring linux,$(PLATFORM)))
735 CFLAGS += -I$(X11DIR)/include/X11
736 CXXFLAGS += -I$(X11DIR)/include/X11
737 TFLAGS += -I$(X11DIR)/include/X11
738 LIBDIR += -L$(X11DIR)/lib
741 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
742 LIBDIR += -L$(X11DIR)/lib64
744 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))