Advertisement
AZO234

CodeViz 1.0.12 apply to GCC 8.3.0 patch

Mar 31st, 2019
587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 17.90 KB | None | 0 0
  1. diff -uprN codeviz-1.0.12/CHANGELOG codeviz-1.0.12_/CHANGELOG
  2. --- codeviz-1.0.12/CHANGELOG    2013-04-27 20:09:56.000000000 +0900
  3. +++ codeviz-1.0.12_/CHANGELOG   2019-03-31 16:24:53.304935828 +0900
  4. @@ -6,6 +6,7 @@ Version 1.0.12
  5.   o Delete vim swap files (Petr Cerny)
  6.   o Handle DESTDIR as an alternative installation root than / (Petr Cerny)
  7.   o gcc 4.6.2 (Rafael Aquini)
  8. + o gcc 8.3.0 and x86_64 (AZO)
  9.  
  10.  Version 1.0.11
  11.   o Update the cncc collection method to understand ncc 2.4 (Tim Auckland)
  12. diff -uprN codeviz-1.0.12/CREDITS codeviz-1.0.12_/CREDITS
  13. --- codeviz-1.0.12/CREDITS  2013-04-27 20:09:56.000000000 +0900
  14. +++ codeviz-1.0.12_/CREDITS 2019-03-31 13:16:46.058092266 +0900
  15. @@ -6,3 +6,4 @@ Joel Soete    <soete.joel@tiscali.be>
  16.  Eric Sandeen     <sandeen@sgi.com>
  17.  Konstantin Popov  <kost@sics.se>
  18.  Tim Auckland      <tima@broadcom.com>
  19. +AZO <typesylph@gmail.com>
  20. diff -uprN codeviz-1.0.12/Makefile.in codeviz-1.0.12_/Makefile.in
  21. --- codeviz-1.0.12/Makefile.in  2013-04-27 20:09:56.000000000 +0900
  22. +++ codeviz-1.0.12_/Makefile.in 2019-04-01 09:17:16.990397160 +0900
  23. @@ -8,6 +8,7 @@ export CDEPN_SUPPRESS
  24.  
  25.  all:
  26.     cd $(TOPLEVEL)/compilers; \
  27. +   chmod +x install_gcc-$(GCCVERSION).sh; \
  28.     ./install_gcc-$(GCCVERSION).sh $(GCCGRAPH) compile-only
  29.  
  30.  clean:
  31. diff -uprN codeviz-1.0.12/README codeviz-1.0.12_/README
  32. --- codeviz-1.0.12/README   2013-04-27 20:09:56.000000000 +0900
  33. +++ codeviz-1.0.12_/README  2019-03-31 13:21:04.144499585 +0900
  34. @@ -65,20 +65,20 @@ some scripts are available in the compil
  35.  The patched version of gcc and g++ outputs .cdepn files for every c and c++
  36.  file compiled. This .cdepn file contains information such as when functions
  37.  are called, where they are declared and so on. Earlier versions of CodeViz
  38. -supported multiple gcc versions but this one only support 4.6.2.
  39. +supported multiple gcc versions but this one only support 8.3.0.
  40.  
  41.  First, the source tar has to be downloaded.  For those who have better things
  42.  to do than read the gcc install doc, just do the following
  43.  
  44.  cd compilers
  45. -ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-4.6.2/gcc-4.6.2.tar.gz
  46. -./install_gcc-4.6.2.sh <optional install path>
  47. +ncftpget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
  48. +./install_gcc-8.3.0.sh <optional install path>
  49.  
  50.  This script will untar gcc, patch it and install it to the supplied path. If
  51.  no path is given, it'll be installed to $HOME/gcc-graph . I usually install
  52.  it to /usr/local/gcc-graph with
  53.  
  54. -./install_gcc-4.6.2.sh /usr/local/gcc-graph
  55. +./install_gcc-8.3.0.sh /usr/local/gcc-graph
  56.  
  57.  If you seriously want to patch by hand, just read the script as it goes through
  58.  each of the steps one at a time. There is one step to note though.
  59. diff -uprN codeviz-1.0.12/README-GCC-8.3.0 codeviz-1.0.12_/README-GCC-8.3.0
  60. --- codeviz-1.0.12/README-GCC-8.3.0 1970-01-01 09:00:00.000000000 +0900
  61. +++ codeviz-1.0.12_/README-GCC-8.3.0    2019-04-01 12:11:00.687903583 +0900
  62. @@ -0,0 +1,66 @@
  63. +GCC 8.3.0 notes
  64. +---------------
  65. +Apr 1, 2019 written by AZO
  66. +
  67. +* Environment
  68. +   - 64bit only
  69. +   - tested on Ubuntu 18.10 64bit(x86_64) and Cygwin 64bit(x86_64)
  70. +   - not tested on AArch64
  71. +   - multithread compile
  72. +   - fixed for Perl 5.26 ('syntax error' when use gengraph, but output PS file)
  73. +
  74. +* Ubuntu 18.10 64bit
  75. +   - first, install packages with follow command
  76. +       ```shell
  77. +       sudo apt install build-essential texinfo automake libtool git tar \
  78. +       wget perl libgmp-dev libmpfr-dev libmpc-dev graphviz
  79. +       ```
  80. +
  81. +* Cygwin 64bit
  82. +   - When setup, select follow packages
  83. +       - binutils
  84. +       - gcc
  85. +       - g++
  86. +       - make
  87. +       - texinfo
  88. +       - automake
  89. +       - libtool
  90. +       - git
  91. +       - tar
  92. +       - xz
  93. +       - wget
  94. +       - patch
  95. +       - perl
  96. +       - libgmp-devel
  97. +       - libmpfr-devel
  98. +       - libmcp-devel
  99. +       - graphviz
  100. +
  101. +* common
  102. +   - get source-files from GitHub
  103. +       ```shell
  104. +       git clone https://github.com/AZO234/codeviz.git
  105. +       ```
  106. +   - configure
  107. +       ```shell
  108. +       cd codeviz
  109. +       ./configure
  110. +       ```
  111. +   - make (don't set -j option)
  112. +       ```shell
  113. +       make
  114. +       ```
  115. +   - install
  116. +       - Ubuntu 18.10 64bit
  117. +           ```shell
  118. +           sudo make install
  119. +           ```
  120. +       - Cygwin 64bit
  121. +           ```shell
  122. +           make install
  123. +           ```
  124. +
  125. +* default install files
  126. +   /usr/local/bin : perl scripts (gengraph, genfull)
  127. +   /usr/local/gccgraph : gcc binary, includes, libraries
  128. +
  129. diff -uprN codeviz-1.0.12/compilers/gcc-patches/gcc-8.3.0-cdepn.diff codeviz-1.0.12_/compilers/gcc-patches/gcc-8.3.0-cdepn.diff
  130. --- codeviz-1.0.12/compilers/gcc-patches/gcc-8.3.0-cdepn.diff   1970-01-01 09:00:00.000000000 +0900
  131. +++ codeviz-1.0.12_/compilers/gcc-patches/gcc-8.3.0-cdepn.diff  2019-03-31 14:56:15.619267000 +0900
  132. @@ -0,0 +1,205 @@
  133. +diff -uprN gcc-8.3.0/gcc/cgraph.c gcc-8.3.0_/gcc/cgraph.c
  134. +--- gcc-8.3.0/gcc/cgraph.c 2018-05-28 22:44:18.000000000 +0900
  135. ++++ gcc-8.3.0_/gcc/cgraph.c    2019-03-31 13:06:46.192230294 +0900
  136. +@@ -828,7 +828,8 @@ cgraph_edge::set_call_stmt (gcall *new_s
  137. + cgraph_edge *
  138. + symbol_table::create_edge (cgraph_node *caller, cgraph_node *callee,
  139. +              gcall *call_stmt, profile_count count,
  140. +-             bool indir_unknown_callee)
  141. ++             bool indir_unknown_callee,
  142. ++             location_t call_location)
  143. + {
  144. +   cgraph_edge *edge;
  145. +
  146. +@@ -902,6 +903,8 @@ symbol_table::create_edge (cgraph_node *
  147. +   if (call_stmt && caller->call_site_hash)
  148. +     cgraph_add_edge_to_call_site_hash (edge);
  149. +
  150. ++  edge->call_location = call_location;
  151. ++
  152. +   return edge;
  153. + }
  154. +
  155. +@@ -912,7 +915,7 @@ cgraph_node::create_edge (cgraph_node *c
  156. +             gcall *call_stmt, profile_count count)
  157. + {
  158. +   cgraph_edge *edge = symtab->create_edge (this, callee, call_stmt, count,
  159. +-                     false);
  160. ++                     false, input_location);
  161. +
  162. +   initialize_inline_failed (edge);
  163. +
  164. +@@ -950,7 +953,7 @@ cgraph_node::create_indirect_edge (gcall
  165. +                  bool compute_indirect_info)
  166. + {
  167. +   cgraph_edge *edge = symtab->create_edge (this, NULL, call_stmt,
  168. +-                              count, true);
  169. ++                              count, true, input_location);
  170. +   tree target;
  171. +
  172. +   initialize_inline_failed (edge);
  173. +diff -uprN gcc-8.3.0/gcc/cgraph.h gcc-8.3.0_/gcc/cgraph.h
  174. +--- gcc-8.3.0/gcc/cgraph.h 2018-05-28 22:44:18.000000000 +0900
  175. ++++ gcc-8.3.0_/gcc/cgraph.h    2019-03-31 14:08:31.805662556 +0900
  176. +@@ -1772,6 +1772,9 @@ struct GTY((chain_next ("%h.next_caller"
  177. +
  178. +   /* Expected frequency of executions within the function.  */
  179. +   sreal sreal_frequency ();
  180. ++
  181. ++  /* CodeViz: Location the call occurred at */
  182. ++  location_t call_location;
  183. + private:
  184. +   /* Remove the edge from the list of the callers of the callee.  */
  185. +   void remove_caller (void);
  186. +@@ -2288,7 +2291,8 @@ private:
  187. +      edge).  */
  188. +   cgraph_edge *create_edge (cgraph_node *caller, cgraph_node *callee,
  189. +               gcall *call_stmt, profile_count count,
  190. +-              bool indir_unknown_callee);
  191. ++              bool indir_unknown_callee,
  192. ++              location_t call_location);
  193. +
  194. +   /* Put the edge onto the free list.  */
  195. +   void free_edge (cgraph_edge *e);
  196. +diff -uprN gcc-8.3.0/gcc/cgraphunit.c gcc-8.3.0_/gcc/cgraphunit.c
  197. +--- gcc-8.3.0/gcc/cgraphunit.c 2018-05-28 22:44:18.000000000 +0900
  198. ++++ gcc-8.3.0_/gcc/cgraphunit.c    2019-03-31 14:28:51.574844134 +0900
  199. +@@ -602,10 +602,16 @@ cgraph_node::add_new_function (tree fnde
  200. +     DECL_FUNCTION_PERSONALITY (fndecl) = lang_hooks.eh_personality ();
  201. + }
  202. +
  203. ++extern int cdepn_dump;
  204. + /* Analyze the function scheduled to be output.  */
  205. + void
  206. + cgraph_node::analyze (void)
  207. + {
  208. ++  tree thisTree, calleeTree;
  209. ++  FILE *fnref_f;
  210. ++  cgraph_edge *calleeEdge;
  211. ++  expanded_location xloc;
  212. ++
  213. +   if (native_rtl_p ())
  214. +     {
  215. +       analyzed = true;
  216. +@@ -691,6 +697,36 @@ cgraph_node::analyze (void)
  217. +   analyzed = true;
  218. +
  219. +   input_location = saved_loc;
  220. ++
  221. ++  if (cdepn_dump) {
  222. ++    /* CodeViz: Output information on this node */
  223. ++    thisTree = this->decl;
  224. ++    if ((fnref_f = cdepn_open(NULL)))
  225. ++      {
  226. ++        fprintf(fnref_f,"F {%s} {%s:%d}\n",
  227. ++      lang_hooks.decl_printable_name (thisTree, 2),
  228. ++      DECL_SOURCE_FILE (thisTree), DECL_SOURCE_LINE (thisTree));
  229. ++
  230. ++      }
  231. ++
  232. ++    /* CodeViz: Output information on all functions this node calls */
  233. ++    for (calleeEdge = this->callees; calleeEdge;
  234. ++   calleeEdge = calleeEdge->next_callee)  {
  235. ++      calleeTree = calleeEdge->callee->decl;
  236. ++      if (thisTree != NULL &&
  237. ++    calleeTree != NULL &&
  238. ++    (fnref_f = cdepn_open(NULL)) != NULL)
  239. ++  {
  240. ++    xloc = expand_location(calleeEdge->call_location);
  241. ++    fprintf(fnref_f, "C {%s} {%s:%d} {%s}\n",
  242. ++        lang_hooks.decl_printable_name (thisTree, 2),
  243. ++        xloc.file, xloc.line,
  244. ++        lang_hooks.decl_printable_name (calleeTree, 2));
  245. ++  }
  246. ++      else
  247. ++  printf("CODEVIZ: Unexpected NULL encountered\n");
  248. ++    }
  249. ++  }
  250. + }
  251. +
  252. + /* C++ frontend produce same body aliases all over the place, even before PCH
  253. +diff -uprN gcc-8.3.0/gcc/toplev.c gcc-8.3.0_/gcc/toplev.c
  254. +--- gcc-8.3.0/gcc/toplev.c 2018-02-14 01:18:37.000000000 +0900
  255. ++++ gcc-8.3.0_/gcc/toplev.c    2019-03-31 14:41:11.531510182 +0900
  256. +@@ -2144,6 +2144,53 @@ do_compile ()
  257. +     }
  258. + }
  259. +
  260. ++/*
  261. ++ * codeviz: Open the cdepn file. This is called with a filename by main()
  262. ++ * and with just NULL for every other instance to return just the handle
  263. ++ */
  264. ++FILE *g_fnref_f = NULL;
  265. ++char cdepnfile[256] = "--wonthappen--";
  266. ++int cdepn_dump = 0;
  267. ++
  268. ++FILE *cdepn_open(const char *filename) {
  269. ++  struct stat cdepnstat;
  270. ++  int errval;
  271. ++  time_t currtime;
  272. ++  if (filename && g_fnref_f == NULL) {
  273. ++    strcpy(cdepnfile, filename);
  274. ++    strcat(cdepnfile, ".cdepn");
  275. ++
  276. ++    /*
  277. ++     * Decide whether to open write or append. There appears to be a weird
  278. ++     * bug that decides to open the file twice, overwriting all the cdepn
  279. ++     * information put there before
  280. ++     */
  281. ++    errval = stat(cdepnfile, &cdepnstat);
  282. ++    currtime = time(NULL);
  283. ++    if (errval == -1 || currtime - cdepnstat.st_mtime > 5)  {
  284. ++      g_fnref_f = fopen(cdepnfile, "w");
  285. ++      fprintf(stderr, "opened dep file %s\n",cdepnfile);
  286. ++    } else {
  287. ++      g_fnref_f = fopen(cdepnfile, "a");
  288. ++      fprintf(stderr, "append dep file %s\n",cdepnfile);
  289. ++    }
  290. ++
  291. ++    fflush(stderr);
  292. ++  }
  293. ++
  294. ++  return g_fnref_f;
  295. ++}
  296. ++
  297. ++void cdepn_close(void) {
  298. ++  if (g_fnref_f) fclose(g_fnref_f);
  299. ++  g_fnref_f = NULL;
  300. ++}
  301. ++
  302. ++int cdepn_checkprint(void *fncheck) {
  303. ++  return 1;
  304. ++  /*return (void *)fncheck == (void *)decl_name; */
  305. ++}
  306. ++
  307. + toplev::toplev (timer *external_timer,
  308. +       bool init_signals)
  309. +   : m_use_TV_TOTAL (external_timer == NULL),
  310. +@@ -2264,7 +2311,12 @@ toplev::main (int argc, char **argv)
  311. +     {
  312. +       if (m_use_TV_TOTAL)
  313. +   start_timevars ();
  314. ++    cdepn_dump = ((getenv("CDEPN_SUPPRESS")) ? 0 : 1);
  315. ++      if (cdepn_dump)
  316. ++         cdepn_open(main_input_filename);
  317. +       do_compile ();
  318. ++      if (cdepn_dump)
  319. ++         cdepn_close();
  320. +     }
  321. +
  322. +   if (warningcount || errorcount || werrorcount)
  323. +diff -uprN gcc-8.3.0/gcc/tree.h gcc-8.3.0_/gcc/tree.h
  324. +--- gcc-8.3.0/gcc/tree.h   2019-01-03 07:34:36.000000000 +0900
  325. ++++ gcc-8.3.0_/gcc/tree.h  2019-03-31 14:56:06.315311513 +0900
  326. +@@ -5870,4 +5870,11 @@ type_has_mode_precision_p (const_tree t)
  327. +   return known_eq (TYPE_PRECISION (t), GET_MODE_PRECISION (TYPE_MODE (t)));
  328. + }
  329. +
  330. ++/*
  331. ++ * CodeViz functions to get the output file handle for cdepn files
  332. ++ */
  333. ++FILE *cdepn_open(const char *filename);
  334. ++void cdepn_close(void);
  335. ++int  cdepn_checkprint(void *fncheck);
  336. ++
  337. + #endif  /* GCC_TREE_H  */
  338. diff -uprN codeviz-1.0.12/compilers/install_gcc-4.6.2.sh codeviz-1.0.12_/compilers/install_gcc-4.6.2.sh
  339. --- codeviz-1.0.12/compilers/install_gcc-4.6.2.sh   2013-04-27 20:09:56.000000000 +0900
  340. +++ codeviz-1.0.12_/compilers/install_gcc-4.6.2.sh  2019-03-31 09:57:59.622269000 +0900
  341. @@ -28,6 +28,7 @@ tar -zxf gcc-4.6.2.tar.gz -C gcc-graph |
  342.  
  343.  # Apply patch
  344.  cd gcc-graph/gcc-4.6.2
  345. +patch -p1 < ../../gcc-patches/gcc-4.6.2-codeviz.diff
  346.  patch -p1 < ../../gcc-patches/gcc-4.6.2-cdepn.diff
  347.  cd ../objdir
  348.  
  349. diff -uprN codeviz-1.0.12/compilers/install_gcc-8.3.0.sh codeviz-1.0.12_/compilers/install_gcc-8.3.0.sh
  350. --- codeviz-1.0.12/compilers/install_gcc-8.3.0.sh   1970-01-01 09:00:00.000000000 +0900
  351. +++ codeviz-1.0.12_/compilers/install_gcc-8.3.0.sh  2019-04-01 10:04:07.761473951 +0900
  352. @@ -0,0 +1,87 @@
  353. +#!/bin/bash
  354. +
  355. +INSTALL_PATH=$HOME/gcc-graph
  356. +if [ "$1" != "" ]; then INSTALL_PATH=$1; fi
  357. +if [ "$2" = "compile-only" ]; then export COMPILE_ONLY=yes; fi
  358. +echo Installing gcc to $INSTALL_PATH
  359. +
  360. +JOBS=`which nproc`
  361. +EXIT=$?
  362. +if [ "$EXIT" != "0" ]; then
  363. +  JOBS=1
  364. +else
  365. +  JOBS=`nproc`
  366. +fi
  367. +
  368. +if [ ! -e gcc-8.3.0.tar.xz ]; then
  369. +  echo gcc-8.3.0.tar.xz not found, downloading
  370. +  wget ftp://ftp.gnu.org/pub/gnu/gcc/gcc-8.3.0/gcc-8.3.0.tar.xz
  371. +  if [ ! -e gcc-8.3.0.tar.xz ]; then
  372. +    echo Failed to download gcc, download gcc-8.3.0.tar.xz from www.gnu.org
  373. +    exit
  374. +  fi
  375. +fi
  376. +
  377. +# Untar gcc
  378. +rm -rf gcc-graph/objdir 2> /dev/null
  379. +mkdir -p gcc-graph/objdir
  380. +echo Untarring gcc...
  381. +tar -Jxf gcc-8.3.0.tar.xz -C gcc-graph || exit
  382. +
  383. +# Apply patch
  384. +cd gcc-graph/gcc-8.3.0
  385. +patch -p1 < ../../gcc-patches/gcc-8.3.0-cdepn.diff
  386. +cd ../objdir
  387. +
  388. +# Configure and compile
  389. +../gcc-8.3.0/configure --prefix=$INSTALL_PATH --enable-shared --enable-languages=c,c++ || exit
  390. +make bootstrap -j$JOBS
  391. +
  392. +RETVAL=$?
  393. +PLATFORM=x86_64-pc-linux-gnu
  394. +if [ $RETVAL != 0 ]; then
  395. +  if [ ! -e $PLATFORM/libiberty/config.h ]; then
  396. +    echo Checking if this is AArch64
  397. +    echo Note: This is untested, if building with AArch64 works, please email mel@csn.ul.ie with
  398. +    echo a report
  399. +    PLATFORM=aarch64-linux-gnu
  400. +    if [ ! -e $PLATFORM/libiberty/config.h ]; then
  401. +      echo Checking if this is CygWin
  402. +      echo Note: This is untested, if building with Cygwin works, please email mel@csn.ul.ie with
  403. +      echo a report
  404. +      export PLATFORM=x86_64-unknown-cygwin
  405. +      if [ ! -e $PLATFORM/libiberty/config.h ]; then
  406. +        echo Do not know how to fix this compile error up, exiting...
  407. +        exit -1
  408. +      fi
  409. +    fi
  410. +  fi
  411. +  cd $PLATFORM/libiberty/
  412. +  cat config.h | sed -e 's/.*undef HAVE_LIMITS_H.*/\#define HAVE_LIMITS_H 1/' > config.h.tmp && mv config.h.tmp config.h
  413. +  cat config.h | sed -e 's/.*undef HAVE_STDLIB_H.*/\#define HAVE_STDLIB_H 1/' > config.h.tmp && mv config.h.tmp config.h
  414. +  cat config.h | sed -e 's/.*undef HAVE_UNISTD_H.*/\#define HAVE_UNISTD_H 1/' > config.h.tmp && mv config.h.tmp config.h
  415. +  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
  416. +  if [ "$PLATFORM" = "x86_64-unknown-cygwin" ]; then
  417. +    echo "#undef HAVE_GETTIMEOFDAY" >> config.h
  418. +  fi
  419. +
  420. +  TEST=`grep HAVE_SYS_STAT_H config.h`
  421. +  if [ "$TEST" = "" ]; then
  422. +    echo "#undef HAVE_SYS_STAT_H" >> config.h
  423. +    echo "#define HAVE_SYS_STAT_H 1" >> config.h
  424. +  fi
  425. +  cd ../../
  426. +  make -j$JOBS
  427. +
  428. +  RETVAL=$?
  429. +  if [ $RETVAL != 0 ]; then
  430. +    echo
  431. +    echo Compile saved after trying to fix up config.h, do not know what to do
  432. +    echo This is likely a CodeViz rather than a gcc problem
  433. +    exit -1
  434. +  fi
  435. +fi
  436. +
  437. +if [ "$COMPILE_ONLY" != "yes" ]; then
  438. +  make install
  439. +fi
  440. diff -uprN codeviz-1.0.12/configure codeviz-1.0.12_/configure
  441. --- codeviz-1.0.12/configure    2013-04-27 20:09:56.000000000 +0900
  442. +++ codeviz-1.0.12_/configure   2019-04-01 09:13:58.812060351 +0900
  443. @@ -6,7 +6,7 @@
  444.  # the scripts. It is meant to behave similar to ordinary configure scripts
  445.  
  446.  PREFIX=/usr/local
  447. -GCCVERSION=4.6.2
  448. +GCCVERSION=8.3.0
  449.  GCCGRAPH=-unset-
  450.  
  451.  # Print program usage
  452. @@ -17,8 +17,8 @@ usage() {
  453.    echo "  -h, --help       display this help and exit"
  454.    echo "  --prefix=PREFIX   install architecture-independent files in PREFIX"
  455.    echo "                    [Default: /usr/local]"
  456. -  echo "  --gcc=VERSION     version of gcc to use: 4.6.2 only available"
  457. -  echo "                    [Default: 4.6.2]"
  458. +  echo "  --gcc=VERSION     version of gcc to use: 8.3.0 only available"
  459. +  echo "                    [Default: 8.3.0]"
  460.    echo "  --gccgraph=PATH   install patched gcc to this path"
  461.    echo "                    [Default: $HOME/gccgraph]"
  462.    echo "  --perllib=PATH    Where to install the perl libraries"
  463. @@ -89,6 +89,8 @@ fi
  464.  checkprog dot graphviz
  465.  checkprog make make
  466.  checkprog gcc gcc
  467. +checkprog patch patch
  468. +checkprog wget wget
  469.  
  470.  # Check that dot can generate graphs
  471.  TEMP=`mktemp 2> /dev/null`
  472. diff -uprN codeviz-1.0.12/lib/CodeViz/CollectCXref.pm codeviz-1.0.12_/lib/CodeViz/CollectCXref.pm
  473. --- codeviz-1.0.12/lib/CodeViz/CollectCXref.pm  2013-04-27 20:09:56.000000000 +0900
  474. +++ codeviz-1.0.12_/lib/CodeViz/CollectCXref.pm 2019-03-31 20:38:28.765333000 +0900
  475. @@ -205,7 +205,7 @@ sub readcdepn {
  476.      while (!eof(CDEPFILE)) {
  477.        $line = <CDEPFILE>;
  478.        # Read a function declaration line
  479. -      if ($line =~ /^F {(.*)} {(.+):(.+)}/) {
  480. +      if ($line =~ /^F \{(.*)\} \{(.+):(.+)\}/) {
  481.          my $fdecl = $1;
  482.          $file = $f;
  483.          $file =~ s/\.cdepn//;
  484. @@ -220,7 +220,7 @@ sub readcdepn {
  485.        }
  486.  
  487.        # Read a function call line
  488. -      if ($line =~ /^C {(.*)} {(.+):(.+)}\s+(.+)/) {
  489. +      if ($line =~ /^C \{(.*)\} \{(.+):(.+)\}\s+(.+)/) {
  490.          $caller = parseDeclaration($1);
  491.     $callee = parseDeclaration($4);
  492.          $line   = $3;
  493. diff -uprN codeviz-1.0.12/lib/CodeViz/CollectCppDepn.pm codeviz-1.0.12_/lib/CodeViz/CollectCppDepn.pm
  494. --- codeviz-1.0.12/lib/CodeViz/CollectCppDepn.pm    2013-04-27 20:09:56.000000000 +0900
  495. +++ codeviz-1.0.12_/lib/CodeViz/CollectCppDepn.pm   2019-03-31 20:40:29.824715000 +0900
  496. @@ -136,14 +136,14 @@ sub analyse_cdepn {
  497.        # has been included from an external file and
  498.        # should be ignored, otherwise record it as a function
  499.        # declaration
  500. -      if (/^F {(.*)} {(.+):(.+)}/) {
  501. +      if (/^F \{(.*)\} \{(.+):(.+)\}/) {
  502.          my $loc="$2:$3";
  503.     $f1 = parseDeclaration($1);
  504.          
  505.     #if ($cpp) { $f1 =~ s/<.*>//g; }
  506.          $F{$f1} = "$2:$3";
  507.          $M{$f1}=3;
  508. -      } elsif (/^C {(.*)} {(.+):(.+)}\s+(.+)/) {
  509. +      } elsif (/^C \{(.*)\} \{(.+):(.+)\}\s+(.+)/) {
  510.          my $loc = "$2:$3";
  511.          # Lines beginning with C are calling a function
  512.          # The key is hashed as "caller:callee" and the
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement