1 # Paradyn overall build configuration (unix)
3 # $Id: make.config,v 1.170 2004/06/24 22:27:39 legendre Exp $
12 #IBM_BPATCH_COMPAT = 1
13 # Apart from actual "full" releases, don't modify these build Id components.
14 # For personal/experimental builds, feel free to use your core/make.config.local
15 # file to (re-)define BUILD_MARK as you desire.
17 # ***** IMPORTANT INSTALLATION/CONFIGURATION INSTRUCTIONS *****
18 # Unless your site is set-up identically to that of the Paradyn/DyninstAPI
19 # developers, you should carefully examine the (GNU)make configuration
20 # parameters defined in this file, particularly utilities such as the C/C++
21 # compilers, perl, flex and bison, and the installed locations and names
22 # for FLEX, TCL/TK, and X11
24 # most "main" modules are only two levels deep, but we need to be able to
25 # change this for those that are deeper in the tree
30 # Destinations for library and executable installation (relative to core!)
31 # Warning: modification of the build/install structure is not recommended!
32 LIBRARY_DEST = ../${PLATFORM}/lib
33 PROGRAM_DEST = ../${PLATFORM}/bin
35 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
36 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
37 # with cvs), then we should look in a backup location. That's what this vrble
38 # is about. It's used several times below in this file.
39 BACKUP_CORE = /p/paradyn/core
56 PERL = perl # NB: perl v5 or higher required!
58 # COLLECTOR is only used by purify & quantify
59 COLLECTOR = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
60 # BUILDSTAMP is used to generate local build vouchers
61 BUILDSTAMP = $(TO_CORE)/../scripts/buildstamp
64 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
67 # Define all tags based on the platform string. When a new platform
68 # is added, add it to the list
70 ifeq ($(PLATFORM),alpha-dec-osf5.1)
71 OLD_DEF = -Dalpha_dec_osf4_0
72 ARCH_DEF = -Darch_alpha
74 CAP_DEF = -Dcap_proc -Dcap_proc_ioctl
77 ifeq ($(PLATFORM),mips-sgi-irix6.5)
78 OLD_DEF = -Dmips_sgi_irix6_4
79 ARCH_DEF = -Darch_mips
81 CAP_DEF = -Dcap_proc -Dcap_proc_ioctl
82 BUG_DEF = -Dbug_irix_broken_sigstop
84 ifeq ($(PLATFORM),i386-unknown-linux2.4)
85 OLD_DEF = -Di386_unknown_linux2_0
87 OS_DEF = -Dos_linux=24
88 CAP_DEF = -Dcap_ptrace -Dcap_save_the_world
91 ifeq ($(PLATFORM),i386-unknown-linux2.6)
92 OLD_DEF = -Di386_unknown_linux2_0
94 OS_DEF = -Dos_linux=26
95 CAP_DEF = -Dcap_ptrace -Dcap_save_the_world
98 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
99 OLD_DEF = -Dia64_unknown_linux2_4
100 ARCH_DEF = -Darch_ia64
101 OS_DEF = -Dos_linux=24
102 CAP_DEF = -Dcap_ptrace
105 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
106 OLD_DEF = -Dsparc_sun_solaris2_4
107 ARCH_DEF = -Darch_sparc
108 OS_DEF = -Dos_solaris=8
109 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
112 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
113 OLD_DEF = -Dsparc_sun_solaris2_4
114 ARCH_DEF = -Darch_sparc
115 OS_DEF = -Dos_solaris=9
116 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
119 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
120 OLD_DEF = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
121 ARCH_DEF = -Darch_power
123 CAP_DEF = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
124 BUG_DEF = -Dbug_aix_proc_broken_fork
128 # Combine all the #defines for ease of use
129 UNIFIED_DEF = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
131 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
132 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
137 ifeq (linux,$(findstring linux,$(OS_DEF)))
142 ifeq (ia64,$(findstring ia64,$(ARCH_DEF)))
145 ASFLAGS = -P $(UNIFIED_DEF)
148 # set the macros that control whether the stdint limit and constant
149 # macros are defined for C++ on the compilers command line so that
150 # we don't have to worry about the ordering of #includes.
151 ifeq (linux,$(findstring linux,${PLATFORM}))
152 STDINT_MACROS = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
158 # Default module compiler; modules which want $(CC) should redefine
162 MODCFLAGS = $(CXXFLAGS)
164 DEPCFLAGS = -MM $(CFLAGS)
166 DEPCXXFLAGS = -MM $(CXXFLAGS)
171 IFLAGS = $(FIRST_INCLUDE) -I. -I$(TO_CORE) -I${TO_CORE}/../${PLATFORM}/include
173 # uncomment/comment the line below to build with/without compilation warnings
174 # SILENCE_WARNINGS=true
176 ifndef SILENCE_WARNINGS
177 BASICWARNINGS = -W -Wall
179 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
182 -Wredundant-decls -Woverloaded-virtual
184 # not as strict as above, but can actually be used -- mdc
185 USEFULWARNINGS = -W -Wall -Wpointer-arith \
188 -Woverloaded-virtual \
191 # being nice to poor old pathetic tcl/tk header files --ari
192 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
197 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
198 COMMONWARNINGS += -Wno-unknown-pragmas
199 USEFULWARNINGS += -Wno-unknown-pragmas
200 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
201 else # STL on Solaris with cast-align generates a warning with much output
202 COMMONWARNINGS += -Wcast-align
203 USEFULWARNINGS += -Wcast-align
205 endif # SILENCE_WARNINGS
209 GCC_VER := $(shell gcc --version)
210 ifneq (,$(findstring 2.95,$(GCC_VER)))
216 GCC_VER := $(shell gcc --version | head -1 | perl -ane 'print pop(@F)')
217 versionNumbers = $(sort $(GCC_VER) 2.95)
218 versionNumber = $(firstword $(versionNumbers))
219 ifneq (2.95, $(versionNumber))
225 COMMONWARNINGS += -Wno-non-template-friend
226 USEFULWARNINGS += -Wno-non-template-friend
227 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
230 #don't inline -- for the files that won't emit template code
233 #inline the private members of the class -- templates.o can use this
234 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
236 # inline everything -- the way things should be
237 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
241 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
242 USES_LIBDYNINST_SO = true
243 USES_DYNAMIC_INF_HEAP = true
245 ifeq (linux,$(findstring linux,$(PLATFORM)))
246 USES_LIBDYNINST_SO = true
247 USES_DYNAMIC_INF_HEAP = true
250 ifeq (irix,$(findstring irix,$(PLATFORM)))
251 USES_LIBDYNINST_SO = true
252 USES_DYNAMIC_INF_HEAP = true
253 USES_NATIVE_CC = true
258 # Set this variable if it's desired that dyninst be built with the native
259 # compiler on Solaris
263 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
264 USES_LIBDYNINST_SO = true
265 USES_DYNAMIC_INF_HEAP = true
266 USES_NATIVE_CC = true
272 ifeq (osf,$(findstring osf,$(PLATFORM)))
273 USES_LIBDYNINST_SO = true
274 USES_DYNAMIC_INF_HEAP = true
277 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
278 ifndef IBM_BPATCH_COMPAT
279 USES_LIBDYNINST_SO = true
282 USES_DYNAMIC_INF_HEAP = true
283 USES_PERF_LIBRARY = true
284 USES_LIB_TEXT_HEAP = true
286 ifdef IBM_BPATCH_COMPAT
287 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
288 USES_NATIVE_CC = true
292 DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
296 # As of AIX 5, the pm_init function in libpmapi takes more
297 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
298 # and handled in the paradyn runtime library
299 PMAPI_VERSION := $(shell uname -v )
300 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
301 USES_PMAPI_GROUPS = true
305 # if we don't want OPT_FLAG defined for a particular part of the code
306 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
307 # the include of make.config - naim
312 # flags for normal (non-kludge) files, with common warnings
313 CFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
314 CXXFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) ${STDINT_MACROS}
316 # flags for kludge files, won't have warnings generated
317 KFLAGS = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
319 CFLAGS += -DOLD_LINE_INFO
320 CXXFLAGS += -DOLD_LINE_INFO
324 CFLAGS += -fprofile-arcs -ftest-coverage
325 CXXFLAGS += -fprofile-arcs -ftest-coverage
326 LDFLAGS += -fprofile-arcs -ftest-coverage
331 CFLAGS += -DPURE_BUILD
332 CXXFLAGS += -DPURE_BUILD
336 CFLAGS += -DMT_THREAD
337 CXXFLAGS += -DMT_THREAD
340 ifeq (osf,$(findstring osf,$(PLATFORM)))
341 CFLAGS += -DOLD_LINE_INFO
342 CXXFLAGS += -DOLD_LINE_INFO
343 TFLAGS += -DOLD_LINE_INFO
345 ifdef USES_PERF_LIBRARY
346 # Add any platform-specific performance libraries here
347 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
349 CFLAGS += -DUSES_PMAPI
350 CXXFLAGS += -DUSES_PMAPI
352 ifdef USES_PMAPI_GROUPS
353 CFLAGS += -DPMAPI_GROUPS
354 CXXFLAGS += -DPMAPI_GROUPS
355 endif # USES_PMAPI_GROUPS
361 CXXFLAGS += -DAIX_PROC
364 ifdef USES_DYNAMIC_INF_HEAP
365 CFLAGS += -DUSES_DYNAMIC_INF_HEAP
366 CXXFLAGS += -DUSES_DYNAMIC_INF_HEAP
370 CXXFLAGS += -DUSE_STL_VECTOR
371 CFLAGS += -fimplicit-templates
372 CXXFLAGS += -fimplicit-templates
375 ifdef IBM_BPATCH_COMPAT
376 CXXFLAGS += -DIBM_BPATCH_COMPAT
377 CFLAGS += -DIBM_BPATCH_COMPAT
387 ifeq ($(DEBUG_FLAG),none)
392 CFLAGS += $(DEBUG_FLAG)
393 CXXFLAGS += $(DEBUG_FLAG)
394 KFLAGS += $(DEBUG_FLAG)
397 # flags for template files, don't define external template flags
398 # -g is optional in this case -- should be defined at module level
399 TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) ${STDINT_MACROS}
401 TFLAGS += -DOLD_LINE_INFO
404 TFLAGS += -DMT_THREAD
408 TFLAGS += -DUSE_STL_VECTOR
409 TFLAGS += -fimplicit-templates
413 CFLAGS += $(ALL_INLINE_DEFINES)
414 CXXFLAGS += $(ALL_INLINE_DEFINES)
417 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
418 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
419 # we stick in (BACKUP_CORE)/lib _second_.
420 LIBDIR = $(FIRST_LIBDIR) \
421 -L$(TO_CORE)/../lib/$(PLATFORM) \
422 -L$(TO_CORE)/../${PLATFORM}/lib \
423 -L$(BACKUP_CORE)/../lib/$(PLATFORM) \
424 -L$(BACKUP_CORE)/../$(PLATFORM)/lib
426 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
427 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
428 # else set it to just "igen" (i.e. assume it's in the user's path)
430 IGEN = $(shell if [ -f ${TO_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${TO_CORE}/../${BASEPLATFORM}/bin/igen; else if [ -f ${BACKUP_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${BACKUP_CORE}/../${BASEPLATFORM}/bin/igen; else echo igen; fi; fi )
432 IGEN = $(shell if [ -f ${TO_CORE}/${PROGRAM_DEST}/igen ]; then echo ${TO_CORE}/${PROGRAM_DEST}/igen; else if [ -f ${BACKUP_CORE}/${PROGRAM_DEST}/igen ]; then echo ${BACKUP_CORE}/${PROGRAM_DEST}/igen; else echo igen; fi; fi )
435 ifdef NO_IMPLICIT_TEMPLATES
436 ifndef USE_STL_VECTOR
437 # CFLAGS += -fno-implicit-templates
438 CXXFLAGS += -fno-implicit-templates
439 KFLAGS += -fno-implicit-templates
443 ifndef INSTANTIATE_TEMPLATES
444 ifndef NO_IMPLICIT_TEMPLATES
445 # -fexternal-templates and -Dexternal_templates should both be used or
446 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
447 # (but not to TFLAGS).
449 #CFLAGS += -fexternal-templates -Dexternal_templates
450 CXXFLAGS += -fexternal-templates -Dexternal_templates
451 KFLAGS += -fexternal-templates -Dexternal_templates
458 ifeq (xyes,x$(USE_PTHREADS))
459 THREADSLIB += -lpthread
461 # On Linux, programs using pthreads are supposed to define _REENTRANT
462 ifeq (linux,$(findstring linux,$(PLATFORM)))
463 CFLAGS += -D_REENTRANT=1
464 CXXFLAGS += -D_REENTRANT=1
465 KFLAGS += -D_REENTRANT=1
466 TFLAGS += -D_REENTRANT=1
469 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
470 #CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
471 #CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
472 #KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
473 #TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
476 ifeq (solaris,$(findstring linux,$(PLATFORM)))
477 CFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
478 CXXFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
479 KFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
480 TFLAGS += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
485 # System build constraints
486 #Build the MT daemon on AIX, Solaris, and Linux/x86
487 DONT_BUILD_PD_MT = true
488 ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
491 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
494 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
498 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
500 # Include any per-user configuration changes; this "local" config file
501 # should *not* be under CVS control, so that it never gets committed.
502 -include $(TO_CORE)/make.config.local
504 # Choose default development directories if necessary variables are unset
508 TCLTK_DIR ?= /p/paradyn/packages/tcl8.3.4
510 TCLTK_DIR ?= /p/paradyn/packages/tcl8.4.5
512 TCLTK_LIB_DIR ?= $(TCLTK_DIR)/lib
513 TCLTK_INC_DIR ?= $(TCLTK_DIR)/include
516 ifdef USES_UNWIND_LIB
517 LIBUNWINDDIR ?= /p/paradyn/packages/libunwind
518 LIBUNWIND_LIB ?= $(LIBUNWINDDIR)/lib
519 LIBUNWIND_INC ?= $(LIBUNWINDDIR)/include
522 ifdef USES_DWARF_DEBUG
523 LIBDWARFDIR ?= /p/paradyn/packages/libdwarf
524 LIBDWARF_INC ?= $(LIBDWARFDIR)/include
525 LIBDWARF_LIB ?= $(LIBDWARFDIR)/lib
529 LIBELFDIR ?= /p/paradyn/packages/libelf
530 LIBELF_INC ?= $(LIBELFDIR)/include
531 LIBELF_LIB ?= $(LIBELFDIR)/lib
535 PAPI_ROOT ?= /p/paradyn/packages/papi-3.0.0-test
539 FLEX_DIR ?= /s/flex/lib
542 NASM ?= /p/paradyn/packages/nasm/bin/nasm
544 #Build other variables based off of the above defaults
547 # use the first set if using tcl8.4,
548 # use the second set if still using tcl8.3
551 TCLTK_LIBVER_ID = 8.4
552 CFLAGS += -DTCLCONST=const
553 CXXFLAGS += -DTCLCONST=const
554 KFLAGS += -DTCLCONST=const
555 TFLAGS += -DTCLCONST=const
559 TCLTK_LIBVER_ID = 8.3
560 CFLAGS += -DTCLCONST=""
561 CXXFLAGS += -DTCLCONST=""
562 KFLAGS += -DTCLCONST=""
563 TFLAGS += -DTCLCONST=""
567 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
568 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
571 TCLTK_LIBS += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
573 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
576 # TCL2C is used to generate compilable sources from tcl files
577 TCL2C = $(TO_CORE)/../scripts/tcl2c
578 TCL2C_GEN_SRCS = tcl2c.C
580 IFLAGS += -I$(TCLTK_INC_DIR)
582 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
584 LIBDIR += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
590 PAPI_INCDIR = $(PAPI_ROOT)
591 PAPI_LIBDIR = $(PAPI_ROOT)
592 #PAPI_LIB = -Wl,-static -lpapi -Wl,-Bdynamic
593 #PAPI_LIB = $(PAPI_LIBDIR)/libpapi.a
594 PAPI_LIB = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi
595 IFLAGS += -I$(PAPI_INCDIR)
596 LIBDIR += $(patsubst %,-L%,$(PAPI_LIBDIR))
604 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
609 FLEX_DIR = /s/flex/rs_aix41/lib
610 LIBDIR += -L/p/sp2/gcc/lib
614 # Since libiberty.a is in the same g++ directory as libstdc++.a and
615 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
621 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
622 X11DIR = /usr/openwin
623 CFLAGS += -I$(X11DIR)/include
624 CXXFLAGS += -I$(X11DIR)/include
625 TFLAGS += -I$(X11DIR)/include
626 LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib
629 ifeq (linux,$(findstring linux,$(PLATFORM)))
631 CFLAGS += -I$(X11DIR)/include/X11
632 CXXFLAGS += -I$(X11DIR)/include/X11
633 TFLAGS += -I$(X11DIR)/include/X11
634 LIBDIR += -L$(X11DIR)/lib
637 ifeq (aix,$(findstring aix,$(PLATFORM)))