# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           legacysupport 1.1

# _openat
legacysupport.newest_darwin_requires_legacy 13

name                cflow
version             1.8
revision            0
checksums           rmd160  6ba5ad7421d1ee8ca9d733f5ee1580d9241d9c09 \
                    sha256  a5830a708a587ebbf3b475b585935f89c33fc8fbd057af7d817d517aceaa7afa \
                    size    743608

categories          devel
license             GPL-3+
maintainers         nomaintainer

description         A program for generating call graphs from C code.

long_description    The cflow program is a tool which generates a call graph \
                    from C source files. It is most often used with a program \
                    like dot (from the graphviz package) in order to present \
                    visual graphs of the paths along which a piece of software \
                    may run.

homepage            https://www.gnu.org/software/cflow/
master_sites        gnu:cflow
use_xz              yes

# See: https://lists.macports.org/pipermail/macports-dev/2021-December/044042.html
depends_build-append \
                    port:gettext
depends_lib-append  port:gettext-runtime \
                    port:libiconv

patch.pre_args-replace \
                    -p0 -p1
patchfiles          implicit-int.patch

# Use GCC-style attribute syntax for Clang >= 1500 compatibility
# See: https://trac.macports.org/wiki/XcodeVersionInfo
if {${os.platform} eq "darwin" && ${os.major} >= 22} {
    patchfiles-append   clang-1500-compatibility.patch
}

# Add function declarations to the whitelist
# See: https://trac.macports.org/wiki/WimplicitFunctionDeclaration#strchr
configure.checks.implicit_function_declaration.whitelist-append strchr
# No MIN available in limits.h
configure.checks.implicit_function_declaration.whitelist-append MIN
# stdalign.h correctly detected as required
configure.checks.implicit_function_declaration.whitelist-append alignof
# unreachable is part of the C23 standard
configure.checks.implicit_function_declaration.whitelist-append unreachable
