Part of the base instrumentation for supporting multithreaded applications
[dyninst.git] / make.config
1 #
2 # $Log: make.config,v $
3 # Revision 1.37  1997/01/27 19:35:52  naim
4 # Part of the base instrumentation for supporting multithreaded applications
5 # (vectors of counter/timers) implemented for all current platforms +
6 # different bug fixes - naim
7 #
8 # Revision 1.36  1996/11/26 16:02:13  naim
9 # Implementation of cross-compiler (sparc-solaris,x86-solaris)->rs6000 - naim
10 #
11 # Revision 1.35  1996/11/08 23:38:17  tamches
12 # added support for a DEBUG_FLAG of 'none'
13 #
14 # Revision 1.34  1996/10/28 23:05:52  tamches
15 # added DEBUG_FLAG feature
16 #
17 # Revision 1.33  1996/10/18 23:46:03  mjrg
18 # Solaris/X86 port
19 #
20 # Revision 1.32  1996/08/05 07:08:18  tamches
21 # Added BACKUP_CORE, which removes several "/p/paradyn" dependencies.
22 # Upgraded to tcl 7.5
23 # removed obsolete USES_BLT
24 # removed AIX kludges for FLEX_DIR
25 #
26 # Revision 1.31  1996/05/12 04:36:48  tamches
27 # FLEX_DIR in /usr/local/lib for aix 4.1
28 #
29 # Revision 1.30  1996/04/06 21:18:08  hollings
30 # Removed write-strings warning (eliminates several thousand warnings on AIX
31 # that are due to bad system header files).
32 #
33 # Revision 1.29  1996/01/05  19:43:18  tamches
34 # IGEN, TCL2C, and TCLTK_INCLUDES (IGEN is a new variable) set more
35 # intelligently (we look for several possibilities)
36 #
37 # Revision 1.28  1995/12/29 20:09:30  tamches
38 # Changed the collector to gcc 2.7.1's "ld", from 2.6.3
39 #
40 # Revision 1.27  1995/12/20 01:09:55  tamches
41 # removed -L/usr/psup/lib from LIBDIR
42 # removed TCLTK_DIRS, replacing with 2 different things:
43 #    TCLTK_INCLUDES and TCLTK_LIBS
44 # TCL2C and TCL2C_GEN_SRCS added
45 # changed FLEX_DIR to a new directory
46 # removed LIBERTY_DIR and associated stuff (not needed anymore)
47 #
48
49 AS              = /bin/as
50 CC              = gcc
51
52 ifdef CROSSCOMPILER
53 AS              = /p/sp2/gcc/bin/rs6000-gcc
54 CC              = /p/sp2/gcc/bin/rs6000-gcc
55 endif
56
57 CXX             = g++
58 LEX             = flex
59 RANLIB          = ranlib
60 AR              = ar
61 YFLAGS          = -d -y
62 YACC            = bison
63 # COLLECTOR is only used by purify & quantify
64 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
65
66 ifdef CROSSCOMPILER
67 CXX             = /p/sp2/gcc/bin/rs6000-gcc
68 AR              = /p/sp2/gcc/rs6000/bin/ar
69 RANLIB          = /p/sp2/gcc/rs6000/bin/ranlib
70 endif
71
72 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
73 AS              = /usr/ccs/bin/as
74 RANLIB          = true
75 endif
76 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
77 AS              = /usr/ccs/bin/as
78 RANLIB          = true
79 endif
80
81 ifeq ($(PLATFORM),hppa1.1-hp-hpux)
82 COLLECTOR       = /usr/psup/gcc-2.6.3/lib/gcc-lib/hppa1.1-hp-hpux9.01/2.6.3/ld
83 endif
84
85
86 ifdef PLATFORM
87 ARCH_DEF        = -D$(shell echo $$PLATFORM | perl -pe 's/\./_/g;s/-/_/g')
88 else
89 ERROR PLATFORM MUST BE DEFINED IN ORDER TO BUILD PARADYN
90 endif
91
92 # most "main" modules are only two levels deep, but we need to be able to
93 # change this for those that are deeper in the tree
94 ifndef TO_CORE
95 TO_CORE         = ../..
96 endif
97
98 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
99 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
100 # with cvs), then we should look in a backup location.  That's what this vrble
101 # is about.  It's used several times below in this file.
102 BACKUP_CORE = /p/paradyn/core
103
104 # Default module compiler; modules which want $(CC) should redefine
105 # this, **NOT** CC
106
107 MODCC           = $(CXX)
108 MODCFLAGS       = $(CXXFLAGS)
109
110 .SUFFIXES:      .I
111
112 # VPATH         = ../src:$(TO_CORE)/../lib/$(PLATFORM):/p/paradyn/lib/$(PLATFORM)
113
114 IFLAGS          = -I. -I$(TO_CORE)
115
116 ASFLAGS         = -P $(ARCH_DEF)
117
118 COMMONWARNINGS  = -W -Wall -Wtraditional -Wshadow -Wpointer-arith       \
119                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
120                 -Wconversion -Wstrict-prototypes        \
121                 -Wmissing-prototypes -Wmissing-declarations             \
122                 -Wredundant-decls -Woverloaded-virtual
123
124 # not as strict as above, but can actually be used -- mdc
125 USEFULWARNINGS  = -W -Wall -Wtraditional -Wpointer-arith       \
126                 -Wbad-function-cast -Wcast-qual -Wcast-align            \
127                 -Wconversion -Wstrict-prototypes        \
128                 -Wmissing-prototypes -Wmissing-declarations             \
129                 -Woverloaded-virtual 
130
131 # being nice to poor old pathetic tcl/tk header files --ari
132 TCLFRIENDLYWARNINGS = -W -Wall -Wtraditional -Wpointer-arith \
133                 -Wbad-function-cast -Wcast-qual \
134                 -Wconversion -Wstrict-prototypes \
135                 -Wmissing-prototypes -Wmissing-declarations \
136                 -Woverloaded-virtual
137
138 #don't inline -- for the files that won't emit template code
139 INLINE_DEFINES = 
140
141 #inline the private members of the class -- templates.o can use this
142 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
143
144 # inline everything -- the way things should be
145 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
146
147 USES_MT_THREAD = 
148
149 CFLAGS          = $(IFLAGS) -Wall $(ARCH_DEF)
150 CXXFLAGS        = $(IFLAGS) -Wall $(ARCH_DEF)
151
152 ifdef USES_MT_THREAD
153 CFLAGS          += -DMT_THREAD
154 CXXFLAGS        += -DMT_THREAD
155 endif
156
157 # flags for kludge files, won't have warnings generated
158 KFLAGS          = $(IFLAGS) -g -Wall $(ARCH_DEF)
159
160 ifndef DEBUG_FLAG
161 DEBUG_FLAG = -g
162 endif
163
164 ifeq ($(DEBUG_FLAG),none)
165 DEBUG_FLAG =
166 endif
167
168 ifdef DEBUG_FLAG
169 CFLAGS   += $(DEBUG_FLAG)
170 CXXFLAGS += $(DEBUG_FLAG)
171 KFLAGS   += $(DEBUG_FLAG)
172 endif
173
174 # flags for template files, don't define external template flags
175 # -g is optional in this case -- should be defined at module level
176 TFLAGS          = $(IFLAGS) -Wall $(TEMP_INLINE_DEFINES) $(ARCH_DEF)
177
178 ifdef USES_MT_THREAD
179 TFLAGS          += -DMT_THREAD
180 endif
181
182 ifdef DO_INLINE_ALL
183 CFLAGS         += $(ALL_INLINE_DEFINES)
184 CXXFLAGS       += $(ALL_INLINE_DEFINES)
185 endif
186
187 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
188 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
189 # we stick in (BACKUP_CORE)/lib _second_.
190 LIBDIR          = -L$(TO_CORE)/../lib/$(PLATFORM) \
191                         -L$(BACKUP_CORE)/../lib/$(PLATFORM)
192
193 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
194 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
195 # else set it to just "igen" (i.e. assume it's in the user's path)
196 ifdef CROSSCOMPILER
197 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 )
198 else
199 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 )
200 endif
201
202 ifdef NO_IMPLICIT_TEMPLATES
203 CFLAGS          += -fno-implicit-templates
204 CXXFLAGS        += -fno-implicit-templates
205 KFLAGS          += -fno-implicit-templates
206 TFLAGS          += -fno-implicit-templates
207 endif
208
209 ifndef INSTANTIATE_TEMPLATES
210 ifndef NO_IMPLICIT_TEMPLATES
211 # -fexternal-templates and -Dexternal_templates should both be used or
212 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
213 # (but not to TFLAGS).
214 #
215 CFLAGS          +=  -fexternal-templates -Dexternal_templates
216 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
217 KFLAGS          +=  -fexternal-templates -Dexternal_templates
218 endif
219 endif
220
221 ifdef USES_PVM
222 PVM_DIR         = $(PVM_ROOT)/lib/$(PVM_ARCH)
223 IFLAGS          += -I$(PVM_ROOT)/include
224 LIBDIR          += $(patsubst %,-L%,$(PVM_DIR))
225 VPATH           += $(PVM_DIR)
226 endif
227
228 ifdef USES_TCLTK
229 # Set TCL2C to $(TO_CORE)/tclStuff/tcl2c, if it exists, else
230 # set it to $(BACKUP_CORE)/tclStuff/tcl2c, if it exists, else
231 # set it to just tcl2c (i.e. assume it's in the user's shell path)
232 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 )
233 TCL2C_GEN_SRCS  = tcl2c.C
234
235 # Set TCLTK_INCLUDES to $(TO_CORE)/tclStuff/include, if it exists,
236 # else set it to $(BACKUP_CORE)/tclStuff/include.
237 TCLTK_INCLUDES  = $(shell if [ -d $(TO_CORE)/tclStuff/include ]; then echo $(TO_CORE)/tclStuff/include; else echo $(BACKUP_CORE)/tclStuff/include; fi )
238
239 TCLTK_LIBS      = /p/paradyn/packages/tcl7.5
240
241 IFLAGS          += $(patsubst %,-I%,$(TCLTK_INCLUDES))
242 ifdef CROSSCOMPILER
243 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_LIBS))
244 else
245 LIBDIR          += $(patsubst %,-L%/lib,$(TCLTK_LIBS))
246 endif
247 endif
248
249 ifdef USES_FLEX
250 FLEX_DIR        = /s/flex/lib
251 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
252 VPATH           += $(FLEX_DIR)
253 endif
254
255 ifdef CROSSCOMPILER
256 FLEX_DIR        = /s/flex/rs_aix41/lib
257 LIBDIR          += -L/p/sp2/gcc/lib 
258 endif
259
260 ifdef USES_LIBERTY
261 # Since libiberty.a is in the same g++ directory as libstdc++.a and
262 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
263 endif
264
265 ifdef USES_X11
266 ifeq ($(PLATFORM),sparc-sun-solaris2.4)
267 CFLAGS          += -I/usr/openwin/include
268 CXXFLAGS        += -I/usr/openwin/include
269 TFLAGS          += -I/usr/openwin/include
270 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
271 VPATH           += /usr/openwin/lib
272 endif
273
274 ifeq ($(PLATFORM),i386-unknown-solaris2.5)
275 CFLAGS          += -I/usr/openwin/include
276 CXXFLAGS        += -I/usr/openwin/include
277 TFLAGS          += -I/usr/openwin/include
278 LIBDIR          += -R/usr/openwin/lib -L/usr/openwin/lib
279 VPATH           += /usr/openwin/lib
280 endif
281
282 endif
283
284 # Include any per-user configuration changes; this "local" config file
285 # should *not* be under CVS control, so that it never gets committed.
286
287 -include $(TO_CORE)/make.config.local