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