New interfaces for `usesTrap' and `canUseExtraSlot'.
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.78 2000/08/31 21:17:04 bernat Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 3.1
8 #BUILD_MARK     =
9
10 # Apart from actual "full" releases, don't modify these build Id components.
11 # For personal/experimental builds, feel free to use your core/make.config.local
12 # file to (re-)define BUILD_MARK as you desire.
13
14 # ***** IMPORTANT INSTALLATION/CONFIGURATION INSTRUCTIONS *****
15 # Unless your site is set-up identically to that of the Paradyn/DyninstAPI
16 # developers, you should carefully examine the (GNU)make configuration
17 # parameters defined in this file, particularly utilities such as the C/C++
18 # compilers, perl, flex and bison, and the installed locations and names
19 # for FLEX, TCL/TK, X11 and PVM (which is optional).
20
21 ifdef USES_PVM
22 # (PVM support only potentially relevant for paradynd)
23 # uncomment/comment the following line to build with/without PVM support
24 INCLUDE_PVM_SUPPORT=true
25 endif
26
27 # most "main" modules are only two levels deep, but we need to be able to
28 # change this for those that are deeper in the tree
29 ifndef TO_CORE
30 TO_CORE         = ../..
31 endif
32
33 # Destinations for library and executable installation (relative to core!)
34 # Warning: modification of the build/install structure is not recommended!
35 LIBRARY_DEST    = ../lib/$(PLATFORM)
36 PROGRAM_DEST    = ../bin/$(PLATFORM)
37
38 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
39 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
40 # with cvs), then we should look in a backup location.  That's what this vrble
41 # is about.  It's used several times below in this file.
42 BACKUP_CORE = /p/paradyn/core
43
44 AS              = /bin/as
45 CC              = gcc
46 CXX             = g++
47 LEX             = flex
48 RANLIB          = ranlib
49 AR              = ar
50 YFLAGS          = -d -y
51 YACC            = bison
52 MV              = mv
53 CP              = cp
54 RM              = rm -f
55 MKDIR           = mkdir -p
56 PERL            = perl          # NB: perl v5 or higher required!
57
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
62
63 ifdef PLATFORM
64 ARCH_DEF        = -D$(shell echo $$PLATFORM | $(PERL) -pe 's/\./_/g;s/-/_/g')
65 else
66 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
67 endif
68
69 # temporary hack overrides to provide "grand migration illusion"
70 # (these should be removed once definitions in sources are updated)
71 ifeq ($(PLATFORM),mips-sgi-irix6.5)
72 ARCH_DEF        = -Dmips_sgi_irix6_4
73 endif
74 ifeq ($(PLATFORM),i386-unknown-linux2.2)
75 ARCH_DEF        = -Di386_unknown_linux2_0
76 endif
77 ifeq ($(PLATFORM),i386-unknown-solaris2.6)
78 ARCH_DEF        = -Di386_unknown_solaris2_5
79 endif
80 ifeq ($(PLATFORM),sparc-sun-solaris2.6)
81 ARCH_DEF        = -Dsparc_sun_solaris2_4
82 endif
83 ifeq ($(PLATFORM),rs6000-ibm-aix4.3)
84 ARCH_DEF        = -Drs6000_ibm_aix4_1
85 endif
86 ifeq ($(PLATFORM),rs6000-ibm-aix4.2)
87 ARCH_DEF        = -Drs6000_ibm_aix4_1
88 endif
89 # [temporary hack overrides]
90
91 ifdef CROSSCOMPILER
92 AS              = /p/sp2/gcc/bin/rs6000-gcc
93 CC              = /p/sp2/gcc/bin/rs6000-gcc
94 CXX             = /p/sp2/gcc/bin/rs6000-gcc
95 AR              = /p/sp2/gcc/rs6000/bin/ar
96 RANLIB          = /p/sp2/gcc/rs6000/bin/ranlib
97 endif
98
99 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
100 AS              = /usr/ccs/bin/as
101 RANLIB          = true
102 endif
103
104 ifeq (linux,$(findstring linux,$(PLATFORM)))
105 AS              = /usr/bin/as
106 RANLIB          = true 
107 endif
108
109
110 # Default module compiler; modules which want $(CC) should redefine
111 # this, **NOT** CC
112
113 MODCC           = $(CXX)
114 MODCFLAGS       = $(CXXFLAGS)
115
116 .SUFFIXES:      .I
117
118 IFLAGS          = -I. -I$(TO_CORE)
119
120 ASFLAGS         = -P $(ARCH_DEF)
121
122 # uncomment/comment the line below to build with/without compilation warnings
123 # SILENCE_WARNINGS=true
124
125 ifndef SILENCE_WARNINGS
126 BASICWARNINGS   = -W -Wall
127
128 COMMONWARNINGS  = -W -Wall -Wtraditional -Wshadow -Wpointer-arith       \
129                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
130                 -Wconversion -Wstrict-prototypes        \
131                 -Wmissing-prototypes -Wmissing-declarations             \
132                 -Wredundant-decls -Woverloaded-virtual
133
134 # not as strict as above, but can actually be used -- mdc
135 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
136                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
137                 -Wconversion -Wstrict-prototypes        \
138                 -Wmissing-prototypes -Wmissing-declarations             \
139                 -Woverloaded-virtual
140
141 # being nice to poor old pathetic tcl/tk header files --ari
142 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
143                 -Wbad-function-cast -Wcast-qual \
144                 -Wconversion -Wstrict-prototypes \
145                 -Wmissing-prototypes -Wmissing-declarations \
146                 -Woverloaded-virtual
147 endif # SILENCE_WARNINGS
148
149 ifndef GCC_2_95
150 GCC_VER := $(shell gcc --version)
151 ifneq (,$(findstring 2.95,$(GCC_VER)))
152 GCC_2_95 = true
153 endif
154 endif
155
156 ifdef GCC_2_95
157 COMMONWARNINGS += -Wno-non-template-friend
158 USEFULWARNINGS += -Wno-non-template-friend
159 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
160 endif
161
162 #don't inline -- for the files that won't emit template code
163 INLINE_DEFINES = 
164
165 #inline the private members of the class -- templates.o can use this
166 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
167
168 # inline everything -- the way things should be
169 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
170
171 USES_MT_THREAD =
172
173 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
174 USES_LIBDYNINSTRT_SO = true
175 USES_LIBDYNINST_SO = true
176 USES_DYNAMIC_INF_HEAP = true
177 endif
178 ifeq (linux,$(findstring linux,$(PLATFORM)))
179 USES_LIBDYNINSTRT_SO = true
180 USES_LIBDYNINST_SO = true
181 USES_DYNAMIC_INF_HEAP = true
182 DETACH_ON_THE_FLY = true
183 endif
184 ifeq (irix,$(findstring irix,$(PLATFORM)))
185 USES_LIBDYNINSTRT_SO = true
186 USES_LIBDYNINST_SO = true
187 USES_DYNAMIC_INF_HEAP = true
188 USES_NATIVE_CC = true
189 endif
190 ifeq (osf,$(findstring osf,$(PLATFORM)))
191 USES_LIBDYNINSTRT_SO = true
192 USES_LIBDYNINST_SO = true
193 USES_DYNAMIC_INF_HEAP = true
194 endif
195 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
196 #USES_LIBDYNINSTRT_SO = false
197 USES_LIBDYNINST_SO = false
198 USES_DYNAMIC_INF_HEAP = true
199 endif
200
201 # if we don't want OPT_FLAG defined for a particular part of the code
202 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
203 # the include of make.config - naim
204 ifndef NO_OPT_FLAG
205 OPT_FLAG        = -O3
206 endif
207
208 # flags for normal (non-kludge) files, with common warnings
209 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
210 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
211
212 # flags for kludge files, won't have warnings generated
213 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
214
215 ifdef USING_PURIFY
216 CFLAGS          += -DPURE_BUILD
217 CXXFLAGS        += -DPURE_BUILD
218 endif
219
220 ifdef USES_MT_THREAD
221 CFLAGS          += -DMT_THREAD
222 CXXFLAGS        += -DMT_THREAD
223 endif
224
225 ifdef USES_LIBDYNINSTRT_SO
226 CFLAGS          += -DUSES_LIBDYNINSTRT_SO
227 CXXFLAGS        += -DUSES_LIBDYNINSTRT_SO
228 endif
229
230 ifdef USES_DYNAMIC_INF_HEAP
231 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
232 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
233 endif
234
235 ifdef DETACH_ON_THE_FLY
236 CFLAGS          += -DDETACH_ON_THE_FLY
237 CXXFLAGS        += -DDETACH_ON_THE_FLY
238 endif
239
240 ifndef OPT_FLAG
241 KFLAGS          += -g
242 ifndef DEBUG_FLAG
243 DEBUG_FLAG = -g
244 endif
245 endif
246
247 ifeq ($(DEBUG_FLAG),none)
248 DEBUG_FLAG =
249 endif
250
251 ifdef DEBUG_FLAG
252 CFLAGS   += $(DEBUG_FLAG)
253 CXXFLAGS += $(DEBUG_FLAG)
254 KFLAGS   += $(DEBUG_FLAG)
255 endif
256
257 # flags for template files, don't define external template flags
258 # -g is optional in this case -- should be defined at module level
259 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
260
261 ifdef USES_MT_THREAD
262 TFLAGS          += -DMT_THREAD
263 endif
264
265 ifdef USES_LIBDYNINSTRT_SO
266 TFLAGS          += -DUSES_LIBDYNINSTRT_SO
267 endif
268
269 ifdef DETACH_ON_THE_FLY
270 TFLAGS          += -DDETACH_ON_THE_FLY
271 endif
272
273 ifdef DO_INLINE_ALL
274 CFLAGS         += $(ALL_INLINE_DEFINES)
275 CXXFLAGS       += $(ALL_INLINE_DEFINES)
276 endif
277
278 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
279 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
280 # we stick in (BACKUP_CORE)/lib _second_.
281 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
282                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
283
284 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
285 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
286 # else set it to just "igen" (i.e. assume it's in the user's path)
287 ifdef CROSSCOMPILER
288 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 )
289 else
290 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 )
291 endif
292
293 ifdef NO_IMPLICIT_TEMPLATES
294 CFLAGS          += -fno-implicit-templates
295 CXXFLAGS        += -fno-implicit-templates
296 KFLAGS          += -fno-implicit-templates
297 endif
298
299 ifndef INSTANTIATE_TEMPLATES
300 ifndef NO_IMPLICIT_TEMPLATES
301 # -fexternal-templates and -Dexternal_templates should both be used or
302 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
303 # (but not to TFLAGS).
304 #
305 CFLAGS          +=  -fexternal-templates -Dexternal_templates
306 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
307 KFLAGS          +=  -fexternal-templates -Dexternal_templates
308 endif
309 endif
310
311 ifdef INCLUDE_CP_PROFILING
312 INCLUDE_PVM_SUPPORT=true
313 USES_PVM=true
314 endif
315
316 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
317
318 ifdef INCLUDE_PVM_SUPPORT
319 ifndef PVM_ROOT
320 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
321 endif
322 ifndef PVM_ARCH
323 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
324 endif
325 ifdef USES_PVM
326 PVM_INCDIR      = $(PVM_ROOT)/include
327 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
328 PVM_LIB         = -lpvm3
329 IFLAGS          += -I$(PVM_INCDIR)
330 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
331 VPATH           += $(PVM_LIBDIR)
332 endif
333 endif
334
335 ifdef USES_TCLTK
336
337 TCLTK_DIR       = /p/paradyn/packages/tcl8.3.0
338 TCLTK_INCLUDES  = $(TCLTK_DIR)/include
339 TCLTK_LIBVER_ID = 8.3
340 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
341 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
342 TCLTK_LIBS      = $(TCL_LIB) $(TK_LIB)
343
344 # TCL2C is used to generate compilable sources from tcl files
345 TCL2C           = $(TO_CORE)/../scripts/tcl2c
346 TCL2C_GEN_SRCS  = tcl2c.C
347
348 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
349 ifdef CROSSCOMPILER
350 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
351 else
352 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
353 endif
354 endif # USES_TCLTK
355
356 ifdef USES_FLEX
357 FLEX_LIB        = -lfl
358 FLEX_DIR        = /s/flex/lib
359 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
360 VPATH           += $(FLEX_DIR)
361 endif
362
363 ifdef CROSSCOMPILER
364 FLEX_DIR        = /s/flex/rs_aix41/lib
365 LIBDIR          += -L/p/sp2/gcc/lib 
366 endif
367
368 ifdef USES_LIBERTY
369 # Since libiberty.a is in the same g++ directory as libstdc++.a and
370 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
371 endif
372
373 ifdef USES_X11
374 X11_LIB         = -lX11
375
376 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
377 ## current releases of /usr/openwin have bad include files, however,
378 ## if that's what you have and you're prepared to live with it, go ahead
379 #X11DIR         = /usr/openwin
380 #CFLAGS         += -fpermissive
381 #TFLAGS         += -fpermissive
382 #CXXFLAGS       += -fpermissive
383 #else
384 X11DIR          = /usr/X11R6
385 #endif
386
387 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
388 CFLAGS          += -I$(X11DIR)/include
389 CXXFLAGS        += -I$(X11DIR)/include
390 TFLAGS          += -I$(X11DIR)/include
391 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
392 VPATH           += $(X11DIR)/lib
393 endif
394
395 ifeq (linux,$(findstring linux,$(PLATFORM)))
396 CFLAGS          += -I$(X11DIR)/include/X11
397 CXXFLAGS        += -I$(X11DIR)/include/X11
398 TFLAGS          += -I$(X11DIR)/include/X11
399 LIBDIR          += -L$(X11DIR)/lib
400 VPATH           += $(X11DIR)/include/X11
401 endif
402
403 endif # USES_X11
404
405 # Include any per-user configuration changes; this "local" config file
406 # should *not* be under CVS control, so that it never gets committed.
407
408 -include $(TO_CORE)/make.config.local