make variable and parameter lists annotations to class Symbol instead of class members
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.236 2008/04/27 06:54:22 jaw Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 5.2
8
9 #BUILD_MARK     =
10 EXPLICIT_DEPENDS = 1
11 #USE_DEPRECATED_BPATCH_VECTOR   = 1
12 #IBM_BPATCH_COMPAT = 1
13 # Apart from actual "full" releases, don't modify these build Id components.
14 # For personal/experimental builds, feel free to use your core/make.config.local
15 # file to (re-)define BUILD_MARK as you desire.
16
17 # most "main" modules are only two levels deep, but we need to be able to
18 # change this for those that are deeper in the tree
19 ifndef TO_CORE
20 TO_CORE         = ../..
21 endif
22 TO_SCRIPTS = $(TO_CORE)/../scripts
23
24 # If the PLATFORM environment variable isn't set, we'll try to figure it out.
25 ifndef PLATFORM
26 SNAME = $(shell if [ -f ${TO_SCRIPTS}/sysname ]; then echo ${TO_SCRIPTS}/sysname; else pwd; fi )
27 ifdef SNAME
28 CURPLAT = $(shell ${SNAME})
29
30 # IA64/Linux, i386/Linux, or x86-64/Linux
31 ifneq (,$(findstring linux,$(CURPLAT)))
32 ifneq (,$(findstring ia64,$(CURPLAT)))
33 PLATFORM = ia64-unknown-linux2.4
34 endif 
35 ifneq (,$(findstring i686,$(CURPLAT)))
36 PLATFORM = i386-unknown-linux2.4
37 endif
38 ifneq (,$(findstring i586,$(CURPLAT)))
39 PLATFORM = i386-unknown-linux2.4
40 endif
41 ifneq (,$(findstring i486,$(CURPLAT)))
42 PLATFORM = i386-unknown-linux2.4
43 endif
44 ifneq (,$(findstring i386,$(CURPLAT)))
45 PLATFORM = i386-unknown-linux2.4
46 endif
47 ifneq (,$(findstring x86_64,$(CURPLAT)))
48 PLATFORM = x86_64-unknown-linux2.4cv
49 endif
50 endif
51 # AIX
52 ifneq (,$(findstring aix,$(CURPLAT)))
53 PLATFORM = rs6000-ibm-aix5.1
54 endif
55 # Solaris
56 ifneq (,$(findstring solaris,$(CURPLAT)))
57 PLATFORM = sparc-sun-solaris2.8
58 endif
59 # Irix
60 ifneq (,$(findstring irix,$(CURPLAT)))
61 PLATFORM = mips-sgi-irix6.5
62 endif
63 ifneq (,$(findstring osf,$(CURPLAT)))
64 PLATFORM = alpha-dec-osf5.1
65 endif
66
67 endif
68 endif
69
70 ifndef PLATFORM
71 $(error Could not determine you current platform.  Please set your PLATFORM environment variable to whichever closest matches your platform:  alpha-dec-osf5.1 i386-unknown-linux2.4 i386-unknown-nt4.0 ia64-unknown-linux2.4 ix86_64-unknown-linux2.4 mips-sgi-irix6.5 rs6000-ibm-aix5.1 rs6000-ibm-aix64-5.2 sparc-sun-solaris2.8 )
72 endif
73
74 # Destinations for library and executable installation (relative to core!)
75 # Warning: modification of the build/install structure is not recommended!
76 LIBRARY_DEST    = ../${PLATFORM}/lib
77 PROGRAM_DEST    = ../${PLATFORM}/bin
78 INCLUDE_DEST   = ../include
79
80 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
81 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
82 # with cvs), then we should look in a backup location.  That's what this vrble
83 # is about.  It's used several times below in this file.
84 GCC      = gcc
85 GXX      = g++
86 LINKER   = ld
87 AS              = as
88 CC       = $(GCC)
89 CXX      = $(GXX)
90 LEX      = flex
91 RANLIB   = ranlib
92 AR       = ar
93 YFLAGS   = -d -y
94 YACC     = bison
95 MV       = mv
96 CP       = cp
97 RM       = rm -f
98 LN       = ln -s
99 MKDIR           = mkdir -p
100 CHMOD    = chmod
101 PERL            = perl          # NB: perl v5 or higher required!
102
103 # COLLECTOR is only used by purify & quantify
104 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
105 # BUILDSTAMP is used to generate local build vouchers
106 BUILDSTAMP      = $(TO_CORE)/../scripts/buildstamp
107
108 ifndef PLATFORM
109 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
110 endif
111
112 # Define all tags based on the platform string. When a new platform
113 # is added, add it to the list
114
115 #
116 # Brief description of -Ds:
117 #
118 # CAP
119 # cap_save_the_world: support for creating a patched binary
120 # cap_relocation: function relocation
121 # cap_stripped_binaries: recursive parsing and function discovery without symbols
122 # cap_async_events: 
123 # cap_ptrace: uses ptrace interface
124 # cap_proc: uses /proc interface
125 # cap_proc_ioctl: uses ioctl interface to proc
126 # cap_proc_fd: uses solaris-style multiple-fd proc interface
127 # cap_threads: support for threaded applications
128 # cap_dynamic_heap: support for a dynamically growing inferior heap
129 # cap_threaded_times: (Linux only) times() returns per-thread information.
130 # cap_syscall_trap: The ability (or necessity) to place a trap instruction at the instruction following a system call.
131 # cap_slicing: (i386-unknown-linux2.4 and 2.6, sparc-sun-solaris2.8 and 2.9) Intraprocedural slicing feature
132 # cap_32_64: platforms that support 32- and 64-bit mutatees
133 # cap_liveness: liveness analysis
134 # cap_fixpoint_gen: Generate code using a fixpoint method that saves space
135 # cap_noaddr_gen: Allow code generation before determining the address code is going into
136 # cap_mutatee_traps: Traps can be handled mutatee side
137 #
138 # BUG
139 # bug_aix_broken_fork: AIX child process does not stop on fork if requested.
140 # bug_syscall_changepc_rewind: Linux rewinds the PC by <addr width> if
141 #   the change occurs within a system call; reported by SGI.
142
143 ifeq ($(PLATFORM),alpha-dec-osf5.1)
144 OLD_DEF     = -Dalpha_dec_osf4_0
145 ARCH_DEF    = -Darch_alpha
146 OS_DEF      = -Dos_osf=51
147 CAP_DEF     = -Dcap_proc -Dcap_proc_ioctl -Dcap_dynamic_heap
148 BUG_DEF     =
149 DONT_BUILD_PARADYN = 1
150 endif
151 ifeq ($(PLATFORM),mips-sgi-irix6.5)
152 OLD_DEF     = -Dmips_sgi_irix6_4
153 ARCH_DEF    = -Darch_mips
154 OS_DEF      = -Dos_irix=65
155 CAP_DEF     = -Dcap_proc -Dcap_proc_ioctl -Dcap_dynamic_heap
156 BUG_DEF     = -Dbug_irix_broken_sigstop
157 endif
158 ifeq ($(PLATFORM),i386-unknown-linux2.4)
159 OLD_DEF     = -Di386_unknown_linux2_0
160 ARCH_DEF    = -Darch_x86
161 OS_DEF      = -Dos_linux=24
162 CAP_DEF     = -Dcap_ptrace -Dno_cap_save_the_world -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps -Dno_cap_serialization
163 BUG_DEF     = -Dbug_syscall_changepc_rewind
164 endif
165 ifeq ($(PLATFORM),i386-unknown-linux2.6)
166 OLD_DEF     = -Di386_unknown_linux2_0
167 ARCH_DEF    = -Darch_x86
168 OS_DEF      = -Dos_linux=26
169 CAP_DEF     = -Dcap_ptrace -Dno_cap_save_the_world -Dcap_relocation -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_slicing -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps
170 BUG_DEF     = -Dbug_syscall_changepc_rewind
171 endif
172 ifeq ($(PLATFORM),x86_64-unknown-linux2.4)
173 OLD_DEF     = -Dx86_64_unknown_linux2_4
174 ARCH_DEF    = -Darch_x86_64
175 OS_DEF      = -Dos_linux=24
176 CAP_DEF     = -Dcap_ptrace -Dno_cap_save_the_world -Dcap_stripped_binaries -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_relocation -Dcap_dwarf -Dcap_32_64 -Dcap_liveness -Dcap_fixpoint_gen -Dcap_noaddr_gen -Dcap_mutatee_traps
177 BUG_DEF     = -Dbug_syscall_changepc_rewind
178 endif
179 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
180 OLD_DEF     = -Dia64_unknown_linux2_4
181 ARCH_DEF    = -Darch_ia64
182 OS_DEF      = -Dos_linux=24
183 CAP_DEF     = -Dcap_ptrace -Dcap_async_events -Dcap_unwind -Dcap_dynamic_heap -Dcap_threads -Dcap_dwarf
184 BUG_DEF     =
185 endif
186 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
187 OLD_DEF     = -Dsparc_sun_solaris2_4
188 ARCH_DEF    = -Darch_sparc
189 OS_DEF      = -Dos_solaris=8
190 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dno_cap_save_the_world -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf -Dcap_syscall_trap -Dcap_slicing
191 BUG_DEF     =
192 endif
193 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
194 OLD_DEF     = -Dsparc_sun_solaris2_4
195 ARCH_DEF    = -Darch_sparc
196 OS_DEF      = -Dos_solaris=9
197 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dno_cap_save_the_world -Dcap_async_events -Dcap_dynamic_heap -Dcap_threads -Dcap_relocation -Dcap_dwarf -Dcap_syscall_trap -Dcap_slicing
198 BUG_DEF     =
199 endif
200 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
201 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
202 ARCH_DEF    = -Darch_power
203 OS_DEF      = -Dos_aix=51
204 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dno_cap_save_the_world -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap -Dcap_liveness
205 BUG_DEF     = 
206 endif
207 ifeq ($(PLATFORM),rs6000-ibm-aix64-5.2)
208 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
209 ARCH_DEF    = -Darch_power
210 OS_DEF      = -Dos_aix=52
211 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world -Dcap_async_events -Dcap_relocation -Dcap_threads -Dcap_dynamic_heap -Dcap_syscall_trap -Dcap_32_64 -Dcap_liveness
212 BUG_DEF     = 
213 endif
214 ifeq ($(PLATFORM),ppc64_linux)
215 OLD_DEF     = -Dppc64_linux
216 ARCH_DEF    = -Darch_power -Darch_64bit
217 OS_DEF      = -Dos_linux=26
218 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness -Dcap_32_64
219 BUG_DEF     = -Dbug_syscall_changepc_rewind
220 endif
221 ifeq ($(PLATFORM),ppc32_linux)
222 OLD_DEF     = -Dppc32_linux
223 ARCH_DEF    = -Darch_power
224 OS_DEF      = -Dos_linux=26
225 CAP_DEF     = -Dcap_ptrace -Dcap_relocation -Dcap_async_events -Dcap_threads -Dcap_dynamic_heap -Dcap_dwarf -Dcap_liveness
226 BUG_DEF     = -Dbug_syscall_changepc_rewind
227 endif
228 #
229
230 # Combine all the #defines for ease of use
231 UNIFIED_DEF     = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
232
233 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
234 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
235 AS              = /usr/ccs/bin/as
236 RANLIB          = true
237 endif
238
239 ifeq (linux,$(findstring linux,$(OS_DEF)))
240 AS              = /usr/bin/as
241 RANLIB          = true 
242 ASFLAGS         =
243 else
244 ASFLAGS         = -P $(UNIFIED_DEF) 
245 endif 
246
247 # set the macros that control whether the stdint limit and constant
248 # macros are defined for C++ on the compilers command line so that
249 # we don't have to worry about the ordering of #includes.
250 ifeq (linux,$(findstring linux,$(PLATFORM)))
251 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
252 else
253 STDINT_MACROS   = 
254 endif # linux
255
256 # Default module compiler; modules which want $(CC) should redefine
257 # this, **NOT** CC
258
259 MODCC           = $(CXX)
260 MODCFLAGS       = $(CXXFLAGS)
261 DEPCC       = $(MODCC)
262
263 .SUFFIXES:      .I
264
265 # Added core/external for included external dependencies - bernat, 11JUN07
266 IFLAGS          = $(FIRST_INCLUDE) -I. -I$(TO_CORE) -I$(TO_CORE)/../$(PLATFORM)/include -I$(TO_CORE)/external -I$(TO_CORE)/dynutil/h
267
268 # uncomment/comment the line below to build with/without compilation warnings
269 # SILENCE_WARNINGS=true
270
271 ifndef SILENCE_WARNINGS
272 BASICWARNINGS   = -W -Wall
273
274 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
275                 -Wcast-qual            \
276                 -Wconversion        \
277                 -Wredundant-decls -Woverloaded-virtual
278
279 # not as strict as above, but can actually be used -- mdc
280 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
281                 -Wcast-qual            \
282                 -Wconversion        \
283                 -Woverloaded-virtual \
284                 -Wno-deprecated
285
286 # being nice to poor old pathetic tcl/tk header files --ari
287 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
288                 -Wcast-qual \
289                 -Wconversion \
290                 -Woverloaded-virtual
291
292 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
293 COMMONWARNINGS       += -Wno-unknown-pragmas
294 USEFULWARNINGS       += -Wno-unknown-pragmas
295 TCLFRIENDLYWARNINGS  += -Wno-unknown-pragmas
296 else   # STL on Solaris with cast-align generates a warning with much output
297 COMMONWARNINGS       += -Wcast-align
298 USEFULWARNINGS       += -Wcast-align
299 endif
300 endif # SILENCE_WARNINGS
301
302
303 ifndef GCC_2_95
304 GCC_VER := $(shell gcc --version)
305 ifneq (,$(findstring 2.95,$(GCC_VER)))
306 GCC_2_95 = true
307 endif
308 endif
309
310 ifndef OLD_GCC
311 GCC_VER := $(shell gcc --version | head -n 1 | perl -ane 'print pop(@F)')
312 versionNumbers = $(sort $(GCC_VER) 2.95)
313 versionNumber  = $(firstword $(versionNumbers))
314 ifneq (2.95, $(versionNumber))
315 OLD_GCC = true
316 endif
317 endif
318
319 ifndef OLD_GCC
320 COMMONWARNINGS += -Wno-non-template-friend
321 USEFULWARNINGS += -Wno-non-template-friend
322 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
323 endif
324
325 #don't inline -- for the files that won't emit template code
326 INLINE_DEFINES = 
327
328 #inline the private members of the class -- templates.o can use this
329 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
330
331 # inline everything -- the way things should be
332 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
333
334 USES_MT_THREAD =
335
336 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
337 USES_LIBDYNINST_SO = true
338 endif
339 ifeq (linux,$(findstring linux,$(PLATFORM)))
340 USES_LIBDYNINST_SO = true
341 endif
342
343 ifeq (irix,$(findstring irix,$(PLATFORM)))
344 USES_LIBDYNINST_SO = true
345 USES_NATIVE_CC = true
346 NATIVE_CC      = cc
347 NATIVE_CXX     = CC
348 endif
349
350 # Set this variable if it's desired that dyninst be built with the native
351 # compiler on Solaris
352 SOLARIS_NATIVE =  #1
353
354 ifdef SOLARIS_NATIVE
355 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
356 USES_LIBDYNINST_SO = true
357 USES_NATIVE_CC = true
358 NATIVE_CC      = cc
359 NATIVE_CXX     = CC
360 endif
361 endif
362
363 ifeq (osf,$(findstring osf,$(PLATFORM)))
364 USES_LIBDYNINST_SO = true
365 endif
366
367 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
368 ifndef IBM_BPATCH_COMPAT
369   USES_LIBDYNINST_SO = true
370 endif
371
372 USES_PERF_LIBRARY = true
373 # No longer used, because of relocation.
374 #USES_LIB_TEXT_HEAP = true
375
376 ifdef IBM_BPATCH_COMPAT
377   ifeq (ibm-aix, $(findstring ibm-aix, $(PLATFORM)))
378     USES_NATIVE_CC = true
379     NATIVE_CC = xlc
380     NATIVE_CXX = xlC
381     DEPCC = xlC
382     DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
383   endif
384 endif
385
386 # As of AIX 5, the pm_init function in libpmapi takes more
387 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
388 # and handled in the paradyn runtime library
389 PMAPI_VERSION := $(shell uname -v )
390 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
391 USES_PMAPI_GROUPS = true
392 endif
393 endif
394
395 # if we don't want OPT_FLAG defined for a particular part of the code
396 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
397 # the include of make.config - naim
398 ifndef NO_OPT_FLAG
399 OPT_FLAG        = -O2
400 endif
401
402 ifeq (ibm-aix64-, $(findstring ibm-aix64-, $(PLATFORM)))
403     ARCH_FLAGS   = -maix64 -Drs6000_ibm_aix64
404 endif
405
406 # flags for normal (non-kludge) files, with common warnings
407 CFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(ARCH_FLAGS)
408 CXXFLAGS        = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
409 LDFLAGS         = $(ARCH_FLAGS)
410
411 # flags for kludge files, won't have warnings generated
412 KFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
413
414 ifdef COVERAGE
415
416 CFLAGS += -fprofile-arcs -ftest-coverage
417 CXXFLAGS += -fprofile-arcs -ftest-coverage
418 LDFLAGS += -fprofile-arcs -ftest-coverage
419
420 endif
421
422 ifdef USING_PURIFY
423 CFLAGS          += -DPURE_BUILD
424 CXXFLAGS        += -DPURE_BUILD
425 endif
426
427 ifdef USES_MT_THREAD
428 CFLAGS          += -DMT_THREAD
429 CXXFLAGS        += -DMT_THREAD
430 endif
431
432 ifdef USES_PERF_LIBRARY
433 # Add any platform-specific performance libraries here
434 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
435 USES_PMAPI = true
436 CFLAGS          += -DUSES_PMAPI
437 CXXFLAGS        += -DUSES_PMAPI
438 LDFLAGS         += -lpmapi
439 ifdef USES_PMAPI_GROUPS
440 CFLAGS          += -DPMAPI_GROUPS
441 CXXFLAGS        += -DPMAPI_GROUPS
442 endif # USES_PMAPI_GROUPS
443 endif # ibm-aix
444 endif # perf_library
445
446 ifdef USE_DEPRECATED_BPATCH_VECTOR
447 CXXFLAGS        += -DUSE_DEPRECATED_BPATCH_VECTOR
448 CFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
449 TFLAGS          += -DUSE_DEPRECATED_BPATCH_VECTOR
450 else
451 #CFLAGS        += -fimplicit-templates
452 CXXFLAGS        += -fimplicit-templates
453 TFLAGS        += -fimplicit-templates
454 endif
455
456 ifdef IBM_BPATCH_COMPAT
457 CXXFLAGS        += -DIBM_BPATCH_COMPAT
458 CFLAGS          += -DIBM_BPATCH_COMPAT
459 endif
460
461 ifndef OPT_FLAG
462 KFLAGS          += -g
463 DEBUG_FLAG = -g
464 endif
465
466 ifeq ($(DEBUG_FLAG),none)
467 DEBUG_FLAG =
468 endif
469
470 ifdef DEBUG_FLAG
471 CFLAGS   += $(DEBUG_FLAG)
472 CXXFLAGS += $(DEBUG_FLAG)
473 KFLAGS   += $(DEBUG_FLAG)
474 endif
475
476 # flags for template files, don't define external template flags
477 # -g is optional in this case -- should be defined at module level
478 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) $(STDINT_MACROS) $(ARCH_FLAGS)
479
480 ifdef USES_MT_THREAD
481 TFLAGS          += -DMT_THREAD
482 endif
483
484 ifdef DO_INLINE_ALL
485 CFLAGS         += $(ALL_INLINE_DEFINES)
486 CXXFLAGS       += $(ALL_INLINE_DEFINES)
487 endif
488
489 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
490 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
491 LIBDIR          = $(FIRST_LIBDIR) \
492                  -L$(TO_CORE)/../$(PLATFORM)/lib 
493
494 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
495 # else set it to just "igen" (i.e. assume it's in the user's path)
496 ifdef CROSSCOMPILER
497 IGEN = $(shell if [ -f ${TO_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${TO_CORE}/../${BASEPLATFORM}/bin/igen; else if [ -f ${TO_CORE}/igen/${BASEPLATFORM}/igen ]; then echo ${TO_CORE}/igen/${BASEPLATFORM}/igen; else echo igen; fi; fi )
498 else
499 IGEN = $(shell if [ -f ${TO_CORE}/${PROGRAM_DEST}/igen ]; then echo ${TO_CORE}/${PROGRAM_DEST}/igen; else if [ -f ${TO_CORE}/igen/$(PLATFORM)/igen ]; then echo ${TO_CORE}/igen/${PLATFORM}/igen; else echo igen; fi; fi )
500 endif
501
502 ifdef NO_IMPLICIT_TEMPLATES
503 ifdef USE_DEPRECATED_BPATCH_VECTOR
504 #  CFLAGS               += -fno-implicit-templates
505   CXXFLAGS      += -fno-implicit-templates
506   KFLAGS                += -fno-implicit-templates
507 endif
508 endif
509
510 ifndef INSTANTIATE_TEMPLATES
511 ifndef NO_IMPLICIT_TEMPLATES
512 # -fexternal-templates and -Dexternal_templates should both be used or
513 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
514 # (but not to TFLAGS).
515 #
516 #CFLAGS         +=  -fexternal-templates -Dexternal_templates
517 ifneq ($(PLATFORM),ppc32_linux)
518 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
519 KFLAGS          +=  -fexternal-templates -Dexternal_templates
520 endif
521 endif
522 endif
523
524 THREADSLIB      =
525 USE_PTHREADS    = yes
526
527 ifeq (xyes,x$(USE_PTHREADS))
528 THREADSLIB      += -lpthread
529
530 # On Linux, programs using pthreads are supposed to define _REENTRANT
531 ifeq (linux,$(findstring linux,$(PLATFORM)))
532 CFLAGS                  += -D_REENTRANT=1
533 CXXFLAGS                += -D_REENTRANT=1
534 KFLAGS                  += -D_REENTRANT=1
535 TFLAGS                  += -D_REENTRANT=1
536 endif
537
538 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
539 #CFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
540 #CXXFLAGS               += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
541 #KFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
542 #TFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
543 endif
544
545 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
546 CFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
547 CXXFLAGS                += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
548 KFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
549 TFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
550 endif
551
552 endif
553
554 # System build constraints
555 #Build the MT daemon on AIX, Solaris, and Linux/x86
556 DONT_BUILD_PD_MT = true
557 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
558 DONT_BUILD_PD_MT =
559 endif
560 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
561 DONT_BUILD_PD_MT =
562 endif
563 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
564 DONT_BUILD_PD_MT =
565 endif
566
567 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
568
569 # Include any per-user configuration changes; this "local" config file
570 # should *not* be under CVS control, so that it never gets committed.
571 -include $(TO_CORE)/make.config.local
572
573 # Choose default development directories if necessary variables are unset
574
575 ifdef USES_MMTIMER
576 CFLAGS             += -Dcap_mmtimer
577 CXXFLAGS           += -Dcap_mmtimer
578 endif
579
580 ifdef USES_TCLTK
581 ifndef TCLTK_DIR
582 $(error error: TCLTK_DIR is not set.  Please set in make.config.local)
583 endif
584 TCLTK_LIB_DIR  ?= $(TCLTK_DIR)/lib
585 TCLTK_INC_DIR  ?= $(TCLTK_DIR)/include
586 endif
587
588 ifdef USES_UNWIND_LIB
589 CFLAGS         += -Dcap_unwind
590 CXXFLAGS       += -Dcap_unwind 
591 LIBUNWIND_LIB  ?= $(LIBUNWINDDIR)/lib
592 LIBUNWIND_INC  ?= $(LIBUNWINDDIR)/include
593 endif
594
595 ifdef USES_DWARF_DEBUG
596 LIBDWARF_INC   ?= $(LIBDWARFDIR)/include
597 LIBDWARF_LIB   ?= $(LIBDWARFDIR)/lib
598 endif
599
600 ifdef USES_LIBELF
601 LIBELF_INC     ?= $(LIBELFDIR)/include
602 LIBELF_LIB     ?= $(LIBELFDIR)/lib
603 endif
604
605 ifdef USES_FLEX
606 ifdef FLEX_DIR
607 WITHLIBFL       = --with-libfldir=$(FLEX_DIR)
608 else
609 WITHLIBFL       =
610 endif
611 endif
612
613 NASM           ?= nasm
614
615 #Build other variables based off of the above defaults
616
617 ifdef USES_TCLTK
618 # use the first set if using tcl8.4,
619 # use the second set if still using tcl8.3
620 ifndef USE_TCL83
621
622 TCLTK_LIBVER_ID = 8.4
623 CFLAGS      += -DTCLCONST=const
624 CXXFLAGS    += -DTCLCONST=const
625 KFLAGS      += -DTCLCONST=const
626 TFLAGS      += -DTCLCONST=const
627
628 else
629
630 TCLTK_LIBVER_ID = 8.3
631 CFLAGS      += -DTCLCONST=""
632 CXXFLAGS    += -DTCLCONST=""
633 KFLAGS      += -DTCLCONST=""
634 TFLAGS      += -DTCLCONST=""
635
636 endif
637
638 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
639 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
640
641 ifdef LIBTCLTKSTATIC
642 TCLTK_LIBS      += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
643 else
644 TCLTK_LIBS      += $(TCL_LIB) $(TK_LIB)
645 endif
646
647 # TCL2C is used to generate compilable sources from tcl files
648 TCL2C           = $(TO_CORE)/../scripts/tcl2c
649 TCL2C_GEN_SRCS  = tcl2c.C
650
651 IFLAGS          += -I$(TCLTK_INC_DIR)
652 ifdef CROSSCOMPILER
653 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
654 else
655 LIBDIR      += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
656 endif
657
658 endif # USES_TCLTK
659
660 ifdef USES_PAPI
661 PAPI_INCDIR     = $(PAPI_ROOT)
662 PAPI_LIBDIR     = $(PAPI_ROOT)
663 #PAPI_LIB       = -Wl,-static -lpapi -Wl,-Bdynamic
664 #PAPI_LIB       = $(PAPI_LIBDIR)/libpapi.a
665 PAPI_LIB        = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi  
666 IFLAGS          += -I$(PAPI_INCDIR)
667 LIBDIR          += $(patsubst %,-L%,$(PAPI_LIBDIR))
668 CFLAGS          += -DPAPI 
669 CXXFLAGS        += -DPAPI
670 TFLAGS          += -DPAPI 
671 endif
672
673 ifdef USES_FLEX
674 FLEX_LIB        = -lfl
675 ifdef FLEX_DIR
676 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
677 VPATH           += $(FLEX_DIR)
678 endif
679 endif
680
681 ifdef CROSSCOMPILER
682 FLEX_DIR        = /s/flex/rs_aix41/lib
683 LIBDIR          += -L/p/sp2/gcc/lib 
684 endif
685
686 ifdef USES_LIBERTY
687 # Since libiberty.a is in the same g++ directory as libstdc++.a and
688 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
689 endif
690
691 ifdef USES_X11
692 X11_LIB         = -lX11
693
694 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
695 X11DIR          = /usr/openwin
696 CFLAGS          += -I$(X11DIR)/include
697 CXXFLAGS        += -I$(X11DIR)/include
698 TFLAGS          += -I$(X11DIR)/include
699 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
700 endif
701
702 ifeq (linux,$(findstring linux,$(PLATFORM)))
703 X11DIR          = /usr/X11R6
704 CFLAGS          += -I$(X11DIR)/include/X11
705 CXXFLAGS        += -I$(X11DIR)/include/X11
706 TFLAGS          += -I$(X11DIR)/include/X11
707 LIBDIR          += -L$(X11DIR)/lib
708 endif
709
710 ifeq (x86_64,$(findstring x86_64,$(PLATFORM)))
711 LIBDIR          += -L$(X11DIR)/lib64
712 endif
713 ifeq (ibm-aix,$(findstring ibm-aix,$(PLATFORM)))
714 X11DIR          = /usr
715 endif
716
717 endif # USES_X11