This commit enables arbitrary instrumentation points at the last instruction
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.134 2003/03/11 23:35:18 bernat Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 3.3
8 #BUILD_MARK     =
9 EXPLICIT_DEPENDS = 1
10 #USE_STL_VECTOR = 1
11 #IBM_BPATCH_COMPAT = 1
12 # Apart from actual "full" releases, don't modify these build Id components.
13 # For personal/experimental builds, feel free to use your core/make.config.local
14 # file to (re-)define BUILD_MARK as you desire.
15
16 # ***** IMPORTANT INSTALLATION/CONFIGURATION INSTRUCTIONS *****
17 # Unless your site is set-up identically to that of the Paradyn/DyninstAPI
18 # developers, you should carefully examine the (GNU)make configuration
19 # parameters defined in this file, particularly utilities such as the C/C++
20 # compilers, perl, flex and bison, and the installed locations and names
21 # for FLEX, TCL/TK, X11 and PVM (which is optional).
22
23 ifdef USES_PVM
24 # (PVM support only potentially relevant for paradynd)
25 # uncomment/comment the following line to build with/without PVM support
26 #INCLUDE_PVM_SUPPORT=true
27 endif
28
29 # most "main" modules are only two levels deep, but we need to be able to
30 # change this for those that are deeper in the tree
31 ifndef TO_CORE
32 TO_CORE         = ../..
33 endif
34
35 # Destinations for library and executable installation (relative to core!)
36 # Warning: modification of the build/install structure is not recommended!
37 LIBRARY_DEST    = ../lib/$(PLATFORM)
38 PROGRAM_DEST    = ../bin/$(PLATFORM)
39
40 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
41 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
42 # with cvs), then we should look in a backup location.  That's what this vrble
43 # is about.  It's used several times below in this file.
44 BACKUP_CORE = /p/paradyn/core
45
46 GCC             = gcc
47 GXX             = g++
48 LINKER          = ld
49 AS              = /bin/as
50 CC              = $(GCC)
51 CXX             = $(GXX)
52 LEX             = flex
53 RANLIB          = ranlib
54 AR              = ar
55 YFLAGS          = -d -y
56 YACC            = bison
57 MV              = mv
58 CP              = cp
59 RM              = rm -f
60 MKDIR           = mkdir -p
61 PERL            = perl          # NB: perl v5 or higher required!
62
63 # COLLECTOR is only used by purify & quantify
64 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
65 # BUILDSTAMP is used to generate local build vouchers
66 BUILDSTAMP      = $(TO_CORE)/../scripts/buildstamp
67
68 ifdef PLATFORM
69 ARCH_DEF        = -D$(shell echo $$PLATFORM | $(PERL) -pe 's/\./_/g;s/-/_/g')
70 else
71 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
72 endif
73
74 # temporary hack overrides to provide "grand migration illusion"
75 # (these should be removed once definitions in sources are updated)
76 ifeq ($(PLATFORM),mips-sgi-irix6.5)
77 ARCH_DEF        = -Dmips_sgi_irix6_4
78 endif
79 ifeq ($(PLATFORM),i386-unknown-linux2.4)
80 ARCH_DEF        = -Di386_unknown_linux2_0
81 endif
82 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
83 ARCH_DEF        = -Dia64_unknown_linux2_4
84 endif
85 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
86 ARCH_DEF        = -Dsparc_sun_solaris2_4
87 endif
88 ifeq ($(PLATFORM),rs6000-ibm-aix4.3)
89 ARCH_DEF        = -Drs6000_ibm_aix4_1
90 endif
91 ifeq ($(PLATFORM),rs6000-ibm-aix4.2)
92 ARCH_DEF        = -Drs6000_ibm_aix4_1
93 endif
94 # [temporary hack overrides]
95
96 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
97 AS              = /usr/ccs/bin/as
98 RANLIB          = true
99 endif
100
101 ifeq (linux,$(findstring linux,$(PLATFORM)))
102 AS              = /usr/bin/as
103
104 ifndef NASM
105 NASM            = nasm
106 endif
107 RANLIB          = true 
108 endif
109
110
111 # Default module compiler; modules which want $(CC) should redefine
112 # this, **NOT** CC
113
114 MODCC           = $(CXX)
115 MODCFLAGS       = $(CXXFLAGS)
116
117 .SUFFIXES:      .I
118
119 IFLAGS          = -I. -I$(TO_CORE)
120
121 ASFLAGS         = -P $(ARCH_DEF)
122
123 # uncomment/comment the line below to build with/without compilation warnings
124 # SILENCE_WARNINGS=true
125
126 ifndef SILENCE_WARNINGS
127 BASICWARNINGS   = -W -Wall -Wno-deprecated
128
129 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
130                 -Wcast-qual            \
131                 -Wconversion        \
132                 -Wmissing-prototypes             \
133                 -Wredundant-decls -Woverloaded-virtual
134
135 # not as strict as above, but can actually be used -- mdc
136 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
137                 -Wcast-qual            \
138                 -Wconversion        \
139                 -Wmissing-prototypes             \
140                 -Woverloaded-virtual \
141                 -Wno-deprecated
142
143 # being nice to poor old pathetic tcl/tk header files --ari
144 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
145                 -Wcast-qual \
146                 -Wconversion \
147                 -Wmissing-prototypes \
148                 -Woverloaded-virtual
149
150 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
151 COMMONWARNINGS       += -Wno-unknown-pragmas
152 USEFULWARNINGS       += -Wno-unknown-pragmas
153 TCLFRIENDLYWARNINGS  += -Wno-unknown-pragmas
154 else   # STL on Solaris with cast-align generates a warning with much output
155 COMMONWARNINGS       += -Wcast-align
156 USEFULWARNINGS       += -Wcast-align
157 endif
158 endif # SILENCE_WARNINGS
159
160
161 ifndef GCC_2_95
162 GCC_VER := $(shell gcc --version)
163 ifneq (,$(findstring 2.95,$(GCC_VER)))
164 GCC_2_95 = true
165 endif
166 endif
167
168 ifndef OLD_GCC
169 GCC_VER := $(shell gcc --version | head -1 | perl -ane 'print pop(@F)')
170 versionNumbers = $(sort $(GCC_VER) 2.95)
171 versionNumber  = $(firstword $(versionNumbers))
172 ifneq (2.95, $(versionNumber))
173 OLD_GCC = true
174 endif
175 endif
176
177 ifndef OLD_GCC
178 COMMONWARNINGS += -Wno-non-template-friend
179 USEFULWARNINGS += -Wno-non-template-friend
180 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
181 endif
182
183 #don't inline -- for the files that won't emit template code
184 INLINE_DEFINES = 
185
186 #inline the private members of the class -- templates.o can use this
187 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
188
189 # inline everything -- the way things should be
190 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
191
192 USES_MT_THREAD =
193
194 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
195 USES_LIBDYNINST_SO = true
196 USES_DYNAMIC_INF_HEAP = true
197 endif
198 ifeq (linux,$(findstring linux,$(PLATFORM)))
199 USES_LIBDYNINST_SO = true
200 USES_DYNAMIC_INF_HEAP = true
201 endif
202
203 ifeq (irix,$(findstring irix,$(PLATFORM)))
204 USES_LIBDYNINST_SO = true
205 USES_DYNAMIC_INF_HEAP = true
206 USES_NATIVE_CC = true
207 USE_IRIX_FIXES = true
208 NATIVE_CC      = cc
209 NATIVE_CXX     = CC
210 endif
211
212 # Set this variable if it's desired that dyninst be built with the native
213 # compiler on Solaris
214 SOLARIS_NATIVE =  #1
215
216 ifdef SOLARIS_NATIVE
217 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
218 USES_LIBDYNINST_SO = true
219 USES_DYNAMIC_INF_HEAP = true
220 USES_NATIVE_CC = true
221 NATIVE_CC      = cc
222 NATIVE_CXX     = CC
223 endif
224 endif
225
226 ifeq (osf,$(findstring osf,$(PLATFORM)))
227 USES_LIBDYNINST_SO = true
228 USES_DYNAMIC_INF_HEAP = true
229 endif
230 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
231 USES_LIBDYNINST_SO = true
232 USES_DYNAMIC_INF_HEAP = true
233 USES_PERF_LIBRARY = true
234 #USES_LIB_TEXT_HEAP = true
235 # Uncomment if you want to use cc to build the RT libraries
236 #USES_NATIVE_CC = true
237 # As of AIX 5, the pm_init function in libpmapi takes more
238 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
239 # and handled in the paradyn runtime library
240 PMAPI_VERSION := $(shell uname -v )
241 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
242 USES_PMAPI_GROUPS = true
243 endif
244 endif
245
246 # if we don't want OPT_FLAG defined for a particular part of the code
247 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
248 # the include of make.config - naim
249 ifndef NO_OPT_FLAG
250 OPT_FLAG        = -O2
251 endif
252
253 # flags for normal (non-kludge) files, with common warnings
254 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
255 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
256
257 # flags for kludge files, won't have warnings generated
258 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
259
260 ifdef USING_PURIFY
261 CFLAGS          += -DPURE_BUILD
262 CXXFLAGS        += -DPURE_BUILD
263 endif
264
265 ifdef USES_MT_THREAD
266 CFLAGS          += -DMT_THREAD
267 CXXFLAGS        += -DMT_THREAD
268 endif
269
270 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
271 #LDFLAGS += -lpthread
272 endif
273 ifdef USES_PERF_LIBRARY
274 # Add any platform-specific performance libraries here
275 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
276 USES_PMAPI = true
277 CFLAGS          += -DUSES_PMAPI
278 CXXFLAGS        += -DUSES_PMAPI
279 LDFLAGS         += -lpmapi
280 ifdef USES_PMAPI_GROUPS
281 CFLAGS          += -DPMAPI_GROUPS
282 CXXFLAGS        += -DPMAPI_GROUPS
283 endif # USES_PMAPI_GROUPS
284 endif # rs6000
285 endif # perf_library
286
287 ifdef USES_DYNAMIC_INF_HEAP
288 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
289 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
290 endif
291
292 ifdef USE_STL_VECTOR
293 CXXFLAGS        += -DUSE_STL_VECTOR
294 CFLAGS          += -fimplicit-templates
295 CXXFLAGS        += -fimplicit-templates
296 endif
297
298 ifdef IBM_BPATCH_COMPAT
299 CXXFLAGS        += -DIBM_BPATCH_COMPAT
300 CFLAGS          += -DIBM_BPATCH_COMPAT
301 endif
302
303 ifndef OPT_FLAG
304 KFLAGS          += -g
305 ifndef DEBUG_FLAG
306 DEBUG_FLAG = -g
307 endif
308 endif
309
310 ifeq ($(DEBUG_FLAG),none)
311 DEBUG_FLAG =
312 endif
313
314 ifdef DEBUG_FLAG
315 CFLAGS   += $(DEBUG_FLAG)
316 CXXFLAGS += $(DEBUG_FLAG)
317 KFLAGS   += $(DEBUG_FLAG)
318 endif
319
320 # flags for template files, don't define external template flags
321 # -g is optional in this case -- should be defined at module level
322 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
323
324 ifdef USES_MT_THREAD
325 TFLAGS          += -DMT_THREAD
326 endif
327
328 ifdef USE_STL_VECTOR
329 TFLAGS          += -DUSE_STL_VECTOR
330 TFLAGS          += -fimplicit-templates
331 endif
332
333 ifdef USE_IRIX_FIXES
334 CFLAGS          += -DUSE_IRIX_FIXES
335 CXXFLAGS        += -DUSE_IRIX_FIXES
336 endif
337
338 ifdef DO_INLINE_ALL
339 CFLAGS         += $(ALL_INLINE_DEFINES)
340 CXXFLAGS       += $(ALL_INLINE_DEFINES)
341 endif
342
343 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
344 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
345 # we stick in (BACKUP_CORE)/lib _second_.
346 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
347                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
348
349 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
350 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
351 # else set it to just "igen" (i.e. assume it's in the user's path)
352 ifdef CROSSCOMPILER
353 IGEN = $(shell if [ -f $(TO_CORE)/../bin/$(BASEPLATFORM)/igen ]; then echo $(TO_CORE)/../bin/$(BASEPLATFORM)/igen; else if [ -f $(BACKUP_CORE)/../bin/$(BASEPLATFORM)/igen ]; then echo $(BACKUP_CORE)/../bin/$(BASEPLATFORM)/igen; else echo igen; fi; fi )
354 else
355 IGEN = $(shell if [ -f $(TO_CORE)/../bin/$(PLATFORM)/igen ]; then echo $(TO_CORE)/../bin/$(PLATFORM)/igen; else if [ -f $(BACKUP_CORE)/../bin/$(PLATFORM)/igen ]; then echo $(BACKUP_CORE)/../bin/$(PLATFORM)/igen; else echo igen; fi; fi )
356 endif
357
358 ifdef NO_IMPLICIT_TEMPLATES
359 ifndef USE_STL_VECTOR
360   CFLAGS                += -fno-implicit-templates
361   CXXFLAGS      += -fno-implicit-templates
362   KFLAGS                += -fno-implicit-templates
363 endif
364 endif
365
366 ifndef INSTANTIATE_TEMPLATES
367 ifndef NO_IMPLICIT_TEMPLATES
368 # -fexternal-templates and -Dexternal_templates should both be used or
369 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
370 # (but not to TFLAGS).
371 #
372 CFLAGS          +=  -fexternal-templates -Dexternal_templates
373 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
374 KFLAGS          +=  -fexternal-templates -Dexternal_templates
375 endif
376 endif
377
378 ifdef INCLUDE_CP_PROFILING
379 INCLUDE_PVM_SUPPORT=true
380 USES_PVM=true
381 endif
382
383 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
384
385 ifdef INCLUDE_PVM_SUPPORT
386 ifndef PVM_ROOT
387 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
388 endif
389 ifndef PVM_ARCH
390 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
391 endif
392 ifdef USES_PVM
393 PVM_INCDIR      = $(PVM_ROOT)/include
394 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
395 PVM_LIB         = -lpvm3
396 IFLAGS          += -I$(PVM_INCDIR)
397 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
398 VPATH           += $(PVM_LIBDIR)
399 endif
400 endif
401
402 ifdef USES_LIBHRTIME
403 HRTIME_ROOT     = /p/paradyn/packages/libhrtime-0.6
404 HRTIME_INCDIR   = $(HRTIME_ROOT)/include
405 HRTIME_LIBDIR   = $(HRTIME_ROOT)/lib
406 HRTIME_LIB      = -Wl,-static -lhrtime -Wl,-Bdynamic
407 IFLAGS          += -I$(HRTIME_INCDIR)
408 LIBDIR          += $(patsubst %,-L%,$(HRTIME_LIBDIR))
409 CFLAGS          += -DHRTIME
410 CXXFLAGS        += -DHRTIME
411 TFLAGS          += -DHRTIME
412 endif
413
414 ifdef USES_PAPI
415 PAPI_ROOT       = /p/paradyn/packages/papi-3.0.0-test
416 PAPI_INCDIR     = $(PAPI_ROOT)
417 PAPI_LIBDIR     = $(PAPI_ROOT)
418 #PAPI_LIB       = -Wl,-static -lpapi -Wl,-Bdynamic
419 #PAPI_LIB       = $(PAPI_LIBDIR)/libpapi.a
420 PAPI_LIB        = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi  
421 IFLAGS          += -I$(PAPI_INCDIR)
422 LIBDIR          += $(patsubst %,-L%,$(PAPI_LIBDIR))
423 CFLAGS          += -DPAPI 
424 CXXFLAGS        += -DPAPI
425 TFLAGS          += -DPAPI 
426 endif
427
428 ifdef USES_TCLTK
429
430 TCLTK_DIR       = /p/paradyn/packages/tcl8.3.4
431 TCLTK_INCLUDES  = $(TCLTK_DIR)/include
432 TCLTK_LIBVER_ID = 8.3
433 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
434 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
435 TCLTK_LIBS      += $(TCL_LIB) $(TK_LIB)
436
437 # TCL2C is used to generate compilable sources from tcl files
438 TCL2C           = $(TO_CORE)/../scripts/tcl2c
439 TCL2C_GEN_SRCS  = tcl2c.C
440
441 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
442 ifdef CROSSCOMPILER
443 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
444 else
445 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
446 endif
447
448 endif # USES_TCLTK
449
450 ifdef USES_FLEX
451 FLEX_LIB        = -lfl
452 FLEX_DIR        = /s/flex/lib
453 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
454 VPATH           += $(FLEX_DIR)
455 endif
456
457 ifdef CROSSCOMPILER
458 FLEX_DIR        = /s/flex/rs_aix41/lib
459 LIBDIR          += -L/p/sp2/gcc/lib 
460 endif
461
462 ifdef USES_LIBERTY
463 # Since libiberty.a is in the same g++ directory as libstdc++.a and
464 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
465 endif
466
467 ifdef USES_X11
468 X11_LIB         = -lX11
469
470 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
471 X11DIR          = /usr/openwin
472 CFLAGS          += -I$(X11DIR)/include
473 CXXFLAGS        += -I$(X11DIR)/include
474 TFLAGS          += -I$(X11DIR)/include
475 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
476 endif
477
478 ifeq (linux,$(findstring linux,$(PLATFORM)))
479 X11DIR          = /usr/X11R6
480 CFLAGS          += -I$(X11DIR)/include/X11
481 CXXFLAGS        += -I$(X11DIR)/include/X11
482 TFLAGS          += -I$(X11DIR)/include/X11
483 LIBDIR          += -L$(X11DIR)/lib
484 endif
485
486 ifeq (aix,$(findstring aix,$(PLATFORM)))
487 X11DIR          = /usr
488 endif
489
490 endif # USES_X11
491
492 THREADSLIB      =
493 USE_PTHREADS    = yes
494
495 ifeq (xyes,x$(USE_PTHREADS))
496 THREADSLIB      += -lpthread
497
498 # On Linux, programs using pthreads are supposed to define _REENTRANT
499 ifeq (linux,$(findstring linux,$(PLATFORM)))
500 CFLAGS                  += -D_REENTRANT=1
501 CXXFLAGS                += -D_REENTRANT=1
502 KFLAGS                  += -D_REENTRANT=1
503 TFLAGS                  += -D_REENTRANT=1
504 endif
505
506 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
507 #CFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
508 #CXXFLAGS               += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
509 #KFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
510 #TFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
511 endif
512
513 ifeq (solaris,$(findstring linux,$(PLATFORM)))
514 CFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
515 CXXFLAGS                += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
516 KFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
517 TFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
518 endif
519
520 endif
521
522 # System build constraints
523 # if not on solaris or aix, then don't build the MT daemon
524 ifeq ($(strip $(join $(findstring sparc-sun-solaris,$(PLATFORM)), $(findstring rs6000-ibm-aix,$(PLATFORM)))),)
525         DONT_BUILD_PD_MT=true;
526 endif
527
528
529 # Include any per-user configuration changes; this "local" config file
530 # should *not* be under CVS control, so that it never gets committed.
531
532 -include $(TO_CORE)/make.config.local
533