1 # Paradyn overall build configuration (unix)
3 # $Id: make.config,v 1.90 2001/07/17 22:33:07 bernat Exp $
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.
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).
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
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
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)
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
58 PERL = perl # NB: perl v5 or higher required!
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
66 ARCH_DEF = -D$(shell echo $$PLATFORM | $(PERL) -pe 's/\./_/g;s/-/_/g')
68 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
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
76 ifeq ($(PLATFORM),i386-unknown-linux2.2)
77 ARCH_DEF = -Di386_unknown_linux2_0
79 ifeq ($(PLATFORM),i386-unknown-solaris2.6)
80 ARCH_DEF = -Di386_unknown_solaris2_5
82 ifeq ($(PLATFORM),sparc-sun-solaris2.7)
83 ARCH_DEF = -Dsparc_sun_solaris2_4
85 ifeq ($(PLATFORM),rs6000-ibm-aix4.3)
86 ARCH_DEF = -Drs6000_ibm_aix4_1
88 ifeq ($(PLATFORM),rs6000-ibm-aix4.2)
89 ARCH_DEF = -Drs6000_ibm_aix4_1
91 # [temporary hack overrides]
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
101 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
106 ifeq (linux,$(findstring linux,$(PLATFORM)))
112 # Default module compiler; modules which want $(CC) should redefine
116 MODCFLAGS = $(CXXFLAGS)
120 IFLAGS = -I. -I$(TO_CORE)
122 ASFLAGS = -P $(ARCH_DEF)
124 # uncomment/comment the line below to build with/without compilation warnings
125 # SILENCE_WARNINGS=true
127 ifndef SILENCE_WARNINGS
128 BASICWARNINGS = -W -Wall
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
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 \
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 \
150 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
151 COMMONWARNINGS += -Wno-unknown-pragmas
152 USEFULWARNINGS += -Wno-unknown-pragmas
153 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
155 endif # SILENCE_WARNINGS
158 GCC_VER := $(shell gcc --version)
159 ifneq (,$(findstring 2.95,$(GCC_VER)))
165 COMMONWARNINGS += -Wno-non-template-friend
166 USEFULWARNINGS += -Wno-non-template-friend
167 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
170 #don't inline -- for the files that won't emit template code
173 #inline the private members of the class -- templates.o can use this
174 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
176 # inline everything -- the way things should be
177 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
181 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
182 USES_LIBDYNINST_SO = true
183 USES_DYNAMIC_INF_HEAP = true
185 ifeq (linux,$(findstring linux,$(PLATFORM)))
186 USES_LIBDYNINST_SO = true
187 USES_DYNAMIC_INF_HEAP = true
188 DETACH_ON_THE_FLY = true
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
196 ifeq (osf,$(findstring osf,$(PLATFORM)))
197 USES_LIBDYNINST_SO = true
198 USES_DYNAMIC_INF_HEAP = true
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
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
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)
219 # flags for kludge files, won't have warnings generated
220 KFLAGS = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
223 CFLAGS += -DPURE_BUILD
224 CXXFLAGS += -DPURE_BUILD
228 CFLAGS += -DMT_THREAD
229 CXXFLAGS += -DMT_THREAD
232 ifdef USES_DYNAMIC_INF_HEAP
233 CFLAGS += -DUSES_DYNAMIC_INF_HEAP
234 CXXFLAGS += -DUSES_DYNAMIC_INF_HEAP
238 CXXFLAGS += -DUSE_STL_VECTOR
241 ifdef DETACH_ON_THE_FLY
242 CFLAGS += -DDETACH_ON_THE_FLY
243 CXXFLAGS += -DDETACH_ON_THE_FLY
253 ifeq ($(DEBUG_FLAG),none)
258 CFLAGS += $(DEBUG_FLAG)
259 CXXFLAGS += $(DEBUG_FLAG)
260 KFLAGS += $(DEBUG_FLAG)
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)
268 TFLAGS += -DMT_THREAD
272 TFLAGS += -DUSE_STL_VECTOR
275 ifdef DETACH_ON_THE_FLY
276 TFLAGS += -DDETACH_ON_THE_FLY
280 CFLAGS += -DUSE_IRIX_FIXES
281 CXXFLAGS += -DUSE_IRIX_FIXES
285 CFLAGS += $(ALL_INLINE_DEFINES)
286 CXXFLAGS += $(ALL_INLINE_DEFINES)
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)
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)
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 )
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 )
304 ifdef NO_IMPLICIT_TEMPLATES
305 CFLAGS += -fno-implicit-templates
306 CXXFLAGS += -fno-implicit-templates
307 KFLAGS += -fno-implicit-templates
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).
316 CFLAGS += -fexternal-templates -Dexternal_templates
317 CXXFLAGS += -fexternal-templates -Dexternal_templates
318 KFLAGS += -fexternal-templates -Dexternal_templates
322 ifdef INCLUDE_CP_PROFILING
323 INCLUDE_PVM_SUPPORT=true
327 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
329 ifdef INCLUDE_PVM_SUPPORT
331 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
334 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
337 PVM_INCDIR = $(PVM_ROOT)/include
338 PVM_LIBDIR = $(PVM_ROOT)/lib/$(PVM_ARCH)
340 IFLAGS += -I$(PVM_INCDIR)
341 LIBDIR += $(patsubst %,-L%,$(PVM_LIBDIR))
342 VPATH += $(PVM_LIBDIR)
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))
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)
368 # TCL2C is used to generate compilable sources from tcl files
369 TCL2C = $(TO_CORE)/../scripts/tcl2c
370 TCL2C_GEN_SRCS = tcl2c.C
372 IFLAGS += $(patsubst %,-I%,$(TCLTK_INCLUDES))
374 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
376 LIBDIR += $(patsubst %,-L%/lib,$(TCLTK_DIR))
382 FLEX_DIR = /s/flex/lib
383 #FLEX_DIR = /usr/imports/flex-2.5.4a/lib/
384 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
389 FLEX_DIR = /s/flex/rs_aix41/lib
390 LIBDIR += -L/p/sp2/gcc/lib
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
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
409 ifeq (linux,$(findstring linux,$(PLATFORM)))
411 CFLAGS += -I$(X11DIR)/include/X11
412 CXXFLAGS += -I$(X11DIR)/include/X11
413 TFLAGS += -I$(X11DIR)/include/X11
414 LIBDIR += -L$(X11DIR)/lib
417 ifeq (aix,$(findstring aix,$(PLATFORM)))
423 # System build constraints
424 ifneq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
425 DONT_BUILD_PD_MT=true
429 # Include any per-user configuration changes; this "local" config file
430 # should *not* be under CVS control, so that it never gets committed.
432 -include $(TO_CORE)/make.config.local