Updated to use Tcl/Tk 8.2.2, used from /p/paradyn/packages/tcl8.2.2.
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.67 1999/12/17 16:26:09 pcroth Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 2.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 override
70 ifeq ($(PLATFORM),sparc-sun-solaris2.7)
71 PLATFORM        = sparc-sun-solaris2.4
72 ARCH_DEF        = -Dsparc_sun_solaris2_4
73 RESET_PF        = true
74 endif
75
76 ifeq ($(PLATFORM),sparc-sun-solaris2.6)
77 PLATFORM        = sparc-sun-solaris2.4
78 ARCH_DEF        = -Dsparc_sun_solaris2_4
79 RESET_PF        = true
80 endif
81
82 ifdef CROSSCOMPILER
83 AS              = /p/sp2/gcc/bin/rs6000-gcc
84 CC              = /p/sp2/gcc/bin/rs6000-gcc
85 CXX             = /p/sp2/gcc/bin/rs6000-gcc
86 AR              = /p/sp2/gcc/rs6000/bin/ar
87 RANLIB          = /p/sp2/gcc/rs6000/bin/ranlib
88 endif
89
90 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
91 AS              = /usr/ccs/bin/as
92 RANLIB          = true
93 endif
94 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
95 AS              = /usr/ccs/bin/as
96 RANLIB          = true
97 endif
98
99 ifeq ($(PLATFORM),i386-unknown-linux2.0)
100 AS              = /usr/bin/as
101 RANLIB          = true 
102 endif
103
104
105 # Default module compiler; modules which want $(CC) should redefine
106 # this, **NOT** CC
107
108 MODCC           = $(CXX)
109 MODCFLAGS       = $(CXXFLAGS)
110
111 .SUFFIXES:      .I
112
113 IFLAGS          = -I. -I$(TO_CORE)
114
115 ASFLAGS         = -P $(ARCH_DEF)
116
117 # uncomment/comment the line below to build with/without compilation warnings
118 # SILENCE_WARNINGS=true
119
120 ifndef SILENCE_WARNINGS
121 BASICWARNINGS   = -W -Wall
122
123 COMMONWARNINGS  = -W -Wall -Wtraditional -Wshadow -Wpointer-arith       \
124                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
125                 -Wconversion -Wstrict-prototypes        \
126                 -Wmissing-prototypes -Wmissing-declarations             \
127                 -Wredundant-decls -Woverloaded-virtual
128
129 # not as strict as above, but can actually be used -- mdc
130 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
131                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
132                 -Wconversion -Wstrict-prototypes        \
133                 -Wmissing-prototypes -Wmissing-declarations             \
134                 -Woverloaded-virtual
135
136 # being nice to poor old pathetic tcl/tk header files --ari
137 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
138                 -Wbad-function-cast -Wcast-qual \
139                 -Wconversion -Wstrict-prototypes \
140                 -Wmissing-prototypes -Wmissing-declarations \
141                 -Woverloaded-virtual
142 endif # SILENCE_WARNINGS
143
144 ifndef GCC_2_95
145 GCC_VER := $(shell gcc --version)
146 ifneq (,$(findstring 2.95,$(GCC_VER)))
147 GCC_2_95 = true
148 endif
149 endif
150
151 ifdef GCC_2_95
152 COMMONWARNINGS += -Wno-non-template-friend
153 USEFULWARNINGS += -Wno-non-template-friend
154 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
155 XFLAGS += -fpermissive
156 endif
157
158 #don't inline -- for the files that won't emit template code
159 INLINE_DEFINES = 
160
161 #inline the private members of the class -- templates.o can use this
162 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
163
164 # inline everything -- the way things should be
165 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
166
167 USES_MT_THREAD =
168
169 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
170 USES_LIBDYNINSTRT_SO = true
171 USES_LIBDYNINST_SO = true
172 USES_DYNAMIC_INF_HEAP = true
173 endif
174 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
175 USES_LIBDYNINSTRT_SO = true
176 USES_LIBDYNINST_SO = true
177 endif
178 ifeq ($(PLATFORM),i386-unknown-linux2.0)
179 USES_LIBDYNINSTRT_SO = true
180 USES_LIBDYNINST_SO = true
181 endif
182 ifeq ($(PLATFORM),mips-sgi-irix6.4)
183 USES_LIBDYNINSTRT_SO = true
184 USES_LIBDYNINST_SO = true
185 USES_DYNAMIC_INF_HEAP = true
186 USES_NATIVE_CC = true
187 endif
188 ifeq ($(PLATFORM),alpha-dec-osf4.0)
189 USES_LIBDYNINSTRT_SO = true
190 USES_LIBDYNINST_SO = true
191 USES_DYNAMIC_INF_HEAP = true
192 endif
193
194 #ifeq ($(PLATFORM),rs6000-ibm-aix4.1)
195 #NO_OPT_FLAG = true
196 #endif
197
198 # if we don't want OPT_FLAG defined for a particular part of the code
199 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
200 # the include of make.config - naim
201 ifndef NO_OPT_FLAG
202 OPT_FLAG        = -O3
203 endif
204
205 # flags for normal (non-kludge) files, with common warnings
206 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
207 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
208
209 # flags for kludge files, won't have warnings generated
210 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
211
212 ifdef USING_PURIFY
213 CFLAGS          += -DPURE_BUILD
214 CXXFLAGS        += -DPURE_BUILD
215 endif
216
217 ifdef USES_MT_THREAD
218 CFLAGS          += -DMT_THREAD
219 CXXFLAGS        += -DMT_THREAD
220 endif
221
222 ifdef USES_LIBDYNINSTRT_SO
223 CFLAGS          += -DUSES_LIBDYNINSTRT_SO
224 CXXFLAGS        += -DUSES_LIBDYNINSTRT_SO
225 endif
226
227 ifdef USES_DYNAMIC_INF_HEAP
228 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
229 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
230 endif
231
232 ifndef OPT_FLAG
233 KFLAGS          += -g
234 ifndef DEBUG_FLAG
235 DEBUG_FLAG = -g
236 endif
237 endif
238
239 ifeq ($(DEBUG_FLAG),none)
240 DEBUG_FLAG =
241 endif
242
243 ifdef DEBUG_FLAG
244 CFLAGS   += $(DEBUG_FLAG)
245 CXXFLAGS += $(DEBUG_FLAG)
246 KFLAGS   += $(DEBUG_FLAG)
247 endif
248
249 # flags for template files, don't define external template flags
250 # -g is optional in this case -- should be defined at module level
251 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
252
253 ifdef USES_MT_THREAD
254 TFLAGS          += -DMT_THREAD
255 endif
256
257 ifdef USES_LIBDYNINSTRT_SO
258 TFLAGS          += -DUSES_LIBDYNINSTRT_SO
259 endif
260
261 ifdef DO_INLINE_ALL
262 CFLAGS         += $(ALL_INLINE_DEFINES)
263 CXXFLAGS       += $(ALL_INLINE_DEFINES)
264 endif
265
266 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
267 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
268 # we stick in (BACKUP_CORE)/lib _second_.
269 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
270                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
271
272 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
273 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
274 # else set it to just "igen" (i.e. assume it's in the user's path)
275 ifdef CROSSCOMPILER
276 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 )
277 else
278 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 )
279 endif
280
281 ifdef NO_IMPLICIT_TEMPLATES
282 CFLAGS          += -fno-implicit-templates
283 CXXFLAGS        += -fno-implicit-templates
284 KFLAGS          += -fno-implicit-templates
285 TFLAGS          += -fno-implicit-templates
286 endif
287
288 ifndef INSTANTIATE_TEMPLATES
289 ifndef NO_IMPLICIT_TEMPLATES
290 # -fexternal-templates and -Dexternal_templates should both be used or
291 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
292 # (but not to TFLAGS).
293 #
294 CFLAGS          +=  -fexternal-templates -Dexternal_templates
295 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
296 KFLAGS          +=  -fexternal-templates -Dexternal_templates
297 endif
298 endif
299
300 ifdef INCLUDE_CP_PROFILING
301 INCLUDE_PVM_SUPPORT=true
302 USES_PVM=true
303 endif
304
305 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
306
307 ifdef INCLUDE_PVM_SUPPORT
308 ifndef PVM_ROOT
309 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
310 endif
311 ifndef PVM_ARCH
312 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
313 endif
314 ifdef USES_PVM
315 PVM_INCDIR      = $(PVM_ROOT)/include
316 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
317 PVM_LIB         = -lpvm3
318 IFLAGS          += -I$(PVM_INCDIR)
319 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
320 VPATH           += $(PVM_LIBDIR)
321 endif
322 endif
323
324 ifdef USES_TCLTK
325
326 TCLTK_DIR       = /p/paradyn/packages/tcl8.2.2
327 TCLTK_LIBS      = -ltk8.2 -ltcl8.2
328
329 # Set TCL2C to $(TO_CORE)/tclStuff/tcl2c, if it exists, else
330 # set it to $(BACKUP_CORE)/tclStuff/tcl2c, if it exists, else
331 # set it to just tcl2c (i.e. assume it's in the user's shell path)
332 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 )
333 TCL2C_GEN_SRCS  = tcl2c.C
334
335 # Set TCLTK_INCLUDES to $(TO_CORE)/tclStuff/include, if it exists,
336 # else set it to $(BACKUP_CORE)/tclStuff/include.
337 TCLTK_INCLUDES  = /p/paradyn/packages/tcl8.2.2/include
338
339
340 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
341 ifdef CROSSCOMPILER
342 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
343 else
344 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
345 endif
346 endif # USES_TCLTK
347
348 ifdef USES_FLEX
349 FLEX_LIB        = -lfl
350 FLEX_DIR        = /s/flex/lib
351 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
352 VPATH           += $(FLEX_DIR)
353 endif
354
355 ifdef CROSSCOMPILER
356 FLEX_DIR        = /s/flex/rs_aix41/lib
357 LIBDIR          += -L/p/sp2/gcc/lib 
358 endif
359
360 ifdef USES_LIBERTY
361 # Since libiberty.a is in the same g++ directory as libstdc++.a and
362 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
363 endif
364
365 ifdef USES_X11
366 X11_LIB         = -lX11
367
368 ifeq ($(PLATFORM),i386-unknown-linux2.0)
369 X11DIR          = /usr/X11R6
370 else
371 #X11DIR         = /usr/openwin
372 X11DIR          = /usr/X11R6
373 endif
374
375 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
376 CFLAGS          += -I$(X11DIR)/include
377 CXXFLAGS        += -I$(X11DIR)/include
378 TFLAGS          += -I$(X11DIR)/include
379 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
380 VPATH           += $(X11DIR)/lib
381 endif
382
383 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
384 CFLAGS          += -I$(X11DIR)/include
385 CXXFLAGS        += -I$(X11DIR)/include
386 TFLAGS          += -I$(X11DIR)/include
387 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
388 VPATH           += $(X11DIR)/lib
389 endif
390
391 ifeq ($(PLATFORM),i386-unknown-linux2.0)
392 CFLAGS          += -I$(X11DIR)/include/X11
393 CXXFLAGS        += -I$(X11DIR)/include/X11
394 TFLAGS          += -I$(X11DIR)/include/X11
395 LIBDIR          += -L$(X11DIR)/lib
396 VPATH           += $(X11DIR)/include/X11
397 endif
398
399 endif # USES_X11
400
401 ifdef RESET_PF
402 PLATFORM        = sparc-sun-solaris2.6
403 endif
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