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