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