updated on Mon Jan 16 12:07:49 UTC 2012
[aur-mirror.git] / crafty / x86_64.patch
blob4026e55f1f02f76a5296e5453acc23335ee35ec6
1 diff --git a/Makefile b/Makefile
2 index eb06678..cde4c4e 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -38,6 +38,9 @@
6 # -DTRACE N This enables the "trace" command so that the search tree
7 # can be dumped while running.
9 +PROFILE_USE_FLAGS=-fprofile-use -fprofile-correction -Wno-coverage-mismatch -freorder-blocks-and-partition
10 +PROFILE_GEN_FLAGS=-fprofile-generate -fprofile-correction
12 default:
13 $(MAKE) linux-64
14 help:
15 @@ -156,20 +159,22 @@ debug:
17 linux-64:
18 $(MAKE) target=LINUX \
19 - CC=icc CXX=icc \
20 - CFLAGS='-w -xP -O2 -fno-alias -prof-use -prof_dir ./profdir' \
21 - CXFLAGS='-w -xP -O2 -prof-use -prof-dir ./profdir' \
22 - LDFLAGS='$(LDFLAGS) -lpthread -lstdc++' \
23 - opt='$(opt) -DINLINE64 -DCPUS=2' \
24 + CC=gcc CXX=g++ \
25 + CFLAGS='$(CFLAGS) $(PROFILE_USE_FLAGS)' \
26 + CXFLAGS='$(CXXFLAGS)' \
27 + LDFLAGS='$(LDFLAGS) $(PROFILE_USE_FLAGS) -Wl,--as-needed' \
28 + LIBS='-lpthread -lstdc++' \
29 + opt='$(opt) -DINLINE64 -DCPUS=8 -DBOOKDIR="\"/usr/share/crafty\""' \
30 crafty-make
32 linux-64-profile:
33 $(MAKE) target=LINUX \
34 - CC=icc CXX=icc \
35 - CFLAGS='-w -xP -O2 -fno-alias -prof-gen=srcpos -prof-dir ./profdir' \
36 - CXFLAGS='-w -xP -O2 -ip -prof-gen=srcpos -prof-dir ./profdir' \
37 - LDFLAGS='$(LDFLAGS) -lpthread -lstdc++ ' \
38 - opt='$(opt) -DINLINE64 -DCPUS=2' \
39 + CC=gcc CXX=g++ \
40 + CFLAGS='$(CFLAGS) $(PROFILE_GEN_FLAGS)' \
41 + CXFLAGS='$(CXXFLAGS)' \
42 + LDFLAGS='$(LDFLAGS) $(PROFILE_GEN_FLAGS) -Wl,--as-needed' \
43 + LIBS='-lpthread -lstdc++ -lgcov' \
44 + opt='$(opt) -DINLINE64 -DCPUS=8 -DBOOKDIR="\"..\""' \
45 crafty-make
47 linux-icc:
48 @@ -218,9 +223,7 @@ solaris-gcc:
49 crafty-make
51 profile:
52 - @rm -rf profdir
53 - @rm -rf position.bin
54 - @mkdir profdir
55 + @rm -rf *.gcda
56 @touch *.c *.cpp *.h
57 $(MAKE) linux-64-profile
58 @echo "#!/bin/csh" > runprof
59 @@ -289,7 +292,7 @@ profile:
60 @echo "quit" >>runprof
61 @echo "EOF" >>runprof
62 @chmod +x runprof
63 - @./runprof
64 + @bash ./runprof
65 @echo "#!/bin/csh" > runprof
66 @echo "./crafty <<EOF" >>runprof
67 @echo "st=10" >>runprof
68 @@ -301,7 +304,7 @@ profile:
69 @echo "quit" >>runprof
70 @echo "EOF" >>runprof
71 @chmod +x runprof
72 - @./runprof
73 + @bash ./runprof
74 @rm runprof
75 @touch *.c *.cpp *.h
76 $(MAKE) linux-64
77 diff --git a/option.c b/option.c
78 index 4aacdee..5ba49a2 100644
79 --- a/option.c
80 +++ b/option.c
81 @@ -1093,7 +1093,7 @@ int Option(TREE * RESTRICT tree) {
82 char *readstat = (char *) -1;
83 int lines = 0;
85 - helpfile = fopen("crafty.hlp", "r");
86 + helpfile = fopen(BOOKDIR"/crafty.hlp", "r");
87 if (!helpfile) {
88 printf("ERROR. Unable to open \"crafty.hlp\" -- help unavailable\n");
89 return (1);