Moved file paths to make.config.local
[dyninst.git] / make.config
1 # Paradyn overall build configuration (unix)
2 #
3 # $Id: make.config,v 1.170 2004/06/24 22:27:39 legendre Exp $
4 #
5
6 SUITE_NAME      = Paradyn
7 RELEASE_NUM     = 4.1
8
9 #BUILD_MARK     =
10 EXPLICIT_DEPENDS = 1
11 #USE_STL_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 # ***** IMPORTANT INSTALLATION/CONFIGURATION INSTRUCTIONS *****
18 # Unless your site is set-up identically to that of the Paradyn/DyninstAPI
19 # developers, you should carefully examine the (GNU)make configuration
20 # parameters defined in this file, particularly utilities such as the C/C++
21 # compilers, perl, flex and bison, and the installed locations and names
22 # for FLEX, TCL/TK, and X11
23
24 # most "main" modules are only two levels deep, but we need to be able to
25 # change this for those that are deeper in the tree
26 ifndef TO_CORE
27 TO_CORE         = ../..
28 endif
29
30 # Destinations for library and executable installation (relative to core!)
31 # Warning: modification of the build/install structure is not recommended!
32 LIBRARY_DEST    = ../${PLATFORM}/lib
33 PROGRAM_DEST    = ../${PLATFORM}/bin
34
35 # Usually, we look for files, binaries, libs in $(TO_CORE)/....<something>.
36 # But if the file doesn't exist there (i.e. if the user hasn't checked them out
37 # with cvs), then we should look in a backup location.  That's what this vrble
38 # is about.  It's used several times below in this file.
39 BACKUP_CORE = /p/paradyn/core
40
41 GCC      = gcc
42 GXX      = g++
43 LINKER   = ld
44 AS              = as
45 CC       = $(GCC)
46 CXX      = $(GXX)
47 LEX      = flex
48 RANLIB   = ranlib
49 AR       = ar
50 YFLAGS   = -d -y
51 YACC     = bison
52 MV       = mv
53 CP       = cp
54 RM       = rm -f
55 MKDIR           = mkdir -p
56 PERL            = perl          # NB: perl v5 or higher required!
57
58 # COLLECTOR is only used by purify & quantify
59 COLLECTOR       = /s/gcc-2.7.2/bin/../lib/gcc-lib/$(PLATFORM)/2.7.2/ld
60 # BUILDSTAMP is used to generate local build vouchers
61 BUILDSTAMP      = $(TO_CORE)/../scripts/buildstamp
62
63 ifndef PLATFORM
64 BUILDERROR: PLATFORM must be defined in environment to build (and run) Paradyn
65 endif
66
67 # Define all tags based on the platform string. When a new platform
68 # is added, add it to the list
69
70 ifeq ($(PLATFORM),alpha-dec-osf5.1)
71 OLD_DEF     = -Dalpha_dec_osf4_0
72 ARCH_DEF    = -Darch_alpha
73 OS_DEF      = -Dos_osf=51
74 CAP_DEF     = -Dcap_proc -Dcap_proc_ioctl
75 BUG_DEF     =
76 endif
77 ifeq ($(PLATFORM),mips-sgi-irix6.5)
78 OLD_DEF     = -Dmips_sgi_irix6_4
79 ARCH_DEF    = -Darch_mips
80 OS_DEF      = -Dos_irix=65
81 CAP_DEF     = -Dcap_proc -Dcap_proc_ioctl
82 BUG_DEF     = -Dbug_irix_broken_sigstop
83 endif
84 ifeq ($(PLATFORM),i386-unknown-linux2.4)
85 OLD_DEF     = -Di386_unknown_linux2_0
86 ARCH_DEF    = -Darch_x86
87 OS_DEF      = -Dos_linux=24
88 CAP_DEF     = -Dcap_ptrace -Dcap_save_the_world
89 BUG_DEF     =
90 endif
91 ifeq ($(PLATFORM),i386-unknown-linux2.6)
92 OLD_DEF     = -Di386_unknown_linux2_0
93 ARCH_DEF    = -Darch_x86
94 OS_DEF      = -Dos_linux=26
95 CAP_DEF     = -Dcap_ptrace -Dcap_save_the_world
96 BUG_DEF     =
97 endif
98 ifeq ($(PLATFORM),ia64-unknown-linux2.4)
99 OLD_DEF     = -Dia64_unknown_linux2_4
100 ARCH_DEF    = -Darch_ia64
101 OS_DEF      = -Dos_linux=24
102 CAP_DEF     = -Dcap_ptrace
103 BUG_DEF     =
104 endif
105 ifeq ($(PLATFORM),sparc-sun-solaris2.8)
106 OLD_DEF     = -Dsparc_sun_solaris2_4
107 ARCH_DEF    = -Darch_sparc
108 OS_DEF      = -Dos_solaris=8
109 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
110 BUG_DEF     =
111 endif
112 ifeq ($(PLATFORM),sparc-sun-solaris2.9)
113 OLD_DEF     = -Dsparc_sun_solaris2_4
114 ARCH_DEF    = -Darch_sparc
115 OS_DEF      = -Dos_solaris=9
116 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
117 BUG_DEF     =
118 endif
119 ifeq ($(PLATFORM),rs6000-ibm-aix5.1)
120 OLD_DEF     = -Drs6000_ibm_aix5_1 -Drs6000_ibm_aix4_1
121 ARCH_DEF    = -Darch_power
122 OS_DEF      = -Dos_aix=51
123 CAP_DEF     = -Dcap_proc -Dcap_proc_fd -Dcap_save_the_world
124 BUG_DEF     = -Dbug_aix_proc_broken_fork
125 endif
126 #
127
128 # Combine all the #defines for ease of use
129 UNIFIED_DEF     = $(ARCH_DEF) $(OS_DEF) $(VER_DEF) $(CAP_DEF) $(BUG_DEF) $(OLD_DEF)
130
131 #ifeq (solaris,$(findstring solaris,$(PLATFORM)))
132 ifeq (solaris,$(findstring solaris,$(OS_DEF)))
133 AS              = /usr/ccs/bin/as
134 RANLIB          = true
135 endif
136
137 ifeq (linux,$(findstring linux,$(OS_DEF)))
138 AS              = /usr/bin/as
139 RANLIB          = true 
140 endif 
141
142 ifeq (ia64,$(findstring ia64,$(ARCH_DEF)))
143 ASFLAGS         =
144 else
145 ASFLAGS         = -P $(UNIFIED_DEF) 
146 endif
147
148 # set the macros that control whether the stdint limit and constant
149 # macros are defined for C++ on the compilers command line so that
150 # we don't have to worry about the ordering of #includes.
151 ifeq (linux,$(findstring linux,${PLATFORM}))
152 STDINT_MACROS   = -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
153 else
154 STDINT_MACROS   = 
155 endif # linux
156
157
158 # Default module compiler; modules which want $(CC) should redefine
159 # this, **NOT** CC
160
161 MODCC           = $(CXX)
162 MODCFLAGS       = $(CXXFLAGS)
163 DEPCC       = $(CC)
164 DEPCFLAGS   = -MM $(CFLAGS)
165 DEPCXX      = $(CXX)
166 DEPCXXFLAGS = -MM $(CXXFLAGS)
167
168
169 .SUFFIXES:      .I
170
171 IFLAGS          = $(FIRST_INCLUDE) -I. -I$(TO_CORE) -I${TO_CORE}/../${PLATFORM}/include
172
173 # uncomment/comment the line below to build with/without compilation warnings
174 # SILENCE_WARNINGS=true
175
176 ifndef SILENCE_WARNINGS
177 BASICWARNINGS   = -W -Wall
178
179 COMMONWARNINGS  = -W -Wall -Wshadow -Wpointer-arith       \
180                 -Wcast-qual            \
181                 -Wconversion        \
182                 -Wredundant-decls -Woverloaded-virtual
183
184 # not as strict as above, but can actually be used -- mdc
185 USEFULWARNINGS  = -W -Wall -Wpointer-arith       \
186                 -Wcast-qual            \
187                 -Wconversion        \
188                 -Woverloaded-virtual \
189                 -Wno-deprecated
190
191 # being nice to poor old pathetic tcl/tk header files --ari
192 TCLFRIENDLYWARNINGS = -W -Wall -Wpointer-arith \
193                 -Wcast-qual \
194                 -Wconversion \
195                 -Woverloaded-virtual
196
197 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
198 COMMONWARNINGS       += -Wno-unknown-pragmas
199 USEFULWARNINGS       += -Wno-unknown-pragmas
200 TCLFRIENDLYWARNINGS  += -Wno-unknown-pragmas
201 else   # STL on Solaris with cast-align generates a warning with much output
202 COMMONWARNINGS       += -Wcast-align
203 USEFULWARNINGS       += -Wcast-align
204 endif
205 endif # SILENCE_WARNINGS
206
207
208 ifndef GCC_2_95
209 GCC_VER := $(shell gcc --version)
210 ifneq (,$(findstring 2.95,$(GCC_VER)))
211 GCC_2_95 = true
212 endif
213 endif
214
215 ifndef OLD_GCC
216 GCC_VER := $(shell gcc --version | head -1 | perl -ane 'print pop(@F)')
217 versionNumbers = $(sort $(GCC_VER) 2.95)
218 versionNumber  = $(firstword $(versionNumbers))
219 ifneq (2.95, $(versionNumber))
220 OLD_GCC = true
221 endif
222 endif
223
224 ifndef OLD_GCC
225 COMMONWARNINGS += -Wno-non-template-friend
226 USEFULWARNINGS += -Wno-non-template-friend
227 TCLFRIENDLYWARNINGS += -Wno-non-template-friend
228 endif
229
230 #don't inline -- for the files that won't emit template code
231 INLINE_DEFINES = 
232
233 #inline the private members of the class -- templates.o can use this
234 TEMP_INLINE_DEFINES = -DDO_INLINE_P="inline"
235
236 # inline everything -- the way things should be
237 ALL_INLINE_DEFINES = -DDO_INLINE_F="inline" -DDO_INLINE_P="inline"
238
239 USES_MT_THREAD =
240
241 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
242 USES_LIBDYNINST_SO = true
243 USES_DYNAMIC_INF_HEAP = true
244 endif
245 ifeq (linux,$(findstring linux,$(PLATFORM)))
246 USES_LIBDYNINST_SO = true
247 USES_DYNAMIC_INF_HEAP = true
248 endif
249
250 ifeq (irix,$(findstring irix,$(PLATFORM)))
251 USES_LIBDYNINST_SO = true
252 USES_DYNAMIC_INF_HEAP = true
253 USES_NATIVE_CC = true
254 NATIVE_CC      = cc
255 NATIVE_CXX     = CC
256 endif
257
258 # Set this variable if it's desired that dyninst be built with the native
259 # compiler on Solaris
260 SOLARIS_NATIVE =  #1
261
262 ifdef SOLARIS_NATIVE
263 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
264 USES_LIBDYNINST_SO = true
265 USES_DYNAMIC_INF_HEAP = true
266 USES_NATIVE_CC = true
267 NATIVE_CC      = cc
268 NATIVE_CXX     = CC
269 endif
270 endif
271
272 ifeq (osf,$(findstring osf,$(PLATFORM)))
273 USES_LIBDYNINST_SO = true
274 USES_DYNAMIC_INF_HEAP = true
275 endif
276
277 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
278 ifndef IBM_BPATCH_COMPAT
279   USES_LIBDYNINST_SO = true
280 endif
281
282 USES_DYNAMIC_INF_HEAP = true
283 USES_PERF_LIBRARY = true
284 USES_LIB_TEXT_HEAP = true
285
286 ifdef IBM_BPATCH_COMPAT
287   ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
288     USES_NATIVE_CC = true
289     NATIVE_CC = xlc
290     NATIVE_CXX = xlC
291     DEPCC = xlC
292     DEPENDFLAGS = -M -E -qhalt=E -qro -qtbtable=full -DCOMPILER="xlC"
293   endif
294 endif
295
296 # As of AIX 5, the pm_init function in libpmapi takes more
297 # parameters. This is keyed by the USES_PMAPI_GROUPS define,
298 # and handled in the paradyn runtime library
299 PMAPI_VERSION := $(shell uname -v )
300 ifeq (5, $(findstring 5,$(PMAPI_VERSION)))
301 USES_PMAPI_GROUPS = true
302 endif
303 endif
304
305 # if we don't want OPT_FLAG defined for a particular part of the code
306 # (e.g. rtinst for aix), we just need to define NO_OPT_FLAG before doing
307 # the include of make.config - naim
308 ifndef NO_OPT_FLAG
309 OPT_FLAG        = -O2
310 endif
311
312 # flags for normal (non-kludge) files, with common warnings
313 CFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS)
314 CXXFLAGS        = $(IFLAGS) $(UNIFIED_DEF) $(OPT_FLAG) $(COMMON_WARNINGS) ${STDINT_MACROS}
315
316 # flags for kludge files, won't have warnings generated
317 KFLAGS          = $(IFLAGS) $(UNIFIED_DEF) $(BASICWARNINGS)
318
319 CFLAGS += -DOLD_LINE_INFO 
320 CXXFLAGS += -DOLD_LINE_INFO 
321
322 ifdef COVERAGE
323
324 CFLAGS += -fprofile-arcs -ftest-coverage
325 CXXFLAGS += -fprofile-arcs -ftest-coverage
326 LDFLAGS += -fprofile-arcs -ftest-coverage
327
328 endif
329
330 ifdef USING_PURIFY
331 CFLAGS          += -DPURE_BUILD
332 CXXFLAGS        += -DPURE_BUILD
333 endif
334
335 ifdef USES_MT_THREAD
336 CFLAGS          += -DMT_THREAD
337 CXXFLAGS        += -DMT_THREAD
338 endif
339
340 ifeq (osf,$(findstring osf,$(PLATFORM)))
341 CFLAGS += -DOLD_LINE_INFO 
342 CXXFLAGS += -DOLD_LINE_INFO 
343 TFLAGS += -DOLD_LINE_INFO 
344 endif
345 ifdef USES_PERF_LIBRARY
346 # Add any platform-specific performance libraries here
347 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
348 USES_PMAPI = true
349 CFLAGS          += -DUSES_PMAPI
350 CXXFLAGS        += -DUSES_PMAPI
351 LDFLAGS         += -lpmapi
352 ifdef USES_PMAPI_GROUPS
353 CFLAGS          += -DPMAPI_GROUPS
354 CXXFLAGS        += -DPMAPI_GROUPS
355 endif # USES_PMAPI_GROUPS
356 endif # rs6000
357 endif # perf_library
358
359 ifdef AIX_PROC
360 CFLAGS          += -DAIX_PROC
361 CXXFLAGS        += -DAIX_PROC
362 endif
363
364 ifdef USES_DYNAMIC_INF_HEAP
365 CFLAGS          += -DUSES_DYNAMIC_INF_HEAP
366 CXXFLAGS        += -DUSES_DYNAMIC_INF_HEAP
367 endif
368
369 ifdef USE_STL_VECTOR
370 CXXFLAGS        += -DUSE_STL_VECTOR
371 CFLAGS          += -fimplicit-templates
372 CXXFLAGS        += -fimplicit-templates
373 endif
374
375 ifdef IBM_BPATCH_COMPAT
376 CXXFLAGS        += -DIBM_BPATCH_COMPAT
377 CFLAGS          += -DIBM_BPATCH_COMPAT
378 endif
379
380 ifndef OPT_FLAG
381 KFLAGS          += -g
382 ifndef DEBUG_FLAG
383 DEBUG_FLAG = -g
384 endif
385 endif
386
387 ifeq ($(DEBUG_FLAG),none)
388 DEBUG_FLAG =
389 endif
390
391 ifdef DEBUG_FLAG
392 CFLAGS   += $(DEBUG_FLAG)
393 CXXFLAGS += $(DEBUG_FLAG)
394 KFLAGS   += $(DEBUG_FLAG)
395 endif
396
397 # flags for template files, don't define external template flags
398 # -g is optional in this case -- should be defined at module level
399 TFLAGS          = $(IFLAGS) $(TEMP_INLINE_DEFINES) $(UNIFIED_DEF) $(OPT_FLAG) $(BASICWARNINGS) ${STDINT_MACROS}
400
401 TFLAGS += -DOLD_LINE_INFO
402
403 ifdef USES_MT_THREAD
404 TFLAGS          += -DMT_THREAD
405 endif
406
407 ifdef USE_STL_VECTOR
408 TFLAGS          += -DUSE_STL_VECTOR
409 TFLAGS          += -fimplicit-templates
410 endif
411
412 ifdef DO_INLINE_ALL
413 CFLAGS         += $(ALL_INLINE_DEFINES)
414 CXXFLAGS       += $(ALL_INLINE_DEFINES)
415 endif
416
417 # Start off LIBDIR to point to the user's devel area's paradyn lib directory.
418 # As a backup, in case the user hasn't checked out & compiled some paradyn lib,
419 # we stick in (BACKUP_CORE)/lib _second_.
420 LIBDIR          = $(FIRST_LIBDIR) \
421                 -L$(TO_CORE)/../lib/$(PLATFORM) \
422                 -L$(TO_CORE)/../${PLATFORM}/lib \
423                             -L$(BACKUP_CORE)/../lib/$(PLATFORM) \
424                             -L$(BACKUP_CORE)/../$(PLATFORM)/lib
425
426 # Set IGEN to point to $(TO_CORE)/../bin/$(PLATFORM)/igen, if it exists,
427 # else set it to $(BACKUP_CORE)/../bin/$(PLATFORM)/igen, if it exists,
428 # else set it to just "igen" (i.e. assume it's in the user's path)
429 ifdef CROSSCOMPILER
430 IGEN = $(shell if [ -f ${TO_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${TO_CORE}/../${BASEPLATFORM}/bin/igen; else if [ -f ${BACKUP_CORE}/../${BASEPLATFORM}/bin/igen ]; then echo ${BACKUP_CORE}/../${BASEPLATFORM}/bin/igen; else echo igen; fi; fi )
431 else
432 IGEN = $(shell if [ -f ${TO_CORE}/${PROGRAM_DEST}/igen ]; then echo ${TO_CORE}/${PROGRAM_DEST}/igen; else if [ -f ${BACKUP_CORE}/${PROGRAM_DEST}/igen ]; then echo ${BACKUP_CORE}/${PROGRAM_DEST}/igen; else echo igen; fi; fi )
433 endif
434
435 ifdef NO_IMPLICIT_TEMPLATES
436 ifndef USE_STL_VECTOR
437 #  CFLAGS               += -fno-implicit-templates
438   CXXFLAGS      += -fno-implicit-templates
439   KFLAGS                += -fno-implicit-templates
440 endif
441 endif
442
443 ifndef INSTANTIATE_TEMPLATES
444 ifndef NO_IMPLICIT_TEMPLATES
445 # -fexternal-templates and -Dexternal_templates should both be used or
446 # neither should be used; add them to CFLAGS, CXXFLAGS, and KFLAGS
447 # (but not to TFLAGS).
448 #
449 #CFLAGS         +=  -fexternal-templates -Dexternal_templates
450 CXXFLAGS        +=  -fexternal-templates -Dexternal_templates
451 KFLAGS          +=  -fexternal-templates -Dexternal_templates
452 endif
453 endif
454
455 THREADSLIB      =
456 USE_PTHREADS    = yes
457
458 ifeq (xyes,x$(USE_PTHREADS))
459 THREADSLIB      += -lpthread
460
461 # On Linux, programs using pthreads are supposed to define _REENTRANT
462 ifeq (linux,$(findstring linux,$(PLATFORM)))
463 CFLAGS                  += -D_REENTRANT=1
464 CXXFLAGS                += -D_REENTRANT=1
465 KFLAGS                  += -D_REENTRANT=1
466 TFLAGS                  += -D_REENTRANT=1
467 endif
468
469 ifeq (rs6000,$(findstring rs6000,$(PLATFORM)))
470 #CFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
471 #CXXFLAGS               += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
472 #KFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
473 #TFLAGS                 += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
474 endif
475
476 ifeq (solaris,$(findstring linux,$(PLATFORM)))
477 CFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
478 CXXFLAGS                += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
479 KFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
480 TFLAGS                  += -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_THREAD_SAFE_ERRNO=1
481 endif
482
483 endif
484
485 # System build constraints
486 #Build the MT daemon on AIX, Solaris, and Linux/x86
487 DONT_BUILD_PD_MT = true
488 ifeq (rs6000-ibm-aix,$(findstring rs6000-ibm-aix,$(PLATFORM)))
489 DONT_BUILD_PD_MT =
490 endif
491 ifeq (sparc-sun-solaris,$(findstring sparc-sun-solaris,$(PLATFORM)))
492 DONT_BUILD_PD_MT =
493 endif
494 ifeq (i386-unknown-linux2.4,$(findstring i386-unknown-linux2.4,$(PLATFORM)))
495 DONT_BUILD_PD_MT =
496 endif
497
498 # ***** EXTERNAL SOFTWARE CONFIGURATION *****
499
500 # Include any per-user configuration changes; this "local" config file
501 # should *not* be under CVS control, so that it never gets committed.
502 -include $(TO_CORE)/make.config.local
503
504 # Choose default development directories if necessary variables are unset
505
506 ifdef USES_TCLTK
507 ifdef USE_TCL83
508 TCLTK_DIR     ?= /p/paradyn/packages/tcl8.3.4
509 else
510 TCLTK_DIR     ?= /p/paradyn/packages/tcl8.4.5
511 endif
512 TCLTK_LIB_DIR  ?= $(TCLTK_DIR)/lib
513 TCLTK_INC_DIR  ?= $(TCLTK_DIR)/include
514 endif
515
516 ifdef USES_UNWIND_LIB
517 LIBUNWINDDIR    ?= /p/paradyn/packages/libunwind
518 LIBUNWIND_LIB  ?= $(LIBUNWINDDIR)/lib
519 LIBUNWIND_INC  ?= $(LIBUNWINDDIR)/include
520 endif
521
522 ifdef USES_DWARF_DEBUG
523 LIBDWARFDIR    ?= /p/paradyn/packages/libdwarf
524 LIBDWARF_INC   ?= $(LIBDWARFDIR)/include
525 LIBDWARF_LIB   ?= $(LIBDWARFDIR)/lib
526 endif
527
528 ifdef USES_LIBELF
529 LIBELFDIR      ?= /p/paradyn/packages/libelf
530 LIBELF_INC     ?= $(LIBELFDIR)/include
531 LIBELF_LIB     ?= $(LIBELFDIR)/lib
532 endif
533
534 ifdef USES_PAPI
535 PAPI_ROOT      ?= /p/paradyn/packages/papi-3.0.0-test
536 endif 
537
538 ifdef USES_FLEX
539 FLEX_DIR       ?= /s/flex/lib
540 endif
541
542 NASM           ?= /p/paradyn/packages/nasm/bin/nasm
543
544 #Build other variables based off of the above defaults
545
546 ifdef USES_TCLTK
547 # use the first set if using tcl8.4,
548 # use the second set if still using tcl8.3
549 ifndef USE_TCL83
550
551 TCLTK_LIBVER_ID = 8.4
552 CFLAGS      += -DTCLCONST=const
553 CXXFLAGS    += -DTCLCONST=const
554 KFLAGS      += -DTCLCONST=const
555 TFLAGS      += -DTCLCONST=const
556
557 else
558
559 TCLTK_LIBVER_ID = 8.3
560 CFLAGS      += -DTCLCONST=""
561 CXXFLAGS    += -DTCLCONST=""
562 KFLAGS      += -DTCLCONST=""
563 TFLAGS      += -DTCLCONST=""
564
565 endif
566
567 TCL_LIB         = -ltcl$(TCLTK_LIBVER_ID)
568 TK_LIB          = -ltk$(TCLTK_LIBVER_ID)
569
570 ifdef LIBTCLTKSTATIC
571 TCLTK_LIBS      += -Wl,-Bstatic $(TCL_LIB) $(TK_LIB) -Wl,-Bdynamic
572 else
573 TCLTK_LIBS      += $(TCL_LIB) $(TK_LIB)
574 endif
575
576 # TCL2C is used to generate compilable sources from tcl files
577 TCL2C           = $(TO_CORE)/../scripts/tcl2c
578 TCL2C_GEN_SRCS  = tcl2c.C
579
580 IFLAGS          += -I$(TCLTK_INC_DIR)
581 ifdef CROSSCOMPILER
582 LIBDIR          += $(patsubst %,-L%/rs_aix41/lib,$(TCLTK_DIR))
583 else
584 LIBDIR      += $(patsubst %,-L%,$(TCLTK_LIB_DIR))
585 endif
586
587 endif # USES_TCLTK
588
589 ifdef USES_PAPI
590 PAPI_INCDIR     = $(PAPI_ROOT)
591 PAPI_LIBDIR     = $(PAPI_ROOT)
592 #PAPI_LIB       = -Wl,-static -lpapi -Wl,-Bdynamic
593 #PAPI_LIB       = $(PAPI_LIBDIR)/libpapi.a
594 PAPI_LIB        = -Wl,-rpath=$(PAPI_LIBDIR) -L$(PAPI_LIBDIR) -lpapi  
595 IFLAGS          += -I$(PAPI_INCDIR)
596 LIBDIR          += $(patsubst %,-L%,$(PAPI_LIBDIR))
597 CFLAGS          += -DPAPI 
598 CXXFLAGS        += -DPAPI
599 TFLAGS          += -DPAPI 
600 endif
601
602 ifdef USES_FLEX
603 FLEX_LIB        = -lfl
604 LIBDIR          += $(patsubst %,-L%,$(FLEX_DIR))
605 VPATH           += $(FLEX_DIR)
606 endif
607
608 ifdef CROSSCOMPILER
609 FLEX_DIR        = /s/flex/rs_aix41/lib
610 LIBDIR          += -L/p/sp2/gcc/lib 
611 endif
612
613 ifdef USES_LIBERTY
614 # Since libiberty.a is in the same g++ directory as libstdc++.a and
615 # libg++.a, no need for a "-L$(LIBERTY_DIR)" entry -at
616 endif
617
618 ifdef USES_X11
619 X11_LIB         = -lX11
620
621 ifeq (solaris,$(findstring solaris,$(PLATFORM)))
622 X11DIR          = /usr/openwin
623 CFLAGS          += -I$(X11DIR)/include
624 CXXFLAGS        += -I$(X11DIR)/include
625 TFLAGS          += -I$(X11DIR)/include
626 LIBDIR          += -R$(X11DIR)/lib -L$(X11DIR)/lib
627 endif
628
629 ifeq (linux,$(findstring linux,$(PLATFORM)))
630 X11DIR          = /usr/X11R6
631 CFLAGS          += -I$(X11DIR)/include/X11
632 CXXFLAGS        += -I$(X11DIR)/include/X11
633 TFLAGS          += -I$(X11DIR)/include/X11
634 LIBDIR          += -L$(X11DIR)/lib
635 endif
636
637 ifeq (aix,$(findstring aix,$(PLATFORM)))
638 X11DIR          = /usr
639 endif
640
641 endif # USES_X11
642