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