# -*- makefile -*- # Paradyn overall build configuration (unix) # # $Id: make.config,v 1.242 2008/09/20 03:56:08 jaw Exp $ # SUITE_NAME = Paradyn RELEASE_NUM = 8.0 # ***** EXTERNAL SOFTWARE CONFIGURATION ***** # Include any per-user configuration changes; this "local" config file # should *not* be under CVS control, so that it never gets committed. ifndef TO_CORE TO_CORE = ../.. endif include $(TO_CORE)/make.config.local Everything = dynutil common symtabAPI instructionAPI parseAPI proccontrol stackwalk dyninstAPI_RT dyninstAPI SymtabAPI = dynutil common symtabAPI StackwalkerAPI = dynutil common proccontrol stackwalk DyninstAPI = dynutil common symtabAPI instructionAPI parseAPI stackwalk dyninstAPI_RT dyninstAPI DynC_API = dynutil common symtabAPI instructionAPI parseAPI dyninstAPI_RT dyninstAPI dynC_API InstructionAPI = dynutil common instructionAPI ProcControlAPI = dynutil common proccontrol DepGraphAPI = depGraphAPI ParseAPI = dynutil common symtabAPI instructionAPI parseAPI ValueAdded = valueAdded/sharedMem DataflowAPI = ParseAPI DEFAULT_COMPONENT ?= default ifeq ($(DEFAULT_COMPONENT),default) fullSystem += $(Everything) BUILD_PARSETHAT = true else ifeq ($(DEFAULT_COMPONENT),SymtabAPI) fullSystem += $(SymtabAPI) else ifeq ($(DEFAULT_COMPONENT),StackwalkerAPI) fullSystem += $(StackwalkerAPI) else ifeq ($(DEFAULT_COMPONENT),DyninstAPI) fullSystem += $(DyninstAPI) BUILD_PARSETHAT = true else ifeq ($(DEFAULT_COMPONENT),InstructionAPI) fullSystem += $(InstructionAPI) else ifeq ($(DEFAULT_COMPONENT),ProcControlAPI) fullSystem += $(ProcControlAPI) else ifeq ($(DEFAULT_COMPONENT),ParseAPI) fullSystem += $(ParseAPI) else ifeq ($(DEFAULT_COMPONENT),DataflowAPI) fullSystem += $(ParseAPI) else default: @echo Error: Build system does not have a valid default component: $(DEFAULT_COMPONENT) endif endif endif endif endif endif endif endif ifndef DONT_BUILD_NEWTESTSUITE testsuites += testsuite allSubdirs_noinstall += testsuite fullSystem += testsuite ifdef BUILD_PARSETHAT testsuites += parseThat fullSystem += parseThat endif endif #BUILD_MARK = EXPLICIT_DEPENDS = 1 #USE_DEPRECATED_BPATCH_VECTOR = 1 #IBM_BPATCH_COMPAT = 1 # Apart from actual "full" releases, don't modify these build Id components. # For personal/experimental builds, feel free to use your # dyninst/make.config.local file to (re-)define BUILD_MARK as you desire. # most "main" modules are only two levels deep, but we need to be able to # change this for those that are deeper in the tree ifndef TO_SCRIPTS TO_SCRIPTS = $(TO_CORE)/scripts endif # If the PLATFORM environment variable isn't set, we'll try to figure it out. ifndef PLATFORM ifdef build CURPLAT = $(build) else SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi ) ifdef SNAME CURPLAT = $(shell ${SNAME}) endif endif # i386/Linux, x86-64/Linux, ppc/Linux, ppc64/Linux ifneq (,$(findstring linux,$(CURPLAT))) ifneq (,$(findstring i686,$(CURPLAT))) PLATFORM = i386-unknown-linux2.4 endif ifneq (,$(findstring i586,$(CURPLAT))) PLATFORM = i386-unknown-linux2.4 endif ifneq (,$(findstring i486,$(CURPLAT))) PLATFORM = i386-unknown-linux2.4 endif ifneq (,$(findstring i386,$(CURPLAT))) PLATFORM = i386-unknown-linux2.4 endif ifneq (,$(findstring x86_64,$(CURPLAT))) PLATFORM = x86_64-unknown-linux2.4 endif ifneq (,$(findstring, ppc64,$(CURPLAT))) PLATFORM = ppc64_linux endif ifneq (,$(findstring, powerpc64,$(CURPLAT))) PLATFORM = ppc64_linux endif ifneq (,$(findstring, powerpc-,$(CURPLAT))) PLATFORM = ppc32_linux endif ifneq (,$(findstring, ppc-,$(CURPLAT))) PLATFORM = ppc32_linux endif endif # Freebsd ifneq (,$(findstring freebsd,$(CURPLAT))) ifneq (,$(findstring i686,$(CURPLAT))) PLATFORM = i386-unknown-freebsd7.2 endif ifneq (,$(findstring i586,$(CURPLAT))) PLATFORM = i386-unknown-freebsd7.2 endif ifneq (,$(findstring i486,$(CURPLAT))) PLATFORM = i386-unknown-freebsd7.2 endif ifneq (,$(findstring i386,$(CURPLAT))) PLATFORM = i386-unknown-freebsd7.2 endif ifneq (,$(findstring x86_64,$(CURPLAT))) PLATFORM = amd64-unknown-freebsd7.2 endif endif # VxWorks ifneq (,$(findstring vxworks,$(CURPLAT))) ifneq (,$(findstring i686,$(CURPLAT))) PLATFORM = i386-unknown-vxworks6.x endif ifneq (,$(findstring i586,$(CURPLAT))) PLATFORM = i386-unknown-vxworks6.x endif ifneq (,$(findstring i486,$(CURPLAT))) PLATFORM = i386-unknown-vxworks6.x endif ifneq (,$(findstring i386,$(CURPLAT))) PLATFORM = i386-unknown-vxworks6.x endif ifneq (,$(findstring powerpc-,$(CURPLAT))) PLATFORM = ppc32-unknown-vxworks6.x endif endif ifndef PLATFORM ifdef build PLATFORM = $(build) endif endif endif ifndef PLATFORM $(error Could not determine you current platform. Please set your PLATFORM environment variable to whichever closest matches your platform: amd64-unknown-freebsd7.2 i386-unknown-freebsd7.2 i386-unknown-linux2.4 i386-unknown-vxworks6.x ppc32-unknown-vxworks6.x ppc32_bgl_ion ppc32_bgp ppc32_bgp_ion ppc32_linux ppc64_bgq_ion ppc64_linux x86_64-unknown-linux2.4) endif # Choose default development directories if necessary variables are unset LIBRARY_DEST ?= $(libdir) PROGRAM_DEST ?= $(bindir) INCLUDE_DEST ?= $(includedir) ifdef prefix ifeq (x$(LIBRARY_DEST),x) LIBRARY_DEST = $(prefix)/lib endif ifeq (x$(PROGRAM_DEST),x) PROGRAM_DEST = $(prefix)/bin endif ifeq (x$(INCLUDE_DEST),x) LIBRARY_DEST = $(prefix)/include endif endif # Destinations for library and executable installation (relative to "dyninst"!) # These are here for backwards compatibility with old make.config.locals LIBRARY_DEST ?= ${TO_CORE}/../${PLATFORM}/lib PROGRAM_DEST ?= ${TO_CORE}/../${PLATFORM}/bin INCLUDE_DEST ?= ${TO_CORE}/../include # DESTDIR is a standard name to do a staged install ifdef DESTDIR LIBRARY_DEST := ${DESTDIR}${LIBRARY_DEST} PROGRAM_DEST := ${DESTDIR}${PROGRAM_DEST} INCLUDE_DEST := ${DESTDIR}${INCLUDE_DEST} endif # Usually, we look for files, binaries, libs in $(TO_CORE)/..... # But if the file doesn't exist there (i.e. if the user hasn't checked them out # with cvs), then we should look in a backup location. That's what this vrble # is about. It's used several times below in this file. ifeq ($(PLATFORM),ppc32_bgl_compute) GCC = mpgcc GXX = mpg++ CC = mpgcc CXX = mpg++ endif ifeq ($(PLATFORM),ppc32_bgp_compute) GCC = powerpc-bgp-linux-gcc GXX = powerpc-bgp-linux-g++ CC = powerpc-bgp-linux-gcc CXX = powerpc-bgp-linux-g++ endif GCC ?= gcc GXX ?= g++ LINKER = ld AS = as CC ?= $(GCC) CXX ?= $(GXX) LEX = flex RANLIB = ranlib AR = ar YFLAGS = -d -y YACC = bison MV = mv CP = cp RM = rm -f LN = ln -s MKDIR = mkdir -p CHMOD = chmod PERL = perl # NB: perl v5 or higher required! # COLLECTOR is only used by purify & quantify COLLECTOR = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld # BUILDSTAMP is used to generate local build vouchers BUILDSTAMP = $(TO_CORE)/scripts/buildstamp ifndef PLATFORM BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn endif # Define all tags based on the platform string. When a new platform # is added, add it to the list # # Brief description of -Ds: # # CAP # cap_save_the_world: support for creating a patched binary # cap_relocation: function relocation # cap_stripped_binaries: recursive parsing and function discovery without symbols # cap_async_events: # cap_ptrace: uses ptrace interface # cap_proc: uses /proc interface # cap_proc_ioctl: uses ioctl interface to proc # cap_proc_fd: uses solaris-style multiple-fd proc interface # cap_threads: support for threaded applications # cap_dynamic_heap: support for a dynamically growing inferior heap # cap_threaded_times: (Linux only) times() returns per-thread information. # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call. # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature # cap_32_64: platforms that support 32- and 64-bit mutatees # cap_liveness: liveness analysis # cap_fixpoint_gen: Generate code using a fixpoint method that saves space # cap_noaddr_gen: Allow code generation before determining the address code is going into # cap_mutatee_traps: Traps can be handled mutatee side # cap_instruction_api: System uses instruction API # cap_registers: User can access registers in snippets # cap_instruction_replacement: we use the replaceCode concept to implement (e.g.,) function call replacement # cap_tramp_liveness: we can run liveness over our trampolines to determine what's used # # BUG # bug_aix_broken_fork: AIX child process does not stop on fork if requested. # bug_syscall_changepc_rewind: Linux rewinds the PC by if # the change occurs within a system call; reported by SGI. # bug_freebsd_missing_sigstop: A stop followed by a continue and a new SIGSTOP # results in the new SIGSTOP event never being returned from waitpid # bug_freebsd_mt_suspend: threads do not suspend after an attach # bug_freebsd_change_pc: when changing the PC for a thread, the OS may not # schedule the thread if it is blocked in the kernel. # bug_phdrs_first_page: the OS requires that the program headers for a ELF # binary must reside in the first page of the binary on disk # bug_registers_after_exit: Linux throws an oops and kills the culprit thread # when it attempts to read registers via ptrace after a pre-Exit # bug_force_terminate_failure: during a ForceTerminate on Linux, there exists # an OS-level race condition where we will receive a Post-Exit event but the # process remains stopped ifeq ($(PLATFORM),i386-unknown-linux2.4) OLD_DEF = -Di386_unknown_linux2_0 ARCH_DEF = -Darch_x86 OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dcap_serialization -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_tramp_liveness BUG_DEF = -Dbug_syscall_changepc_rewind endif ifeq ($(PLATFORM),i386-unknown-linux2.6) OLD_DEF = -Di386_unknown_linux2_0 ARCH_DEF = -Darch_x86 OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_instruction_api -Dcap_serialization -Dcap_binary_rewriter -Dcap_virtual_registers -Dcap_instruction_replacement -Dcap_tramp_liveness BUG_DEF = -Dbug_syscall_changepc_rewind endif ifeq ($(PLATFORM),x86_64-unknown-linux2.4) OLD_DEF = -Dx86_64_unknown_linux2_4 ARCH_DEF = -Darch_x86_64 -Darch_64bit OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_relocation -Dcap_dwarf -Dcap_32_64 -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_registers -Dcap_instruction_api -Dcap_serialization -Dcap_instruction_replacement -Dcap_tramp_liveness BUG_DEF = -Dbug_syscall_changepc_rewind endif ifeq ($(PLATFORM),sparc-sun-solaris2.8) OLD_DEF = -Dsparc_sun_solaris2_4 ARCH_DEF = -Darch_sparc OS_DEF = -Dos_solaris CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \ -Dcap_syscall_trap -Dcap_serialization BUG_DEF = endif ifeq ($(PLATFORM),sparc-sun-solaris2.9) OLD_DEF = -Dsparc_sun_solaris2_4 ARCH_DEF = -Darch_sparc OS_DEF = -Dos_solaris CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf \ -Dcap_syscall_trap -Dcap_serialization BUG_DEF = endif ifeq ($(PLATFORM),rs6000-ibm-aix5.1) OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1 ARCH_DEF = -Darch_power OS_DEF = -Dos_aix 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 \ -Dcap_stackwalker_use_symtab BUG_DEF = endif ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2) OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1 ARCH_DEF = -Darch_power -Darch_64bit OS_DEF = -Dos_aix 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 -Dcap_32_64 BUG_DEF = endif ifeq ($(PLATFORM),ppc64_linux) OLD_DEF = -Dppc64_linux ARCH_DEF = -Darch_power -Darch_64bit OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \ -Dcap_32_64 -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_binary_rewriter -Dcap_instruction_api BUG_DEF = -Dbug_syscall_changepc_rewind -Dbug_registers_after_exit -Dbug_force_terminate_failure endif ifeq ($(PLATFORM),ppc32_linux) OLD_DEF = -Dppc32_linux ARCH_DEF = -Darch_power OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \ -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \ -Dcap_binary_rewriter BUG_DEF = -Dbug_syscall_changepc_rewind -Dbug_registers_after_exit -Dbug_force_terminate_failure endif ifeq ($(PLATFORM),ppc32_bgp) OLD_DEF = -Dppc32_linux ARCH_DEF = -Darch_power OS_DEF = -Dos_linux CAP_DEF = -Dcap_ptrace -Dcap_mutatee_traps -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness \ -Dcap_serialization -Dcap_registers -Dcap_instruction_replacement -Dcap_instruction_api \ -Dcap_binary_rewriter BUG_DEF = -Dbug_syscall_changepc_rewind endif ifeq ($(PLATFORM),ppc32_bgl_ion) OLD_DEF = -Dppc32_bluegene ARCH_DEF = -Darch_power OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_ion CAP_DEF = -Dcap_dwarf BUG_DEF = endif ifeq ($(PLATFORM),ppc32_bgl_compute) OLD_DEF = -Dppc32_bluegene ARCH_DEF = -Darch_powerO OS_DEF = -Dos_bg -Dos_bgl -Dos_bg_compute CAP_DEF = -Dcap_dwarf BUG_DEF = endif ifeq ($(PLATFORM),ppc32_bgp_ion) OLD_DEF = -Dppc32_bluegene ARCH_DEF = -Darch_power OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_ion CAP_DEF = -Dcap_dwarf BUG_DEF = endif ifeq ($(PLATFORM),ppc64_bgq_ion) OLD_DEF = -Dppc64_bluegene ARCH_DEF = -Darch_power -Darch_64bit OS_DEF = -Dos_bg -Dos_bgq -Dos_bgq_ion CAP_DEF = -Dcap_dwarf BUF_DEF = endif ifeq ($(PLATFORM),ppc32_bgp_compute) OLD_DEF = -Dppc32_bluegene ARCH_DEF = -Darch_power OS_DEF = -Dos_bg -Dos_bgp -Dos_bg_compute CAP_DEF = -Dcap_dwarf BUG_DEF = endif ifeq ($(PLATFORM),x86_64_catamount) OLD_DEF = -Dx86_64_catamount ARCH_DEF = -Darch_x86_64 -Darch_64bit OS_DEF = -Dos_catamount CAP_DEF = -Dcap_dwarf BUG_DEF = endif ifeq ($(PLATFORM),x86_64_cnl) OLD_DEF = -Dx86_64_cnl ARCH_DEF = -Darch_x86_64 -Darch_64bit OS_DEF = -Dos_linux -Dos_cnl 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_instruction_api BUG_DEF = -Dbug_syscall_changepc_rewind endif # ifeq ($(PLATFORM),ppc32-unknown-vxworks6.x) OLD_DEF = -Dppc32_vxworks ARCH_DEF = -Darch_power -Dtarget_ppc32 -Dtarget_smallmem -Dendian_mismatch OS_DEF = -Dos_vxworks CAP_DEF = -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dno_cap_serialization -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_instruction_api #CAP_DEF = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_stripped_binaries BUG_DEF = endif ifeq ($(PLATFORM),i386-unknown-vxworks6.x) OLD_DEF = -Di386_vxworks ARCH_DEF = -Darch_x86 -Dtarget_smallmem OS_DEF = -Dos_vxworks -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS CAP_DEF = -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dno_cap_serialization -Dcap_virtual_registers -Dcap_stackwalker_use_symtab -Dcap_cache_func_starts -Dcap_instruction_replacement -Dcap_instruction_api #CAP_DEF = -Dcap_mutatee_traps -Dcap_binary_rewriter -Dcap_stripped_binaries BUG_DEF = endif ifeq ($(PLATFORM),i386-unknown-freebsd7.2) OLD_DEF = -Di386_unknown_freebsd7_0 ARCH_DEF = -Darch_x86 OS_DEF = -Dos_freebsd CAP_DEF = -Dcap_instruction_api -Dcap_noaddr_gen -Dcap_dwarf -Dcap_binary_rewriter -Dcap_liveness -Dcap_fixpoint_gen -Dcap_registers -Dcap_instruction_replacement -Dcap_tramp_liveness -Dcap_relocation -Dcap_virtual_registers -Dcap_stripped_binaries -Dcap_threads -Dcap_mutatee_traps BUG_DEF = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page -Dbug_syscall_changepc_rewind -Dbug_freebsd_attach_stop endif ifeq ($(PLATFORM),amd64-unknown-freebsd7.2) OLD_DEF = -Damd64_unknown_freebsd7_0 ARCH_DEF = -Darch_x86_64 -Darch_64bit OS_DEF = -Dos_freebsd CAP_DEF = -Dcap_instruction_api -Dcap_noaddr_gen -Dcap_dwarf -Dcap_binary_rewriter -Dcap_liveness -Dcap_fixpoint_gen -Dcap_registers -Dcap_instruction_replacement -Dcap_tramp_liveness -Dcap_relocation -Dcap_virtual_registers -Dcap_stripped_binaries -Dcap_32_64 -Dcap_threads -Dcap_mutatee_traps BUG_DEF = -Dbug_freebsd_missing_sigstop -Dbug_freebsd_mt_suspend -Dbug_freebsd_change_pc -Dbug_phdrs_first_page -Dbug_syscall_changepc_rewind -Dbug_freebsd_attach_stop endif ifdef HAVE_THREAD_DB CAP_DEF += -Dcap_thread_db endif # Combine all the #defines for ease of use UNIFIED_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) $(AC_DEF) UNIFIED_TEST_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF) #ifeq (solaris,$(findstring solaris,$(PLATFORM))) ifeq (solaris,$(findstring solaris,$(OS_DEF))) #AS = /usr/ccs/bin/as RANLIB = true endif ifeq (linux,$(findstring linux,$(OS_DEF))) AS = /usr/bin/as RANLIB = true ASFLAGS = else ASFLAGS = -P $(UNIFIED_DEF) endif # set the macros that control whether the stdint limit and constant # macros are defined for C++ on the compilers command line so that # we don't have to worry about the ordering of #includes. ifeq (linux,$(findstring linux,$(PLATFORM))) STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS else ifeq (freebsd,$(findstring freebsd,$(PLATFORM))) STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS else ifeq (bluegene,$(findstring bluegene,$(PLATFORM))) STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS else ifeq (bgp,$(findstring bgp,$(PLATFORM))) STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS else STDINT_MACROS = endif endif endif endif # Default module compiler; modules which want $(CC) should redefine # this, **NOT** CC MODCC = $(CXX) MODCFLAGS = $(CXXFLAGS) DEPCC = $(MODCC) .SUFFIXES: .I # Added dyninst/external for included external dependencies - bernat, 11JUN07 IFLAGS = $(FIRST_INCLUDE) -I../h -I. -I$(TO_CORE) -I$(TO_CORE)/dynutil/h -I$(TO_CORE)/external # uncomment/comment the line below to build with/without compilation warnings # SILENCE_WARNINGS=true ifndef SILENCE_WARNINGS BASICWARNINGS = -W -Wall COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \ -Wcast-qual \ -Wredundant-decls -Woverloaded-virtual # not as strict as above, but can actually be used -- mdc USEFULWARNINGS = -W -Wall -Wpointer-arith \ -Wcast-qual \ -Woverloaded-virtual # being nice to poor old pathetic tcl/tk header files --ari TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \ -Wcast-qual \ -Woverloaded-virtual ifeq (solaris,$(findstring solaris,$(PLATFORM))) COMMONWARNINGS += -Wno-unknown-pragmas USEFULWARNINGS += -Wno-unknown-pragmas TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas else # STL on Solaris with cast-align generates a warning with much output COMMONWARNINGS += -Wcast-align USEFULWARNINGS += -Wcast-align endif endif # SILENCE_WARNINGS ifndef GCC_2_95 GCC_VER := $(shell gcc --version) ifneq (,$(findstring 2.95,$(GCC_VER))) GCC_2_95 = true endif endif ifndef OLD_GCC GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)') versionNumbers = $(sort $(GCC_VER) 2.95) versionNumber = $(firstword $(versionNumbers)) ifneq (2.95, $(versionNumber)) OLD_GCC = true endif endif ifndef OLD_GCC COMMONWARNINGS += -Wno-non-template-friend USEFULWARNINGS += -Wno-non-template-friend TCLFRIENDLYWARNINGS += -Wno-non-template-friend endif #don't inline -- for the files that won't emit template code INLINE_DEFINES = #inline the private members of the class -- templates.o can use this TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline" # inline everything -- the way things should be ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline" ifeq (solaris,$(findstring solaris,$(PLATFORM))) USES_LIBDYNINST_SO = true endif ifeq (linux,$(findstring linux,$(PLATFORM))) USES_LIBDYNINST_SO = true endif # Set this variable if it's desired that dyninst be built with the native # compiler on Solaris SOLARIS_NATIVE = #1 ifdef SOLARIS_NATIVE ifeq (solaris,$(findstring solaris,$(PLATFORM))) USES_LIBDYNINST_SO = true USES_NATIVE_CC = true NATIVE_CC = cc NATIVE_CXX = CC endif endif ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM))) ifndef IBM_BPATCH_COMPAT USES_LIBDYNINST_SO = true endif USES_PERF_LIBRARY = true # No longer used, because of relocation. #USES_LIB_TEXT_HEAP = true ifdef IBM_BPATCH_COMPAT ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM))) USES_NATIVE_CC = true NATIVE_CC = xlc NATIVE_CXX = xlC DEPCC = xlC DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC" endif endif # As of AIX 5, the pm_init function in libpmapi takes more # parameters. This is keyed by the USES_PMAPI_GROUPS define, # and handled in the paradyn runtime library PMAPI_VERSION := $(shell uname -v ) ifeq (5, $(findstring 5,$(PMAPI_VERSION))) USES_PMAPI_GROUPS = true endif endif # if we don't want OPT_FLAG defined for a particular part of the code # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing # the include of make.config - naim ifndef NO_OPT_FLAG OPT_FLAG = -O2 endif # Do we shorten compile lines? ifndef VERBOSE_COMPILATION HIDE_COMP = @ endif ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM))) ARCH_FLAGS = -maix64 -Drs6000_ibm_aix64 endif ifeq (ppc64_linux, $(findstring ppc64_linux, $(PLATFORM))) ARCH_FLAGS = -m64 endif # flags for normal (non-kludge) files, with common warnings CFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS) CXXFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS) LDFLAGS = $(ARCH_FLAGS) # flags for kludge files, won't have warnings generated KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS) ifdef COVERAGE CFLAGS += -fprofile-arcs -ftest-coverage CXXFLAGS += -fprofile-arcs -ftest-coverage LDFLAGS += -fprofile-arcs -ftest-coverage endif ifdef USING_PURIFY CFLAGS += -DPURE_BUILD CXXFLAGS += -DPURE_BUILD endif ifdef USES_PERF_LIBRARY # Add any platform-specific performance libraries here ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM))) USES_PMAPI = true CFLAGS += -DUSES_PMAPI CXXFLAGS += -DUSES_PMAPI LDFLAGS += -lpmapi ifdef USES_PMAPI_GROUPS CFLAGS += -DPMAPI_GROUPS CXXFLAGS += -DPMAPI_GROUPS endif # USES_PMAPI_GROUPS endif # ibm-aix endif # perf_library ifdef USE_DEPRECATED_BPATCH_VECTOR CXXFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR CFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR TFLAGS += -DUSE_DEPRECATED_BPATCH_VECTOR else #CFLAGS += -fimplicit-templates CXXFLAGS += -fimplicit-templates TFLAGS += -fimplicit-templates endif ifdef IBM_BPATCH_COMPAT CXXFLAGS += -DIBM_BPATCH_COMPAT CFLAGS += -DIBM_BPATCH_COMPAT endif ifndef OPT_FLAG KFLAGS += -g DEBUG_FLAG = -g endif ifeq ($(DEBUG_FLAG),none) DEBUG_FLAG = endif ifdef DEBUG_FLAG CFLAGS += $(DEBUG_FLAG) CXXFLAGS += $(DEBUG_FLAG) KFLAGS += $(DEBUG_FLAG) endif ifdef VERBOSE_CFG_ACCOUNTING CFLAGS += -DVERBOSE_CFG_FACTORY CXXFLAGS += -DVERBOSE_CFG_FACTORY endif # flags for template files, don't define external template flags # -g is optional in this case -- should be defined at module level TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS) ifdef DO_INLINE_ALL CFLAGS += $(ALL_INLINE_DEFINES) CXXFLAGS += $(ALL_INLINE_DEFINES) endif # Start off LIBDIR to point to the user's devel area's paradyn lib directory. # As a backup, in case the user hasn't checked out & compiled some paradyn lib, LIBDIR = $(FIRST_LIBDIR) \ -L$(TO_CORE)/../$(PLATFORM)/lib # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists, # else set it to just "igen" (i.e. assume it's in the user's path) ifdef CROSSCOMPILER 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 ) else 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 ) endif ifdef NO_IMPLICIT_TEMPLATES ifdef USE_DEPRECATED_BPATCH_VECTOR # CFLAGS += -fno-implicit-templates CXXFLAGS += -fno-implicit-templates KFLAGS += -fno-implicit-templates endif endif ifndef INSTANTIATE_TEMPLATES ifndef NO_IMPLICIT_TEMPLATES # -fexternal-templates and -Dexternal_templates should both be used or # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS # (but not to TFLAGS). # #CFLAGS += -fexternal-templates -Dexternal_templates #CXXFLAGS += -fexternal-templates -Dexternal_templates #KFLAGS += -fexternal-templates -Dexternal_templates endif endif THREADSLIB = USE_PTHREADS = yes ifeq (xyes,x$(USE_PTHREADS)) THREADSLIB += -lpthread # On Linux, programs using pthreads are supposed to define _REENTRANT ifeq (linux,$(findstring linux,$(PLATFORM))) CFLAGS += -D_REENTRANT=1 CXXFLAGS += -D_REENTRANT=1 KFLAGS += -D_REENTRANT=1 TFLAGS += -D_REENTRANT=1 endif # Ditto for FreeBSD ifeq (freebsd,$(findstring freebsd,$(PLATFORM))) CFLAGS += -D_REENTRANT=1 CXXFLAGS += -D_REENTRANT=1 KFLAGS += -D_REENTRANT=1 TFLAGS += -D_REENTRANT=1 endif ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM))) #CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 #CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 #KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 #TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 endif ifeq (solaris,$(findstring solaris,$(PLATFORM))) CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1 endif endif # System build constraints #Build the MT daemon on AIX, Solaris, and Linux/x86 DONT_BUILD_PD_MT = true ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM))) DONT_BUILD_PD_MT = endif ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM))) DONT_BUILD_PD_MT = endif ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM))) DONT_BUILD_PD_MT = endif ifeq (ppc32_bgp,$(findstring ppc32_bgp,$(PLATFORM))) DONT_BUILD_NEWTESTSUITE = true endif ifdef USES_MMTIMER CFLAGS += -Dcap_mmtimer CXXFLAGS += -Dcap_mmtimer endif ifdef USES_TCLTK ifndef TCLTK_DIR $(error error: TCLTK_DIR is not set. Please set in make.config.local) endif TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib TCLTK_INC_DIR ?= $(TCLTK_DIR)/include endif ifdef USES_UNWIND_LIB CFLAGS += -Dcap_unwind CXXFLAGS += -Dcap_unwind LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include endif ifeq (solaris,$(findstring solaris,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (linux,$(findstring linux,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (freebsd,$(findstring freebsd,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (vxworks,$(findstring vxworks,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (_bgq,$(findstring _bgq,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (_bgp,$(findstring _bgp,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (_bgl,$(findstring _bgl,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifeq (_cnl,$(findstring _cnl,$(PLATFORM))) LIBELF_PLATFORM = "true" LIBDWARF_PLATFORM = "true" endif ifdef HAVE_NATIVE_DEMANGLER LDFLAGS += -ldemangle CAP_DEF += -Dcap_native_demangler endif ifdef GNU_DEMANGLER CAP_DEF += -Dcap_gnu_demangler endif ifdef USE_LIBERTY CAP_DEF += -Dcap_liberty ifdef LINK_LIBERTY ifdef LIBIBERTY_LIB DEMANGLER_LINK = -L$(LIBIBERTY_LIB) -liberty else DEMANGLER_LINK = -liberty endif else CAP_DEF += -Dcap_liberty_exec ifdef LIBIBERTY_LIB DEMANGLER_EXEC_LINK = -L$(LIBIBERTY_LIB) -liberty else DEMANGLER_EXEC_LINK = -liberty endif endif endif ifdef USES_FLEX ifdef FLEX_DIR WITHLIBFL = --with-libfldir=$(FLEX_DIR) else WITHLIBFL = endif endif #Build other variables based off of the above defaults ifdef USES_TCLTK # use the first set if using tcl8.4, # use the second set if still using tcl8.3 ifndef USE_TCL83 TCLTK_LIBVER_ID = 8.4 CFLAGS += -DTCLCONST=const CXXFLAGS += -DTCLCONST=const KFLAGS += -DTCLCONST=const TFLAGS += -DTCLCONST=const else TCLTK_LIBVER_ID = 8.3 CFLAGS += -DTCLCONST="" CXXFLAGS += -DTCLCONST="" KFLAGS += -DTCLCONST="" TFLAGS += -DTCLCONST="" endif TCL_LIB = -ltcl$(TCLTK_LIBVER_ID) TK_LIB = -ltk$(TCLTK_LIBVER_ID) ifdef LIBTCLTKSTATIC TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic else TCLTK_LIBS += $(TCL_LIB) $(TK_LIB) endif # TCL2C is used to generate compilable sources from tcl files TCL2C = $(TO_CORE)/../scripts/tcl2c TCL2C_GEN_SRCS = tcl2c.C IFLAGS += -I$(TCLTK_INC_DIR) ifdef CROSSCOMPILER LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR)) else LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR)) endif endif # USES_TCLTK ifdef USES_PAPI PAPI_INCDIR = $(PAPI_ROOT) PAPI_LIBDIR = $(PAPI_ROOT) #PAPI_LIB = -Wl,-static -lpapi -Wl,-Bdynamic #PAPI_LIB = $(PAPI_LIBDIR)/libpapi.a PAPI_LIB = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi IFLAGS += -I$(PAPI_INCDIR) LIBDIR += $(patsubst %,-L%,$(PAPI_LIBDIR)) CFLAGS += -DPAPI CXXFLAGS += -DPAPI TFLAGS += -DPAPI endif ifdef USES_FLEX FLEX_LIB = -lfl ifdef FLEX_DIR LIBDIR += $(patsubst %,-L%,$(FLEX_DIR)) VPATH += $(FLEX_DIR) endif endif ifdef CROSSCOMPILER # no /s or /p allowed here #FLEX_DIR = /s/flex/rs_aix41/lib #LIBDIR += -L/p/sp2/gcc/lib endif ifdef LIBDWARF_HASSETFRAME CAP_DEF += -Ddwarf_has_setframe endif ifdef USES_X11 X11_LIB = -lX11 ifeq (solaris,$(findstring solaris,$(PLATFORM))) X11DIR = /usr/openwin CFLAGS += -I$(X11DIR)/include CXXFLAGS += -I$(X11DIR)/include TFLAGS += -I$(X11DIR)/include LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib endif ifeq (linux,$(findstring linux,$(PLATFORM))) X11DIR = /usr/X11R6 CFLAGS += -I$(X11DIR)/include/X11 CXXFLAGS += -I$(X11DIR)/include/X11 TFLAGS += -I$(X11DIR)/include/X11 LIBDIR += -L$(X11DIR)/lib endif ifeq (x86_64,$(findstring x86_64,$(PLATFORM))) LIBDIR += -L$(X11DIR)/lib64 endif ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM))) X11DIR = /usr endif endif # USES_X11