GNU cflow analyzes a collection of C source files and
prints a graph, charting control flow within the program.
It is able to produce both direct and inverted flowgraphs for C sources.
Optionally a cross-reference listing can be generated.
Two output formats are implemented: POSIX and GNU (extended).

For more information see the project home page:

        http://www.gnu.org/software/cflow

License:        GPL-2.0-or-later

I would like to provide a Cygwin package for GNU cflow, as I noticed it
is defined in POSIX 2024 but not available under Cygwin.

It is packaged by major Linux and BSD distros:

        https://repology.org/project/cflow/versions

Attached cygport and at:

https://cygwin.com/cgit/cygwin-packages/playground/tree/cflow.cygport?h=playground

package job:

https://cygwin.com/cgi-bin2/jobs.cgi?id=8884&srcpkg=playground&user=Brian+Inglis

log at:

https://github.com/cygwin/scallywag/actions/runs/10758575465/job/29834173442

The package builds and passes all tests successfully both locally and
under scallywag GitHub CI.
For changes see below:


2021-12-30      1.7

- Multiple start functions are allowed

  The '--main' option can be given multiple times. A separate graph
  will be drawn for each function given as its argument.

- New option --target=FUNCTION

  If this option is given, the produced graph will contain only paths
  leading from start function (or functions) to the given FUNCTION.

  Multiple '--target' options are allowed.

- New output format: dot

  The '-f dot' (or '--format=dot') option instructs cflow to output
  graph as a description in DOT language, suitable as input to graphviz
  programs.

- cflow-mode: new commands for navigating in the graph:

  c   go to the calling function
  n   go to the next function at the same nesting level
  p   go to the previous function at the same nesting level

- Bugfixes:

  ** CVE-2019-16165
  ** CVE-2019-16166
  ** Fix parsing of K&R style function declarations
  ** Improve parsing of typecasts
  ** Fix recursive call detection


2019-02-23      1.6

- New option --all (-A)

  Produce graphs for all global functions in the program.  Use this
  option if your program contains functions which are not directly
  reachable from main().

  The output consist of separate flow graphs for each global function
  defined in the program.  These graphs will be placed after the graph
  for main() (if it exists), and will be ordered lexicographically by
  the function name.

- New option --no-main

  This option has the same effect as '--all', except that the graph for
  main() function (if it exists) is treated same way as all the other
  graphs, i.e. it will not be placed at the top of output, but in its
  place as per the lexicographic ordering of function names.


2016-05-17      1.5

- Correctly handle functions returning struct/union (fixes bug #31792)
- Gracefully handle invalid inputs (fixes bug #44113)
- Debugging output goes to stderr
- Add a manpage
- Consistent use of exit codes
#|/usr/bin/cygport
# cflow.cygport - cflow Cygwin package build control script definitions
# converted by rpmspec2cygport.sh 1.3 2024-08-15 02:04:42+0000

NAME=cflow
VERSION=1.7
RELEASE=1

CATEGORY="Devel Text"
SUMMARY="Analyzes C files charting control flow within the program"
DESCRIPTION="GNU cflow analyzes a collection of C source files and
prints a graph, charting control flow within the program.
It is able to produce both direct and inverted flowgraphs for C sources.
Optionally a cross-reference listing can be generated.
Two output formats are implemented: POSIX and GNU (extended)."

HOMEPAGE=http://www.gnu.org/software/$NAME
SRC_URI=mirror://gnu/$NAME/$NAME-$VERSION.tar.xz
SRC_URI+=" $SRC_URI.sig"
DEBIAN=https://sources.debian.org/data/main/${NAME:0:1}/$NAME/$VERSION-$RELEASE/debian/patches
FEDORA=https://src.fedoraproject.org/rpms/$NAME/raw/master/f
OPENSUSE=https://raw.githubusercontent.com/bmwiedemann/openSUSE/master/packages/${NAME:0:1}/$NAME
PATCH_URI=

BUILD_REQUIRES="gettext-devel libiconv-devel libintl-devel
autoconf automake emacs flex gcc-core grep make pkg-config sed"

LICENSE="GPL-2.0-or-later"
# SPDX-License-Identifier: GPL-2.0-or-later
LICENSE_SPDX="SPDX-License-Identifier: $LICENSE"
LICENSE_URI="COPYING"

DOCS="AUTHORS ChangeLog NEWS README THANKS TODO $LICENCE_URI"

# %make_install
# %find_lang %{name}
# rm -f %{buildroot}/%{_infodir}/dir
# %files -f %{name}.lang
# %{_datadir}/emacs/site-lisp/cflow-mode.el

CYGWIN_MAINTAINER=Brian%20Inglis
CYGWIN_MAINTAINER_EMAIL=brian.ing...@systematicsw.ab.ca

UPSTREAM_MAINTAINER=Upstream%20Maintainer
UPSTREAM_MAINTAINER_EMAIL=upma...@gnu.org
UPSTREAM_EMAIL=$n...@gnu.org

SUBJECT=${OSTYPE^}%20Package%20$NAME%20$VERSION
MAILTO=mailto:$UPSTREAM_MAINTAINER%20%3C$UPSTREAM_MAINTAINER_EMAIL%3E\
,$UPSTREAM_MAINTAINER%20%3C$UPSTREAM_EMAIL%3E\
?from=$CYGWIN_MAINTAINER%20%3C$CYGWIN_MAINTAINER_EMAIL%3E\
\&subject=$SUBJECT\&body=$SUBJECT

Reply via email to