mods/additions largely under the USE_STL_VECTOR and IBM_BPATCH_COMPAT flags
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.107 2002/03/12 18:39:59 jaw 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 AS              = /bin/as
47 CC              = gcc
48 CXX             = g++
49 LEX             = flex
50 RANLIB          = ranlib
51 AR              = ar
52 YFLAGS          = -d -y
53 YACC            = bison
54 MV              = mv
55 CP              = cp
56 RM              = rm -f
57 MKDIR           = mkdir -p
58 PERL            = perl          # NB: perl v5 or higher required!
59
60 # COLLECTOR is only used by purify & quantify
61 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
62 # BUILDSTAMP is used to generate local build vouchers
63 BUILDSTAMP      = $(TO_CORE)/../scripts/buildstamp
64
65 ifdef PLATFORM
66 ARCH_DEF        = -D$(shell echo $$PLATFORM | $(PERL) -pe 's/\./_/g;s/-/_/g')
67 else
68 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
69 endif
70
71 # temporary hack overrides to provide "grand migration illusion"
72 # (these should be removed once definitions in sources are updated)
73 ifeq ($(PLATFORM),mips-sgi-irix6.5)
74 ARCH_DEF        = -Dmips_sgi_irix6_4
75 endif
76 ifeq ($(PLATFORM),i386-unknown-linux2.4)
77 ARCH_DEF        = -Di386_unknown_linux2_0
78 endif
79 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
80 ARCH_DEF        = -Dia64_unknown_linux2_4
81 endif
82 ifeq ($(PLATFORM),sparc-sun-solaris2.7)
83 ARCH_DEF        = -Dsparc_sun_solaris2_4
84 endif
85 ifeq ($(PLATFORM),rs6000-ibm-aix4.3)
86 ARCH_DEF        = -Drs6000_ibm_aix4_1
87 endif
88 ifeq ($(PLATFORM),rs6000-ibm-aix4.2)
89 ARCH_DEF        = -Drs6000_ibm_aix4_1
90 endif
91 # [temporary hack overrides]
92
93 ifdef CROSSCOMPILER
94 AS              = /p/sp2/gcc/bin/rs6000-gcc
95 CC              = /p/sp2/gcc/bin/rs6000-gcc
96 CXX             = /p/sp2/gcc/bin/rs6000-gcc
97 AR              = /p/sp2/gcc/rs6000/bin/ar
98 RANLIB          = /p/sp2/gcc/rs6000/bin/ranlib
99 endif
100
101 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
102 AS              = /usr/ccs/bin/as
103 RANLIB          = true
104 endif
105
106 ifeq (linux,$(findstring linux,$(PLATFORM)))
107 AS              = /usr/bin/as
108 RANLIB          = true 
109 endif
110
111
112 # Default module compiler; modules which want $(CC) should redefine
113 # this, **NOT** CC
114
115 MODCC           = $(CXX)
116 MODCFLAGS       = $(CXXFLAGS)
117
118 .SUFFIXES:      .I
119
120 IFLAGS          = -I. -I$(TO_CORE)
121
122 ASFLAGS         = -P $(ARCH_DEF)
123
124 # uncomment/comment the line below to build with/without compilation warnings
125 # SILENCE_WARNINGS=true
126
127 ifndef SILENCE_WARNINGS
128 BASICWARNINGS   = -W -Wall
129
130 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
131                 -Wcast-qual            \
132                 -Wconversion        \
133                 -Wmissing-prototypes             \
134                 -Wredundant-decls -Woverloaded-virtual
135
136 # not as strict as above, but can actually be used -- mdc
137 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
138                 -Wcast-qual            \
139                 -Wconversion        \
140                 -Wmissing-prototypes             \
141                 -Woverloaded-virtual
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 ifndef GCC_2_95
161 GCC_VER := $(shell gcc --version)
162 ifneq (,$(findstring 2.95,$(GCC_VER)))
163 GCC_2_95 = true
164 endif
165 endif
166
167 ifndef OLD_GCC
168 GCC_VER := $(shell gcc --version)
169 versionNumbers = $(sort $(GCC_VER), 2.95)
170 versionNumber  = $(firstword $(versionNumbers))
171 ifneq (2.95, $(versionNumber))
172 OLD_GCC = true
173 endif
174 endif
175
176 ifndef OLD_GCC
177 COMMONWARNINGS += -Wno-non-template-friend
178 USEFULWARNINGS += -Wno-non-template-friend
179 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
180 endif
181
182 #don't inline -- for the files that won't emit template code
183 INLINE_DEFINES = 
184
185 #inline the private members of the class -- templates.o can use this
186 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
187
188 # inline everything -- the way things should be
189 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
190
191 USES_MT_THREAD =
192
193 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
194 USES_LIBDYNINST_SO = true
195 USES_DYNAMIC_INF_HEAP = true
196 endif
197 ifeq (linux,$(findstring linux,$(PLATFORM)))
198 USES_LIBDYNINST_SO = true
199 USES_DYNAMIC_INF_HEAP = true
200   ifndef IBM_BPATCH_COMPAT
201     DETACH_ON_THE_FLY = true
202   endif
203 endif
204 ifeq (irix,$(findstring irix,$(PLATFORM)))
205 USES_LIBDYNINST_SO = true
206 USES_DYNAMIC_INF_HEAP = true
207 USES_NATIVE_CC = true
208 USE_IRIX_FIXES = true
209 endif
210 ifeq (osf,$(findstring osf,$(PLATFORM)))
211 USES_LIBDYNINST_SO = true
212 USES_DYNAMIC_INF_HEAP = true
213 endif
214 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
215 USES_LIBDYNINST_SO = true
216 USES_DYNAMIC_INF_HEAP = true
217 USES_PERF_LIBRARY = true
218 #USES_LIB_TEXT_HEAP = true
219 # Uncomment if you want to use cc to build the RT libraries
220 #USES_NATIVE_CC = true
221 endif
222
223 # if we don't want OPT_FLAG defined for a particular part of the code
224 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
225 # the include of make.config - naim
226 ifndef NO_OPT_FLAG
227 OPT_FLAG        = -O3
228 endif
229
230 # flags for normal (non-kludge) files, with common warnings
231 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
232 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
233
234 # flags for kludge files, won't have warnings generated
235 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
236
237 ifdef USING_PURIFY
238 CFLAGS          += -DPURE_BUILD
239 CXXFLAGS        += -DPURE_BUILD
240 endif
241
242 ifdef USES_MT_THREAD
243 CFLAGS          += -DMT_THREAD
244 CXXFLAGS        += -DMT_THREAD
245 endif
246
247 ifdef USES_PERF_LIBRARY
248 # Add any platform-specific performance libraries here
249 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
250 USES_PMAPI = true
251 endif
252 endif
253
254 ifdef USES_DYNAMIC_INF_HEAP
255 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
256 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
257 endif
258
259 ifdef USE_STL_VECTOR
260 CXXFLAGS        += -DUSE_STL_VECTOR
261 CFLAGS          += -fimplicit-templates
262 CXXFLAGS        += -fimplicit-templates
263 endif
264
265 ifdef IBM_BPATCH_COMPAT
266 CXXFLAGS        += -DIBM_BPATCH_COMPAT
267 CFLAGS          += -DIBM_BPATCH_COMPAT
268 endif
269
270 ifdef DETACH_ON_THE_FLY
271 CFLAGS          += -DDETACH_ON_THE_FLY
272 CXXFLAGS        += -DDETACH_ON_THE_FLY
273 endif
274
275 ifndef OPT_FLAG
276 KFLAGS          += -g
277 ifndef DEBUG_FLAG
278 DEBUG_FLAG = -g
279 endif
280 endif
281
282 ifeq ($(DEBUG_FLAG),none)
283 DEBUG_FLAG =
284 endif
285
286 ifdef DEBUG_FLAG
287 CFLAGS   += $(DEBUG_FLAG)
288 CXXFLAGS += $(DEBUG_FLAG)
289 KFLAGS   += $(DEBUG_FLAG)
290 endif
291
292 # flags for template files, don't define external template flags
293 # -g is optional in this case -- should be defined at module level
294 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
295
296 ifdef USES_MT_THREAD
297 TFLAGS          += -DMT_THREAD
298 endif
299
300 ifdef USE_STL_VECTOR
301 TFLAGS          += -DUSE_STL_VECTOR
302 TFLAGS          += -fimplicit-templates
303 endif
304
305 ifdef DETACH_ON_THE_FLY
306 TFLAGS          += -DDETACH_ON_THE_FLY
307 endif
308
309 ifdef USE_IRIX_FIXES
310 CFLAGS          += -DUSE_IRIX_FIXES
311 CXXFLAGS        += -DUSE_IRIX_FIXES
312 endif
313
314 ifdef DO_INLINE_ALL
315 CFLAGS         += $(ALL_INLINE_DEFINES)
316 CXXFLAGS       += $(ALL_INLINE_DEFINES)
317 endif
318
319 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
320 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
321 # we stick in (BACKUP_CORE)/lib _second_.
322 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
323                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
324
325 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
326 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
327 # else set it to just "igen" (i.e. assume it's in the user's path)
328 ifdef CROSSCOMPILER
329 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 )
330 else
331 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 )
332 endif
333
334 ifdef NO_IMPLICIT_TEMPLATES
335 ifndef USE_STL_VECTOR
336   CFLAGS                += -fno-implicit-templates
337   CXXFLAGS      += -fno-implicit-templates
338   KFLAGS                += -fno-implicit-templates
339 endif
340 endif
341
342 ifndef INSTANTIATE_TEMPLATES
343 ifndef NO_IMPLICIT_TEMPLATES
344 # -fexternal-templates and -Dexternal_templates should both be used or
345 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
346 # (but not to TFLAGS).
347 #
348 CFLAGS          +=  -fexternal-templates -Dexternal_templates
349 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
350 KFLAGS          +=  -fexternal-templates -Dexternal_templates
351 endif
352 endif
353
354 ifdef INCLUDE_CP_PROFILING
355 INCLUDE_PVM_SUPPORT=true
356 USES_PVM=true
357 endif
358
359 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
360
361 ifdef INCLUDE_PVM_SUPPORT
362 ifndef PVM_ROOT
363 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
364 endif
365 ifndef PVM_ARCH
366 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
367 endif
368 ifdef USES_PVM
369 PVM_INCDIR      = $(PVM_ROOT)/include
370 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
371 PVM_LIB         = -lpvm3
372 IFLAGS          += -I$(PVM_INCDIR)
373 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
374 VPATH           += $(PVM_LIBDIR)
375 endif
376 endif
377
378 ifdef USES_LIBHRTIME
379 HRTIME_ROOT     = /p/paradyn/packages/libhrtime-0.6
380 HRTIME_INCDIR   = $(HRTIME_ROOT)/include
381 HRTIME_LIBDIR   = $(HRTIME_ROOT)/lib
382 HRTIME_LIB      = -Wl,-static -lhrtime -Wl,-Bdynamic
383 IFLAGS          += -I$(HRTIME_INCDIR)
384 LIBDIR          += $(patsubst %,-L%,$(HRTIME_LIBDIR))
385 CFLAGS          += -DHRTIME
386 CXXFLAGS        += -DHRTIME
387 TFLAGS          += -DHRTIME
388 endif
389
390
391 ifdef USES_TCLTK
392
393 TCLTK_DIR       = /p/paradyn/packages/tcl8.3.0
394 TCLTK_INCLUDES  = $(TCLTK_DIR)/include
395 TCLTK_LIBVER_ID = 8.3
396 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
397 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
398 TCLTK_LIBS      = $(TCL_LIB) $(TK_LIB)
399
400 # TCL2C is used to generate compilable sources from tcl files
401 TCL2C           = $(TO_CORE)/../scripts/tcl2c
402 TCL2C_GEN_SRCS  = tcl2c.C
403
404 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
405 ifdef CROSSCOMPILER
406 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
407 else
408 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
409 endif
410 endif # USES_TCLTK
411
412 ifdef USES_FLEX
413 FLEX_LIB        = -lfl
414 FLEX_DIR        = /s/flex/lib
415 #FLEX_DIR       = /usr/imports/flex-2.5.4a/lib/
416 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
417 VPATH           += $(FLEX_DIR)
418 endif
419
420 ifdef CROSSCOMPILER
421 FLEX_DIR        = /s/flex/rs_aix41/lib
422 LIBDIR          += -L/p/sp2/gcc/lib 
423 endif
424
425 ifdef USES_LIBERTY
426 # Since libiberty.a is in the same g++ directory as libstdc++.a and
427 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
428 endif
429
430 ifdef USES_X11
431 X11_LIB         = -lX11
432
433 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
434 X11DIR          = /usr/openwin
435 CFLAGS          += -I$(X11DIR)/include
436 CXXFLAGS        += -I$(X11DIR)/include
437 TFLAGS          += -I$(X11DIR)/include
438 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
439 endif
440
441 ifeq (linux,$(findstring linux,$(PLATFORM)))
442 X11DIR          = /usr/X11R6
443 CFLAGS          += -I$(X11DIR)/include/X11
444 CXXFLAGS        += -I$(X11DIR)/include/X11
445 TFLAGS          += -I$(X11DIR)/include/X11
446 LIBDIR          += -L$(X11DIR)/lib
447 endif
448
449 ifeq (aix,$(findstring aix,$(PLATFORM)))
450 X11DIR          = /usr
451 endif
452
453 endif # USES_X11
454
455 THREADSLIB      =
456 #USE_PTHREADS    = no
457
458 ifeq (xyes,x$(USE_PTHREADS))
459 THREADSLIB      += -lpthread
460 endif
461
462 # System build constraints
463 ifneq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
464 DONT_BUILD_PD_MT=true
465 endif
466
467
468 # Include any per-user configuration changes; this "local" config file
469 # should *not* be under CVS control, so that it never gets committed.
470
471 -include $(TO_CORE)/make.config.local
472