forked from petersenna/codeviz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codeviz.p
613 lines (605 loc) · 21.5 KB
/
codeviz.p
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
Makefile | 2
README | 8 -
compilers/gcc-patches/gcc-3.4.1-cdepn.diff | 185 -----------------------------
compilers/gcc-patches/gcc-3.4.6-cdepn.diff | 184 ++++++++++++++++++++++++++++
compilers/install_gcc-3.4.1.sh | 79 ------------
compilers/install_gcc-3.4.6.sh | 79 ++++++++++++
configure | 6
7 files changed, 271 insertions(+), 272 deletions(-)
diff -urN codeviz-1.0.9-3.4.1/Makefile codeviz-1.0.9-3.4.6/Makefile
--- codeviz-1.0.9-3.4.1/Makefile 2005-09-20 12:24:02.000000000 +0300
+++ codeviz-1.0.9-3.4.6/Makefile 2006-06-22 22:20:32.000000000 +0300
@@ -1,6 +1,6 @@
TOPLEVEL = /home/mel/Projects/codeviz-1.0.8
PREFIX = /usr/local
-GCCVERSION = 3.4.1
+GCCVERSION = 3.4.6
PERLLIB = /usr/local/lib/perl/5.8.4
GCCGRAPH = /usr/local/gccgraph
diff -urN codeviz-1.0.9-3.4.1/README codeviz-1.0.9-3.4.6/README
--- codeviz-1.0.9-3.4.1/README 2004-08-11 01:02:29.000000000 +0300
+++ codeviz-1.0.9-3.4.6/README 2006-06-22 22:20:43.000000000 +0300
@@ -65,20 +65,20 @@
The patched version of gcc and g++ outputs .cdepn files for every c and c++
file compiled. This .cdepn file contains information such as when functions
are called, where they are declared and so on. Earlier versions of CodeViz
-supported multiple gcc versions but this one only support 3.4.1.
+supported multiple gcc versions but this one only support 3.4.6.
First, the source tar has to be downloaded. For those who have better things
to do than read the gcc install doc, just do the following
cd compilers
-ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.1/gcc-3.4.1.tar.gz
-./install_gcc-3.4.1.sh <optional install path>
+ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.gz
+./install_gcc-3.4.6.sh <optional install path>
This script will untar gcc, patch it and install it to the supplied path. If
no path is given, it'll be installed to $HOME/gcc-graph . I usually install
it to /usr/local/gcc-graph with
-./install_gcc-3.4.1.sh /usr/local/gcc-graph
+./install_gcc-3.4.6.sh /usr/local/gcc-graph
If you seriously want to patch by hand, just read the script as it goes through
each of the steps one at a time. There is one step to note though.
diff -urN codeviz-1.0.9-3.4.1/compilers/gcc-patches/gcc-3.4.1-cdepn.diff codeviz-1.0.9-3.4.6/compilers/gcc-patches/gcc-3.4.1-cdepn.diff
--- codeviz-1.0.9-3.4.1/compilers/gcc-patches/gcc-3.4.1-cdepn.diff 2004-08-19 23:09:00.000000000 +0300
+++ codeviz-1.0.9-3.4.6/compilers/gcc-patches/gcc-3.4.1-cdepn.diff 1970-01-01 02:00:00.000000000 +0200
@@ -1,185 +0,0 @@
-diff -ru gcc-3.4.1-clean/gcc/cgraph.c gcc-3.4.1-cdepn/gcc/cgraph.c
---- gcc-3.4.1-clean/gcc/cgraph.c 2004-06-01 00:43:51.000000000 +0100
-+++ gcc-3.4.1-cdepn/gcc/cgraph.c 2004-08-19 19:28:42.000000000 +0100
-@@ -68,7 +68,8 @@
- static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
-
- static struct cgraph_edge *create_edge (struct cgraph_node *,
-- struct cgraph_node *);
-+ struct cgraph_node *,
-+ location_t call_location);
- static hashval_t hash_node (const void *);
- static int eq_node (const void *, const void *);
-
-@@ -152,7 +153,7 @@
- /* Create edge from CALLER to CALLEE in the cgraph. */
-
- static struct cgraph_edge *
--create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
-+create_edge (struct cgraph_node *caller, struct cgraph_node *callee, location_t call_location)
- {
- struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
- struct cgraph_edge *edge2;
-@@ -180,6 +181,7 @@
-
- edge->caller = caller;
- edge->callee = callee;
-+ edge->call_location = call_location;
- edge->next_caller = callee->callers;
- edge->next_callee = caller->callees;
- caller->callees = edge;
-@@ -295,7 +297,7 @@
- struct cgraph_edge *
- cgraph_record_call (tree caller, tree callee)
- {
-- return create_edge (cgraph_node (caller), cgraph_node (callee));
-+ return create_edge (cgraph_node (caller), cgraph_node (callee), input_location);
- }
-
- void
-Only in gcc-3.4.1-cdepn/gcc: cgraph.c.cdepn
-diff -ru gcc-3.4.1-clean/gcc/cgraph.h gcc-3.4.1-cdepn/gcc/cgraph.h
---- gcc-3.4.1-clean/gcc/cgraph.h 2004-01-23 23:35:54.000000000 +0000
-+++ gcc-3.4.1-cdepn/gcc/cgraph.h 2004-08-19 19:28:42.000000000 +0100
-@@ -126,6 +126,9 @@
- /* When NULL, inline this call. When non-NULL, points to the explanation
- why function was not inlined. */
- const char *inline_failed;
-+
-+ /* CodeViz: Location the call occurred at */
-+ location_t call_location;
- };
-
- /* The cgraph_varpool data structure.
-diff -ru gcc-3.4.1-clean/gcc/cgraphunit.c gcc-3.4.1-cdepn/gcc/cgraphunit.c
---- gcc-3.4.1-clean/gcc/cgraphunit.c 2004-05-06 00:24:28.000000000 +0100
-+++ gcc-3.4.1-cdepn/gcc/cgraphunit.c 2004-08-19 19:28:43.000000000 +0100
-@@ -320,7 +320,10 @@
- cgraph_analyze_function (struct cgraph_node *node)
- {
- tree decl = node->decl;
-+ tree thisTree, calleeTree;
-+ FILE *fnref_f;
- struct cgraph_edge *e;
-+ struct cgraph_edge *calleeEdge;
-
- current_function_decl = decl;
-
-@@ -358,6 +361,33 @@
- node->analyzed = true;
- current_function_decl = NULL;
-
-+ /* CodeViz: Output information on this node */
-+ thisTree = node->decl;
-+ if ((fnref_f = cdepn_open(NULL)))
-+ {
-+ fprintf(fnref_f,"F {%s} {%s:%d}\n",
-+ lang_hooks.decl_printable_name (thisTree, 2),
-+ DECL_SOURCE_FILE (thisTree), DECL_SOURCE_LINE (thisTree));
-+
-+ }
-+
-+ /* CodeViz: Output information on all functions this node calls */
-+ for (calleeEdge = node->callees; calleeEdge; calleeEdge = calleeEdge->next_callee)
-+ {
-+ calleeTree = calleeEdge->callee->decl;
-+ if (thisTree != NULL &&
-+ calleeTree != NULL &&
-+ (fnref_f = cdepn_open(NULL)) != NULL)
-+ {
-+ fprintf(fnref_f, "C {%s} {%s:%d} {%s}\n",
-+ lang_hooks.decl_printable_name (thisTree, 2),
-+ calleeEdge->call_location.file, calleeEdge->call_location.line,
-+ lang_hooks.decl_printable_name (calleeTree, 2));
-+ }
-+ else
-+ printf("CODEVIZ: Unexpected NULL encountered\n");
-+ }
-+
- /* Possibly warn about unused parameters. */
- if (warn_unused_parameter)
- do_warn_unused_parameter (decl);
-diff -ru gcc-3.4.1-clean/gcc/toplev.c gcc-3.4.1-cdepn/gcc/toplev.c
---- gcc-3.4.1-clean/gcc/toplev.c 2004-02-20 08:40:49.000000000 +0000
-+++ gcc-3.4.1-cdepn/gcc/toplev.c 2004-08-19 20:59:21.000000000 +0100
-@@ -4665,6 +4665,52 @@
- timevar_print (stderr);
- }
-
-+/*
-+ * codeviz: Open the cdepn file. This is called with a filename by main()
-+ * and with just NULL for every other instance to return just the handle
-+ */
-+FILE *g_fnref_f = NULL;
-+char cdepnfile[256] = "--wonthappen--";
-+
-+FILE *cdepn_open(char *filename) {
-+ struct stat cdepnstat;
-+ int errval;
-+ time_t currtime;
-+ if (filename && g_fnref_f == NULL) {
-+ strcpy(cdepnfile, filename);
-+ strcat(cdepnfile, ".cdepn");
-+
-+ /*
-+ * Decide whether to open write or append. There appears to be a weird
-+ * bug that decides to open the file twice, overwriting all the cdepn
-+ * information put there before
-+ */
-+ errval = stat(cdepnfile, &cdepnstat);
-+ currtime = time(NULL);
-+ if (errval == -1 || currtime - cdepnstat.st_mtime > 5) {
-+ g_fnref_f = fopen(cdepnfile, "w");
-+ fprintf(stderr, "opened dep file %s\n",cdepnfile);
-+ } else {
-+ g_fnref_f = fopen(cdepnfile, "a");
-+ fprintf(stderr, "append dep file %s\n",cdepnfile);
-+ }
-+
-+ fflush(stderr);
-+ }
-+
-+ return g_fnref_f;
-+}
-+
-+void cdepn_close(void) {
-+ if (g_fnref_f) fclose(g_fnref_f);
-+ g_fnref_f = NULL;
-+}
-+
-+int cdepn_checkprint(void *fncheck) {
-+ return 1;
-+ /*return (void *)fncheck == (void *)decl_name; */
-+}
-+
- /* Entry point of cc1, cc1plus, jc1, f771, etc.
- Exit code is FATAL_EXIT_CODE if can't open files or if there were
- any errors, or SUCCESS_EXIT_CODE if compilation succeeded.
-@@ -4686,8 +4732,11 @@
- randomize ();
-
- /* Exit early if we can (e.g. -help). */
-- if (!exit_after_options)
-+ if (!exit_after_options) {
-+ cdepn_open(main_input_filename);
- do_compile ();
-+ cdepn_close();
-+ }
-
- if (errorcount || sorrycount)
- return (FATAL_EXIT_CODE);
-diff -ru gcc-3.4.1-clean/gcc/tree.h gcc-3.4.1-cdepn/gcc/tree.h
---- gcc-3.4.1-clean/gcc/tree.h 2004-02-08 01:52:43.000000000 +0000
-+++ gcc-3.4.1-cdepn/gcc/tree.h 2004-08-19 19:28:43.000000000 +0100
-@@ -3112,4 +3112,11 @@
- extern int tree_node_counts[];
- extern int tree_node_sizes[];
-
-+/*
-+ * CodeViz functions to get the output file handle for cdepn files
-+ */
-+FILE *cdepn_open(char *filename);
-+void cdepn_close(void);
-+int cdepn_checkprint(void *fncheck);
-+
- #endif /* GCC_TREE_H */
diff -urN codeviz-1.0.9-3.4.1/compilers/gcc-patches/gcc-3.4.6-cdepn.diff codeviz-1.0.9-3.4.6/compilers/gcc-patches/gcc-3.4.6-cdepn.diff
--- codeviz-1.0.9-3.4.1/compilers/gcc-patches/gcc-3.4.6-cdepn.diff 1970-01-01 02:00:00.000000000 +0200
+++ codeviz-1.0.9-3.4.6/compilers/gcc-patches/gcc-3.4.6-cdepn.diff 2006-06-22 22:22:40.000000000 +0300
@@ -0,0 +1,184 @@
+diff -ur gcc-3.4.6-clean/gcc/cgraph.c gcc-3.4.6-cdepn/gcc/cgraph.c
+--- gcc-3.4.6-clean/gcc/cgraph.c 2004-06-01 02:43:51.000000000 +0300
++++ gcc-3.4.6-cdepn/gcc/cgraph.c 2006-06-21 20:34:04.000000000 +0300
+@@ -68,7 +68,8 @@
+ static GTY(()) struct cgraph_varpool_node *cgraph_varpool_nodes;
+
+ static struct cgraph_edge *create_edge (struct cgraph_node *,
+- struct cgraph_node *);
++ struct cgraph_node *,
++ location_t call_location);
+ static hashval_t hash_node (const void *);
+ static int eq_node (const void *, const void *);
+
+@@ -152,7 +153,7 @@
+ /* Create edge from CALLER to CALLEE in the cgraph. */
+
+ static struct cgraph_edge *
+-create_edge (struct cgraph_node *caller, struct cgraph_node *callee)
++create_edge (struct cgraph_node *caller, struct cgraph_node *callee, location_t call_location)
+ {
+ struct cgraph_edge *edge = ggc_alloc (sizeof (struct cgraph_edge));
+ struct cgraph_edge *edge2;
+@@ -180,6 +181,7 @@
+
+ edge->caller = caller;
+ edge->callee = callee;
++ edge->call_location = call_location;
+ edge->next_caller = callee->callers;
+ edge->next_callee = caller->callees;
+ caller->callees = edge;
+@@ -295,7 +297,7 @@
+ struct cgraph_edge *
+ cgraph_record_call (tree caller, tree callee)
+ {
+- return create_edge (cgraph_node (caller), cgraph_node (callee));
++ return create_edge (cgraph_node (caller), cgraph_node (callee), input_location);
+ }
+
+ void
+diff -ur gcc-3.4.6-clean/gcc/cgraph.h gcc-3.4.6-cdepn/gcc/cgraph.h
+--- gcc-3.4.6-clean/gcc/cgraph.h 2004-01-24 01:36:03.000000000 +0200
++++ gcc-3.4.6-cdepn/gcc/cgraph.h 2006-06-21 20:34:04.000000000 +0300
+@@ -126,6 +126,9 @@
+ /* When NULL, inline this call. When non-NULL, points to the explanation
+ why function was not inlined. */
+ const char *inline_failed;
++
++ /* CodeViz: Location the call occurred at */
++ location_t call_location;
+ };
+
+ /* The cgraph_varpool data structure.
+diff -ur gcc-3.4.6-clean/gcc/cgraphunit.c gcc-3.4.6-cdepn/gcc/cgraphunit.c
+--- gcc-3.4.6-clean/gcc/cgraphunit.c 2004-05-06 02:24:30.000000000 +0300
++++ gcc-3.4.6-cdepn/gcc/cgraphunit.c 2006-06-21 20:34:04.000000000 +0300
+@@ -320,7 +320,10 @@
+ cgraph_analyze_function (struct cgraph_node *node)
+ {
+ tree decl = node->decl;
++ tree thisTree, calleeTree;
++ FILE *fnref_f;
+ struct cgraph_edge *e;
++ struct cgraph_edge *calleeEdge;
+
+ current_function_decl = decl;
+
+@@ -358,6 +361,33 @@
+ node->analyzed = true;
+ current_function_decl = NULL;
+
++ /* CodeViz: Output information on this node */
++ thisTree = node->decl;
++ if ((fnref_f = cdepn_open(NULL)))
++ {
++ fprintf(fnref_f,"F {%s} {%s:%d}\n",
++ lang_hooks.decl_printable_name (thisTree, 2),
++ DECL_SOURCE_FILE (thisTree), DECL_SOURCE_LINE (thisTree));
++
++ }
++
++ /* CodeViz: Output information on all functions this node calls */
++ for (calleeEdge = node->callees; calleeEdge; calleeEdge = calleeEdge->next_callee)
++ {
++ calleeTree = calleeEdge->callee->decl;
++ if (thisTree != NULL &&
++ calleeTree != NULL &&
++ (fnref_f = cdepn_open(NULL)) != NULL)
++ {
++ fprintf(fnref_f, "C {%s} {%s:%d} {%s}\n",
++ lang_hooks.decl_printable_name (thisTree, 2),
++ calleeEdge->call_location.file, calleeEdge->call_location.line,
++ lang_hooks.decl_printable_name (calleeTree, 2));
++ }
++ else
++ printf("CODEVIZ: Unexpected NULL encountered\n");
++ }
++
+ /* Possibly warn about unused parameters. */
+ if (warn_unused_parameter)
+ do_warn_unused_parameter (decl);
+diff -ur gcc-3.4.6-clean/gcc/toplev.c gcc-3.4.6-cdepn/gcc/toplev.c
+--- gcc-3.4.6-clean/gcc/toplev.c 2005-11-09 09:51:51.000000000 +0200
++++ gcc-3.4.6-cdepn/gcc/toplev.c 2006-06-21 20:34:04.000000000 +0300
+@@ -4675,6 +4675,52 @@
+ timevar_print (stderr);
+ }
+
++/*
++ * codeviz: Open the cdepn file. This is called with a filename by main()
++ * and with just NULL for every other instance to return just the handle
++ */
++FILE *g_fnref_f = NULL;
++char cdepnfile[256] = "--wonthappen--";
++
++FILE *cdepn_open(char *filename) {
++ struct stat cdepnstat;
++ int errval;
++ time_t currtime;
++ if (filename && g_fnref_f == NULL) {
++ strcpy(cdepnfile, filename);
++ strcat(cdepnfile, ".cdepn");
++
++ /*
++ * Decide whether to open write or append. There appears to be a weird
++ * bug that decides to open the file twice, overwriting all the cdepn
++ * information put there before
++ */
++ errval = stat(cdepnfile, &cdepnstat);
++ currtime = time(NULL);
++ if (errval == -1 || currtime - cdepnstat.st_mtime > 5) {
++ g_fnref_f = fopen(cdepnfile, "w");
++ fprintf(stderr, "opened dep file %s\n",cdepnfile);
++ } else {
++ g_fnref_f = fopen(cdepnfile, "a");
++ fprintf(stderr, "append dep file %s\n",cdepnfile);
++ }
++
++ fflush(stderr);
++ }
++
++ return g_fnref_f;
++}
++
++void cdepn_close(void) {
++ if (g_fnref_f) fclose(g_fnref_f);
++ g_fnref_f = NULL;
++}
++
++int cdepn_checkprint(void *fncheck) {
++ return 1;
++ /*return (void *)fncheck == (void *)decl_name; */
++}
++
+ /* Entry point of cc1, cc1plus, jc1, f771, etc.
+ Exit code is FATAL_EXIT_CODE if can't open files or if there were
+ any errors, or SUCCESS_EXIT_CODE if compilation succeeded.
+@@ -4696,8 +4742,11 @@
+ randomize ();
+
+ /* Exit early if we can (e.g. -help). */
+- if (!exit_after_options)
++ if (!exit_after_options) {
++ cdepn_open(main_input_filename);
+ do_compile ();
++ cdepn_close();
++ }
+
+ if (errorcount || sorrycount)
+ return (FATAL_EXIT_CODE);
+diff -ur gcc-3.4.6-clean/gcc/tree.h gcc-3.4.6-cdepn/gcc/tree.h
+--- gcc-3.4.6-clean/gcc/tree.h 2005-01-16 18:01:28.000000000 +0200
++++ gcc-3.4.6-cdepn/gcc/tree.h 2006-06-21 20:34:04.000000000 +0300
+@@ -3115,4 +3115,11 @@
+ extern int tree_node_counts[];
+ extern int tree_node_sizes[];
+
++/*
++ * CodeViz functions to get the output file handle for cdepn files
++ */
++FILE *cdepn_open(char *filename);
++void cdepn_close(void);
++int cdepn_checkprint(void *fncheck);
++
+ #endif /* GCC_TREE_H */
diff -urN codeviz-1.0.9-3.4.1/compilers/install_gcc-3.4.1.sh codeviz-1.0.9-3.4.6/compilers/install_gcc-3.4.1.sh
--- codeviz-1.0.9-3.4.1/compilers/install_gcc-3.4.1.sh 2005-09-20 12:24:37.000000000 +0300
+++ codeviz-1.0.9-3.4.6/compilers/install_gcc-3.4.1.sh 1970-01-01 02:00:00.000000000 +0200
@@ -1,79 +0,0 @@
-#!/bin/bash
-
-INSTALL_PATH=$HOME/gcc-graph
-if [ "$1" != "" ]; then INSTALL_PATH=$1; fi
-if [ "$2" = "compile-only" ]; then export COMPILE_ONLY=yes; fi
-echo Installing gcc to $INSTALL_PATH
-
-NCFTP=`which ncftpget`
-EXIT=$?
-if [ "$EXIT" != "0" ]; then
- NCFTP=ftp
-fi
-
-if [ ! -e gcc-3.4.1.tar.gz ]; then
- echo gcc-3.4.1.tar.gz not found, downloading
- $NCFTP ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.1/gcc-3.4.1.tar.gz
- if [ ! -e gcc-3.4.1.tar.gz ]; then
- echo Failed to download gcc, download gcc-3.4.1.tar.gz from www.gnu.org
- exit
- fi
-fi
-
-# Untar gcc
-rm -rf gcc-graph/objdir 2> /dev/null
-mkdir -p gcc-graph/objdir
-echo Untarring gcc...
-tar -zxf gcc-3.4.1.tar.gz -C gcc-graph || exit
-
-# Apply patch
-cd gcc-graph/gcc-3.4.1
-patch -p1 < ../../gcc-patches/gcc-3.4.1-cdepn.diff
-cd ../objdir
-
-# Configure and compile
-../gcc-3.4.1/configure --prefix=$INSTALL_PATH --enable-shared --enable-languages=c,c++ || exit
-make bootstrap
-
-RETVAL=$?
-PLATFORM=i686-pc-linux-gnu
-if [ $RETVAL != 0 ]; then
- if [ ! -e $PLATFORM/libiberty/config.h ]; then
- echo Checking if this is CygWin
- echo Note: This is untested, if building with Cygwin works, please email [email protected] with
- echo a report
- export PLATFORM=i686-pc-cygwin
- if [ ! -e $PLATFORM/libiberty/config.h ]; then
- echo Do not know how to fix this compile error up, exiting...
- exit -1
- fi
- fi
- cd $PLATFORM/libiberty/
- cat config.h | sed -e 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
- cat config.h | sed -e 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' > config.h.tmp && mv config.h.tmp config.h
- cat config.h | sed -e 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' > config.h.tmp && mv config.h.tmp config.h
- cat config.h | sed -e 's/.*undef HAVE_SYS_STAT_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
- if [ "$PLATFORM" = "i686-pc-cygwin" ]; then
- echo "#undef HAVE_GETTIMEOFDAY" >> config.h
- fi
-
- TEST=`grep HAVE_SYS_STAT_H config.h`
- if [ "$TEST" = "" ]; then
- echo "#undef HAVE_SYS_STAT_H" >> config.h
- echo "#define HAVE_SYS_STAT_H 1" >> config.h
- fi
- cd ../../
- make
-
- RETVAL=$?
- if [ $RETVAL != 0 ]; then
- echo
- echo Compile saved after trying to fix up config.h, do not know what to do
- echo This is likely a CodeViz rather than a gcc problem
- exit -1
- fi
-fi
-
-if [ "$COMPILE_ONLY" != "yes" ]; then
- make install
-fi
diff -urN codeviz-1.0.9-3.4.1/compilers/install_gcc-3.4.6.sh codeviz-1.0.9-3.4.6/compilers/install_gcc-3.4.6.sh
--- codeviz-1.0.9-3.4.1/compilers/install_gcc-3.4.6.sh 1970-01-01 02:00:00.000000000 +0200
+++ codeviz-1.0.9-3.4.6/compilers/install_gcc-3.4.6.sh 2006-06-22 22:21:01.000000000 +0300
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+INSTALL_PATH=$HOME/gcc-graph
+if [ "$1" != "" ]; then INSTALL_PATH=$1; fi
+if [ "$2" = "compile-only" ]; then export COMPILE_ONLY=yes; fi
+echo Installing gcc to $INSTALL_PATH
+
+NCFTP=`which ncftpget`
+EXIT=$?
+if [ "$EXIT" != "0" ]; then
+ NCFTP=ftp
+fi
+
+if [ ! -e gcc-3.4.6.tar.gz ]; then
+ echo gcc-3.4.6.tar.gz not found, downloading
+ $NCFTP ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.gz
+ if [ ! -e gcc-3.4.6.tar.gz ]; then
+ echo Failed to download gcc, download gcc-3.4.6.tar.gz from www.gnu.org
+ exit
+ fi
+fi
+
+# Untar gcc
+rm -rf gcc-graph/objdir 2> /dev/null
+mkdir -p gcc-graph/objdir
+echo Untarring gcc...
+tar -zxf gcc-3.4.6.tar.gz -C gcc-graph || exit
+
+# Apply patch
+cd gcc-graph/gcc-3.4.6
+patch -p1 < ../../gcc-patches/gcc-3.4.6-cdepn.diff
+cd ../objdir
+
+# Configure and compile
+../gcc-3.4.6/configure --prefix=$INSTALL_PATH --enable-shared --enable-languages=c,c++ || exit
+make bootstrap
+
+RETVAL=$?
+PLATFORM=i686-pc-linux-gnu
+if [ $RETVAL != 0 ]; then
+ if [ ! -e $PLATFORM/libiberty/config.h ]; then
+ echo Checking if this is CygWin
+ echo Note: This is untested, if building with Cygwin works, please email [email protected] with
+ echo a report
+ export PLATFORM=i686-pc-cygwin
+ if [ ! -e $PLATFORM/libiberty/config.h ]; then
+ echo Do not know how to fix this compile error up, exiting...
+ exit -1
+ fi
+ fi
+ cd $PLATFORM/libiberty/
+ cat config.h | sed -e 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
+ cat config.h | sed -e 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' > config.h.tmp && mv config.h.tmp config.h
+ cat config.h | sed -e 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' > config.h.tmp && mv config.h.tmp config.h
+ cat config.h | sed -e 's/.*undef HAVE_SYS_STAT_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
+ if [ "$PLATFORM" = "i686-pc-cygwin" ]; then
+ echo "#undef HAVE_GETTIMEOFDAY" >> config.h
+ fi
+
+ TEST=`grep HAVE_SYS_STAT_H config.h`
+ if [ "$TEST" = "" ]; then
+ echo "#undef HAVE_SYS_STAT_H" >> config.h
+ echo "#define HAVE_SYS_STAT_H 1" >> config.h
+ fi
+ cd ../../
+ make
+
+ RETVAL=$?
+ if [ $RETVAL != 0 ]; then
+ echo
+ echo Compile saved after trying to fix up config.h, do not know what to do
+ echo This is likely a CodeViz rather than a gcc problem
+ exit -1
+ fi
+fi
+
+if [ "$COMPILE_ONLY" != "yes" ]; then
+ make install
+fi
diff -urN codeviz-1.0.9-3.4.1/configure codeviz-1.0.9-3.4.6/configure
--- codeviz-1.0.9-3.4.1/configure 2005-07-11 21:07:41.000000000 +0300
+++ codeviz-1.0.9-3.4.6/configure 2006-06-22 22:21:10.000000000 +0300
@@ -6,7 +6,7 @@
# the scripts. It is meant to behave similar to ordinary configure scripts
PREFIX=/usr/local
-GCCVERSION=3.4.1
+GCCVERSION=3.4.6
GCCGRAPH=-unset-
# Print program usage
@@ -17,8 +17,8 @@
echo " -h, --help display this help and exit"
echo " --prefix=PREFIX install architecture-independent files in PREFIX"
echo " [Default: /usr/local]"
- echo " --gcc=VERSION version of gcc to use: 3.4.1 only available"
- echo " [Default: 3.4.1]"
+ echo " --gcc=VERSION version of gcc to use: 3.4.6 only available"
+ echo " [Default: 3.4.6]"
echo " --gccgraph=PATH install patched gcc to this path"
echo " [Default: $HOME/gccgraph]"
echo " --perllib=PATH Where to install the perl libraries"