1 # Paradyn overall build configuration (unix)
3 # $Id: make.config,v 1.113 2002/06/17 17:04:03 gaburici Exp $
11 #IBM_BPATCH_COMPAT = 1
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.4)
77 ARCH_DEF = -Di386_unknown_linux2_0
79 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
80 ARCH_DEF = -Dia64_unknown_linux2_4
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 -Wno-deprecated
130 COMMONWARNINGS = -W -Wall -Wshadow -Wpointer-arith \
133 -Wmissing-prototypes \
134 -Wredundant-decls -Woverloaded-virtual
136 # not as strict as above, but can actually be used -- mdc
137 USEFULWARNINGS = -W -Wall -Wpointer-arith \
140 -Wmissing-prototypes \
141 -Woverloaded-virtual \
144 # being nice to poor old pathetic tcl/tk header files --ari
145 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
148 -Wmissing-prototypes \
151 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
152 COMMONWARNINGS += -Wno-unknown-pragmas
153 USEFULWARNINGS += -Wno-unknown-pragmas
154 TCLFRIENDLYWARNINGS += -Wno-unknown-pragmas
155 else # STL on Solaris with cast-align generates a warning with much output
156 COMMONWARNINGS += -Wcast-align
157 USEFULWARNINGS += -Wcast-align
159 endif # SILENCE_WARNINGS
163 GCC_VER := $(shell gcc --version)
164 ifneq (,$(findstring 2.95,$(GCC_VER)))
170 GCC_VER := $(shell gcc --version)
171 versionNumbers = $(sort $(GCC_VER), 2.95)
172 versionNumber = $(firstword $(versionNumbers))
173 ifneq (2.95, $(versionNumber))
179 COMMONWARNINGS += -Wno-non-template-friend
180 USEFULWARNINGS += -Wno-non-template-friend
181 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
184 #don't inline -- for the files that won't emit template code
187 #inline the private members of the class -- templates.o can use this
188 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
190 # inline everything -- the way things should be
191 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
195 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
196 USES_LIBDYNINST_SO = true
197 USES_DYNAMIC_INF_HEAP = true
199 ifeq (linux,$(findstring linux,$(PLATFORM)))
200 USES_LIBDYNINST_SO = true
201 USES_DYNAMIC_INF_HEAP = true
202 ifndef IBM_BPATCH_COMPAT
203 DETACH_ON_THE_FLY = true
206 ifeq (irix,$(findstring irix,$(PLATFORM)))
207 USES_LIBDYNINST_SO = true
208 USES_DYNAMIC_INF_HEAP = true
209 USES_NATIVE_CC = true
210 USE_IRIX_FIXES = true
212 ifeq (osf,$(findstring osf,$(PLATFORM)))
213 USES_LIBDYNINST_SO = true
214 USES_DYNAMIC_INF_HEAP = true
216 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
217 USES_LIBDYNINST_SO = true
218 USES_DYNAMIC_INF_HEAP = true
219 USES_PERF_LIBRARY = true
220 #USES_LIB_TEXT_HEAP = true
221 # Uncomment if you want to use cc to build the RT libraries
222 #USES_NATIVE_CC = true
225 # if we don't want OPT_FLAG defined for a particular part of the code
226 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
227 # the include of make.config - naim
232 # flags for normal (non-kludge) files, with common warnings
233 CFLAGS = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
234 CXXFLAGS = $(IFLAGS) $(ARCH_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
236 # flags for kludge files, won't have warnings generated
237 KFLAGS = $(IFLAGS) $(ARCH_DEF) $(BASICWARNINGS)
240 CFLAGS += -DPURE_BUILD
241 CXXFLAGS += -DPURE_BUILD
245 CFLAGS += -DMT_THREAD
246 CXXFLAGS += -DMT_THREAD
249 ifdef USES_PERF_LIBRARY
250 # Add any platform-specific performance libraries here
251 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
256 ifdef USES_DYNAMIC_INF_HEAP
257 CFLAGS += -DUSES_DYNAMIC_INF_HEAP
258 CXXFLAGS += -DUSES_DYNAMIC_INF_HEAP
262 CXXFLAGS += -DUSE_STL_VECTOR
263 CFLAGS += -fimplicit-templates
264 CXXFLAGS += -fimplicit-templates
267 ifdef IBM_BPATCH_COMPAT
268 CXXFLAGS += -DIBM_BPATCH_COMPAT
269 CFLAGS += -DIBM_BPATCH_COMPAT
272 ifdef DETACH_ON_THE_FLY
273 CFLAGS += -DDETACH_ON_THE_FLY
274 CXXFLAGS += -DDETACH_ON_THE_FLY
284 ifeq ($(DEBUG_FLAG),none)
289 CFLAGS += $(DEBUG_FLAG)
290 CXXFLAGS += $(DEBUG_FLAG)
291 KFLAGS += $(DEBUG_FLAG)
294 # flags for template files, don't define external template flags
295 # -g is optional in this case -- should be defined at module level
296 TFLAGS = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(ARCH_DEF) $(OPT_FLAG) $(BASICWARNINGS)
299 TFLAGS += -DMT_THREAD
303 TFLAGS += -DUSE_STL_VECTOR
304 TFLAGS += -fimplicit-templates
307 ifdef DETACH_ON_THE_FLY
308 TFLAGS += -DDETACH_ON_THE_FLY
312 CFLAGS += -DUSE_IRIX_FIXES
313 CXXFLAGS += -DUSE_IRIX_FIXES
317 CFLAGS += $(ALL_INLINE_DEFINES)
318 CXXFLAGS += $(ALL_INLINE_DEFINES)
321 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
322 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
323 # we stick in (BACKUP_CORE)/lib _second_.
324 LIBDIR = -L$(TO_CORE)/../lib/$(PLATFORM) \
325 -L$(BACKUP_CORE)/../lib/$(PLATFORM)
327 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
328 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
329 # else set it to just "igen" (i.e. assume it's in the user's path)
331 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 )
333 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 )
336 ifdef NO_IMPLICIT_TEMPLATES
337 ifndef USE_STL_VECTOR
338 CFLAGS += -fno-implicit-templates
339 CXXFLAGS += -fno-implicit-templates
340 KFLAGS += -fno-implicit-templates
344 ifndef INSTANTIATE_TEMPLATES
345 ifndef NO_IMPLICIT_TEMPLATES
346 # -fexternal-templates and -Dexternal_templates should both be used or
347 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
348 # (but not to TFLAGS).
350 CFLAGS += -fexternal-templates -Dexternal_templates
351 CXXFLAGS += -fexternal-templates -Dexternal_templates
352 KFLAGS += -fexternal-templates -Dexternal_templates
356 ifdef INCLUDE_CP_PROFILING
357 INCLUDE_PVM_SUPPORT=true
361 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
363 ifdef INCLUDE_PVM_SUPPORT
365 BUILDERROR: PVM_ROOT must be defined in environment to build (and run) Paradyn
368 BUILDERROR: PVM_ARCH must be defined in environment to build (and run) Paradyn
371 PVM_INCDIR = $(PVM_ROOT)/include
372 PVM_LIBDIR = $(PVM_ROOT)/lib/$(PVM_ARCH)
374 IFLAGS += -I$(PVM_INCDIR)
375 LIBDIR += $(patsubst %,-L%,$(PVM_LIBDIR))
376 VPATH += $(PVM_LIBDIR)
381 HRTIME_ROOT = /p/paradyn/packages/libhrtime-0.6
382 HRTIME_INCDIR = $(HRTIME_ROOT)/include
383 HRTIME_LIBDIR = $(HRTIME_ROOT)/lib
384 HRTIME_LIB = -Wl,-static -lhrtime -Wl,-Bdynamic
385 IFLAGS += -I$(HRTIME_INCDIR)
386 LIBDIR += $(patsubst %,-L%,$(HRTIME_LIBDIR))
395 TCLTK_DIR = /p/paradyn/packages/tcl8.3.4
396 TCLTK_INCLUDES = $(TCLTK_DIR)/include
397 TCLTK_LIBVER_ID = 8.3
398 TCL_LIB = -ltcl$(TCLTK_LIBVER_ID)
399 TK_LIB = -ltk$(TCLTK_LIBVER_ID)
400 TCLTK_LIBS += $(TCL_LIB) $(TK_LIB)
402 # TCL2C is used to generate compilable sources from tcl files
403 TCL2C = $(TO_CORE)/../scripts/tcl2c
404 TCL2C_GEN_SRCS = tcl2c.C
406 IFLAGS += $(patsubst %,-I%,$(TCLTK_INCLUDES))
408 LIBDIR += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
410 LIBDIR += $(patsubst %,-L%/lib,$(TCLTK_DIR))
417 FLEX_DIR = /s/flex/lib
418 #FLEX_DIR = /usr/imports/flex-2.5.4a/lib/
419 LIBDIR += $(patsubst %,-L%,$(FLEX_DIR))
424 FLEX_DIR = /s/flex/rs_aix41/lib
425 LIBDIR += -L/p/sp2/gcc/lib
429 # Since libiberty.a is in the same g++ directory as libstdc++.a and
430 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
436 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
437 X11DIR = /usr/openwin
438 CFLAGS += -I$(X11DIR)/include
439 CXXFLAGS += -I$(X11DIR)/include
440 TFLAGS += -I$(X11DIR)/include
441 LIBDIR += -R$(X11DIR)/lib -L$(X11DIR)/lib
444 ifeq (linux,$(findstring linux,$(PLATFORM)))
446 CFLAGS += -I$(X11DIR)/include/X11
447 CXXFLAGS += -I$(X11DIR)/include/X11
448 TFLAGS += -I$(X11DIR)/include/X11
449 LIBDIR += -L$(X11DIR)/lib
452 ifeq (aix,$(findstring aix,$(PLATFORM)))
461 ifeq (xyes,x$(USE_PTHREADS))
462 THREADSLIB += -lpthread
465 # System build constraints
466 # if not on solaris or aix, then don't build the MT daemon
467 ifeq ($(strip $(join $(findstring sparc-sun-solaris,$(PLATFORM)), $(findstring rs6000-ibm-aix,$(PLATFORM)))),)
468 DONT_BUILD_PD_MT=true;
472 # Include any per-user configuration changes; this "local" config file
473 # should *not* be under CVS control, so that it never gets committed.
475 -include $(TO_CORE)/make.config.local