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