adding support for Fortran
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.90 2001/07/17 22:33:07 bernat Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 3.2
8 #BUILD_MARK     =
9 #EXPLICIT_DEPENDS = 1
10 #USE_STL_VECTOR = 1
11
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.2)
77 ARCH_DEF        = -Di386_unknown_linux2_0
78 endif
79 ifeq ($(PLATFORM),i386-unknown-solaris2.6)
80 ARCH_DEF        = -Di386_unknown_solaris2_5
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 -Wtraditional -Wshadow -Wpointer-arith       \
131                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
132                 -Wconversion -Wstrict-prototypes        \
133                 -Wmissing-prototypes -Wmissing-declarations             \
134                 -Wredundant-decls -Woverloaded-virtual
135
136 # not as strict as above, but can actually be used -- mdc
137 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
138                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
139                 -Wconversion -Wstrict-prototypes        \
140                 -Wmissing-prototypes -Wmissing-declarations             \
141                 -Woverloaded-virtual
142
143 # being nice to poor old pathetic tcl/tk header files --ari
144 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
145                 -Wbad-function-cast -Wcast-qual \
146                 -Wconversion -Wstrict-prototypes \
147                 -Wmissing-prototypes -Wmissing-declarations \
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 endif
155 endif # SILENCE_WARNINGS
156
157 ifndef GCC_2_95
158 GCC_VER := $(shell gcc --version)
159 ifneq (,$(findstring 2.95,$(GCC_VER)))
160 GCC_2_95 = true
161 endif
162 endif
163
164 ifdef GCC_2_95
165 COMMONWARNINGS += -Wno-non-template-friend
166 USEFULWARNINGS += -Wno-non-template-friend
167 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
168 endif
169
170 #don't inline -- for the files that won't emit template code
171 INLINE_DEFINES = 
172
173 #inline the private members of the class -- templates.o can use this
174 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
175
176 # inline everything -- the way things should be
177 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
178
179 USES_MT_THREAD =
180
181 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
182 USES_LIBDYNINST_SO = true
183 USES_DYNAMIC_INF_HEAP = true
184 endif
185 ifeq (linux,$(findstring linux,$(PLATFORM)))
186 USES_LIBDYNINST_SO = true
187 USES_DYNAMIC_INF_HEAP = true
188 DETACH_ON_THE_FLY = true
189 endif
190 ifeq (irix,$(findstring irix,$(PLATFORM)))
191 USES_LIBDYNINST_SO = true
192 USES_DYNAMIC_INF_HEAP = true
193 USES_NATIVE_CC = true
194 USE_IRIX_FIXES = true
195 endif
196 ifeq (osf,$(findstring osf,$(PLATFORM)))
197 USES_LIBDYNINST_SO = true
198 USES_DYNAMIC_INF_HEAP = true
199 endif
200 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
201 USES_LIBDYNINST_SO = true
202 USES_DYNAMIC_INF_HEAP = true
203 #USES_LIB_TEXT_HEAP = true
204 # Uncomment if you want to use cc to build the RT libraries
205 #USES_NATIVE_CC = true
206 endif
207
208 # if we don't want OPT_FLAG defined for a particular part of the code
209 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
210 # the include of make.config - naim
211 ifndef NO_OPT_FLAG
212 OPT_FLAG        = -O3
213 endif
214
215 # flags for normal (non-kludge) files, with common warnings
216 CFLAGS          = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
217 CXXFLAGS        = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
218
219 # flags for kludge files, won't have warnings generated
220 KFLAGS          = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
221
222 ifdef USING_PURIFY
223 CFLAGS          += -DPURE_BUILD
224 CXXFLAGS        += -DPURE_BUILD
225 endif
226
227 ifdef USES_MT_THREAD
228 CFLAGS          += -DMT_THREAD
229 CXXFLAGS        += -DMT_THREAD
230 endif
231
232 ifdef USES_DYNAMIC_INF_HEAP
233 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
234 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
235 endif
236
237 ifdef USE_STL_VECTOR
238 CXXFLAGS        += -DUSE_STL_VECTOR
239 endif
240
241 ifdef DETACH_ON_THE_FLY
242 CFLAGS          += -DDETACH_ON_THE_FLY
243 CXXFLAGS        += -DDETACH_ON_THE_FLY
244 endif
245
246 ifndef OPT_FLAG
247 KFLAGS          += -g
248 ifndef DEBUG_FLAG
249 DEBUG_FLAG = -g
250 endif
251 endif
252
253 ifeq ($(DEBUG_FLAG),none)
254 DEBUG_FLAG =
255 endif
256
257 ifdef DEBUG_FLAG
258 CFLAGS   += $(DEBUG_FLAG)
259 CXXFLAGS += $(DEBUG_FLAG)
260 KFLAGS   += $(DEBUG_FLAG)
261 endif
262
263 # flags for template files, don't define external template flags
264 # -g is optional in this case -- should be defined at module level
265 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
266
267 ifdef USES_MT_THREAD
268 TFLAGS          += -DMT_THREAD
269 endif
270
271 ifdef USE_STL_VECTOR
272 TFLAGS          += -DUSE_STL_VECTOR
273 endif
274
275 ifdef DETACH_ON_THE_FLY
276 TFLAGS          += -DDETACH_ON_THE_FLY
277 endif
278
279 ifdef USE_IRIX_FIXES
280 CFLAGS          += -DUSE_IRIX_FIXES
281 CXXFLAGS        += -DUSE_IRIX_FIXES
282 endif
283
284 ifdef DO_INLINE_ALL
285 CFLAGS         += $(ALL_INLINE_DEFINES)
286 CXXFLAGS       += $(ALL_INLINE_DEFINES)
287 endif
288
289 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
290 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
291 # we stick in (BACKUP_CORE)/lib _second_.
292 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
293                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
294
295 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
296 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
297 # else set it to just "igen" (i.e. assume it's in the user's path)
298 ifdef CROSSCOMPILER
299 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 )
300 else
301 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 )
302 endif
303
304 ifdef NO_IMPLICIT_TEMPLATES
305 CFLAGS          += -fno-implicit-templates
306 CXXFLAGS        += -fno-implicit-templates
307 KFLAGS          += -fno-implicit-templates
308 endif
309
310 ifndef INSTANTIATE_TEMPLATES
311 ifndef NO_IMPLICIT_TEMPLATES
312 # -fexternal-templates and -Dexternal_templates should both be used or
313 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
314 # (but not to TFLAGS).
315 #
316 CFLAGS          +=  -fexternal-templates -Dexternal_templates
317 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
318 KFLAGS          +=  -fexternal-templates -Dexternal_templates
319 endif
320 endif
321
322 ifdef INCLUDE_CP_PROFILING
323 INCLUDE_PVM_SUPPORT=true
324 USES_PVM=true
325 endif
326
327 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
328
329 ifdef INCLUDE_PVM_SUPPORT
330 ifndef PVM_ROOT
331 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
332 endif
333 ifndef PVM_ARCH
334 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
335 endif
336 ifdef USES_PVM
337 PVM_INCDIR      = $(PVM_ROOT)/include
338 PVM_LIBDIR      = $(PVM_ROOT)/lib/$(PVM_ARCH)
339 PVM_LIB         = -lpvm3
340 IFLAGS          += -I$(PVM_INCDIR)
341 LIBDIR          += $(patsubst %,-L%,$(PVM_LIBDIR))
342 VPATH           += $(PVM_LIBDIR)
343 endif
344 endif
345
346 ifdef USES_LIBHRTIME
347 HRTIME_ROOT     = /p/paradyn/packages/libhrtime-0.6
348 HRTIME_INCDIR   = $(HRTIME_ROOT)/include
349 HRTIME_LIBDIR   = $(HRTIME_ROOT)/lib
350 HRTIME_LIB      = -Wl,-static -lhrtime -Wl,-Bdynamic
351 IFLAGS          += -I$(HRTIME_INCDIR)
352 LIBDIR          += $(patsubst %,-L%,$(HRTIME_LIBDIR))
353 CFLAGS          += -DHRTIME
354 CXXFLAGS        += -DHRTIME
355 TFLAGS          += -DHRTIME
356 endif
357
358
359 ifdef USES_TCLTK
360
361 TCLTK_DIR       = /p/paradyn/packages/tcl8.3.0
362 TCLTK_INCLUDES  = $(TCLTK_DIR)/include
363 TCLTK_LIBVER_ID = 8.3
364 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
365 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
366 TCLTK_LIBS      = $(TCL_LIB) $(TK_LIB)
367
368 # TCL2C is used to generate compilable sources from tcl files
369 TCL2C           = $(TO_CORE)/../scripts/tcl2c
370 TCL2C_GEN_SRCS  = tcl2c.C
371
372 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
373 ifdef CROSSCOMPILER
374 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
375 else
376 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_DIR))
377 endif
378 endif # USES_TCLTK
379
380 ifdef USES_FLEX
381 FLEX_LIB        = -lfl
382 FLEX_DIR        = /s/flex/lib
383 #FLEX_DIR       = /usr/imports/flex-2.5.4a/lib/
384 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
385 VPATH           += $(FLEX_DIR)
386 endif
387
388 ifdef CROSSCOMPILER
389 FLEX_DIR        = /s/flex/rs_aix41/lib
390 LIBDIR          += -L/p/sp2/gcc/lib 
391 endif
392
393 ifdef USES_LIBERTY
394 # Since libiberty.a is in the same g++ directory as libstdc++.a and
395 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
396 endif
397
398 ifdef USES_X11
399 X11_LIB         = -lX11
400
401 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
402 X11DIR          = /usr/openwin
403 CFLAGS          += -I$(X11DIR)/include
404 CXXFLAGS        += -I$(X11DIR)/include
405 TFLAGS          += -I$(X11DIR)/include
406 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
407 endif
408
409 ifeq (linux,$(findstring linux,$(PLATFORM)))
410 X11DIR          = /usr/X11R6
411 CFLAGS          += -I$(X11DIR)/include/X11
412 CXXFLAGS        += -I$(X11DIR)/include/X11
413 TFLAGS          += -I$(X11DIR)/include/X11
414 LIBDIR          += -L$(X11DIR)/lib
415 endif
416
417 ifeq (aix,$(findstring aix,$(PLATFORM)))
418 X11DIR          = /usr
419 endif
420
421 endif # USES_X11
422
423 # System build constraints
424 ifneq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
425 DONT_BUILD_PD_MT=true
426 endif
427
428
429 # Include any per-user configuration changes; this "local" config file
430 # should *not* be under CVS control, so that it never gets committed.
431
432 -include $(TO_CORE)/make.config.local
433