include 64bit type limit defines and literal defining macros
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.75 2000/07/18 19:54:06 bernat Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 3.0
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 XFLAGS += -fpermissive
161 endif
162
163 #don't inline -- for the files that won't emit template code
164 INLINE_DEFINES = 
165
166 #inline the private members of the class -- templates.o can use this
167 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
168
169 # inline everything -- the way things should be
170 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
171
172 USES_MT_THREAD =
173
174 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
175 USES_LIBDYNINSTRT_SO = true
176 USES_LIBDYNINST_SO = true
177 USES_DYNAMIC_INF_HEAP = true
178 endif
179 ifeq (linux,$(findstring linux,$(PLATFORM)))
180 USES_LIBDYNINSTRT_SO = true
181 USES_LIBDYNINST_SO = true
182 USES_DYNAMIC_INF_HEAP = true
183 DETACH_ON_THE_FLY = true
184 endif
185 ifeq (irix,$(findstring irix,$(PLATFORM)))
186 USES_LIBDYNINSTRT_SO = true
187 USES_LIBDYNINST_SO = true
188 USES_DYNAMIC_INF_HEAP = true
189 USES_NATIVE_CC = true
190 endif
191 ifeq ($(PLATFORM),alpha-dec-osf4.0)
192 USES_LIBDYNINSTRT_SO = true
193 USES_LIBDYNINST_SO = true
194 USES_DYNAMIC_INF_HEAP = true
195 endif
196 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
197 #USES_LIBDYNINSTRT_SO = false
198 #USESLIBDYNINST_SO = false
199 USES_DYNAMIC_INF_HEAP = true
200 endif
201
202 # if we don't want OPT_FLAG defined for a particular part of the code
203 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
204 # the include of make.config - naim
205 ifndef NO_OPT_FLAG
206 OPT_FLAG        = -O3
207 endif
208
209 # flags for normal (non-kludge) files, with common warnings
210 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
211 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
212
213 # flags for kludge files, won't have warnings generated
214 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
215
216 ifdef USING_PURIFY
217 CFLAGS          += -DPURE_BUILD
218 CXXFLAGS        += -DPURE_BUILD
219 endif
220
221 ifdef USES_MT_THREAD
222 CFLAGS          += -DMT_THREAD
223 CXXFLAGS        += -DMT_THREAD
224 endif
225
226 ifdef USES_LIBDYNINSTRT_SO
227 CFLAGS          += -DUSES_LIBDYNINSTRT_SO
228 CXXFLAGS        += -DUSES_LIBDYNINSTRT_SO
229 endif
230
231 ifdef USES_DYNAMIC_INF_HEAP
232 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
233 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
234 endif
235
236 ifdef DETACH_ON_THE_FLY
237 CFLAGS          += -DDETACH_ON_THE_FLY
238 CXXFLAGS        += -DDETACH_ON_THE_FLY
239 endif
240
241 ifndef OPT_FLAG
242 KFLAGS          += -g
243 ifndef DEBUG_FLAG
244 DEBUG_FLAG = -g
245 endif
246 endif
247
248 ifeq ($(DEBUG_FLAG),none)
249 DEBUG_FLAG =
250 endif
251
252 ifdef DEBUG_FLAG
253 CFLAGS   += $(DEBUG_FLAG)
254 CXXFLAGS += $(DEBUG_FLAG)
255 KFLAGS   += $(DEBUG_FLAG)
256 endif
257
258 # flags for template files, don't define external template flags
259 # -g is optional in this case -- should be defined at module level
260 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
261
262 ifdef USES_MT_THREAD
263 TFLAGS          += -DMT_THREAD
264 endif
265
266 ifdef USES_LIBDYNINSTRT_SO
267 TFLAGS          += -DUSES_LIBDYNINSTRT_SO
268 endif
269
270 ifdef DETACH_ON_THE_FLY
271 TFLAGS          += -DDETACH_ON_THE_FLY
272 endif
273
274 ifdef DO_INLINE_ALL
275 CFLAGS         += $(ALL_INLINE_DEFINES)
276 CXXFLAGS       += $(ALL_INLINE_DEFINES)
277 endif
278
279 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
280 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
281 # we stick in (BACKUP_CORE)/lib _second_.
282 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
283                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
284
285 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
286 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
287 # else set it to just "igen" (i.e. assume it's in the user's path)
288 ifdef CROSSCOMPILER
289 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 )
290 else
291 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 )
292 endif
293
294 ifdef NO_IMPLICIT_TEMPLATES
295 CFLAGS          += -fno-implicit-templates
296 CXXFLAGS        += -fno-implicit-templates
297 KFLAGS          += -fno-implicit-templates
298 endif
299
300 ifndef INSTANTIATE_TEMPLATES
301 ifndef NO_IMPLICIT_TEMPLATES
302 # -fexternal-templates and -Dexternal_templates should both be used or
303 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
304 # (but not to TFLAGS).
305 #
306 CFLAGS          +=  -fexternal-templates -Dexternal_templates
307 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
308 KFLAGS          +=  -fexternal-templates -Dexternal_templates
309 endif
310 endif
311
312 ifdef INCLUDE_CP_PROFILING
313 INCLUDE_PVM_SUPPORT=true
314 USES_PVM=true
315 endif
316
317 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
318
319 ifdef INCLUDE_PVM_SUPPORT
320 ifndef PVM_ROOT
321 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
322 endif
323 ifndef PVM_ARCH
324 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
325 endif
326 ifdef USES_PVM
327 PVM_INCDIR      = $(PVM_ROOT)/include
328 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
329 PVM_LIB         = -lpvm3
330 IFLAGS          += -I$(PVM_INCDIR)
331 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
332 VPATH           += $(PVM_LIBDIR)
333 endif
334 endif
335
336 ifdef USES_TCLTK
337
338 TCLTK_DIR       = /p/paradyn/packages/tcl8.3.0
339 TCLTK_LIBS      = -ltk8.3 -ltcl8.3
340
341 # Set TCL2C to $(TO_CORE)/tclStuff/tcl2c, if it exists, else
342 # set it to $(BACKUP_CORE)/tclStuff/tcl2c, if it exists, else
343 # set it to just tcl2c (i.e. assume it's in the user's shell path)
344 TCL2C           = $(shell if [ -f $(TO_CORE)/tclStuff/tcl2c ]; then echo $(TO_CORE)/tclStuff/tcl2c; else if [ -f $(BACKUP_CORE)/tclStuff/tcl2c ]; then echo $(BACKUP_CORE)/tclStuff/tcl2c; else echo tcl2c; fi; fi )
345 TCL2C_GEN_SRCS  = tcl2c.C
346
347 # Set TCLTK_INCLUDES to $(TO_CORE)/tclStuff/include, if it exists,
348 # else set it to $(BACKUP_CORE)/tclStuff/include.
349 TCLTK_INCLUDES  = $(TCLTK_DIR)/include
350
351 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
352 ifdef CROSSCOMPILER
353 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
354 else
355 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
356 endif
357 endif # USES_TCLTK
358
359 ifdef USES_FLEX
360 FLEX_LIB        = -lfl
361 FLEX_DIR        = /s/flex/lib
362 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
363 VPATH           += $(FLEX_DIR)
364 endif
365
366 ifdef CROSSCOMPILER
367 FLEX_DIR        = /s/flex/rs_aix41/lib
368 LIBDIR          += -L/p/sp2/gcc/lib 
369 endif
370
371 ifdef USES_LIBERTY
372 # Since libiberty.a is in the same g++ directory as libstdc++.a and
373 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
374 endif
375
376 ifdef USES_X11
377 X11_LIB         = -lX11
378
379 #ifeq (linux,$(findstring linux,$(PLATFORM)))
380 X11DIR          = /usr/X11R6
381 #else
382 #X11DIR         = /usr/openwin
383 #endif
384
385 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
386 CFLAGS          += -I$(X11DIR)/include
387 CXXFLAGS        += -I$(X11DIR)/include
388 TFLAGS          += -I$(X11DIR)/include
389 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
390 VPATH           += $(X11DIR)/lib
391 endif
392
393 ifeq (linux,$(findstring linux,$(PLATFORM)))
394 CFLAGS          += -I$(X11DIR)/include/X11
395 CXXFLAGS        += -I$(X11DIR)/include/X11
396 TFLAGS          += -I$(X11DIR)/include/X11
397 LIBDIR          += -L$(X11DIR)/lib
398 VPATH           += $(X11DIR)/include/X11
399 endif
400
401 endif # USES_X11
402
403 # Include any per-user configuration changes; this "local" config file
404 # should *not* be under CVS control, so that it never gets committed.
405
406 -include $(TO_CORE)/make.config.local