rules_cc_autoconf it's quite useful for bazel porting, I'm trying to base my meson header generation function on rules_cc_autoconf (https://github.com/comicfans/rules_cc_autoconf/tree/meson).
currently checks.AC_ macro supports condition to get 'and' behavior , this makes condition construction complex even for simple bool logic, for example
if HAVE_SYS_XATTR_H or HAVE_ATTR_XATTR_H:
define HAVE_XATTR
then I have to write something like
checks.AC_CHECK_HEADER('sys/xattr.h', define = "HAVE_SYS_XATTR_H"),
checks.AC_CHECK_HEADER('attr/xattr.h', define = "HAVE_ATTR_XATTR_H"),
checks.AC_DEFINE("NO_SYS_XATTR_H", requires = ["!HAVE_SYS_XATTR_H"]),
checks.AC_DEFINE("NO_ATTR_XATTR_H", requires= ["!HAVE_ATTR_XATTR_H"]),
checks.AC_DEFINE("NO_BOTH", requires = ["NO_SYS_XATTR_H", "NO_ATTR_XATTR_H"]),
checks.AC_DEFINE("HAVE_XATTR", requires = ["!NOT_BOTH"])
it might also lead unexpected define.
I wonder if we can support arbitrary expression evaluation, for example a python helper , inject all checks as variable, then complex condition expression can be used ease the bazel port
rules_cc_autoconf it's quite useful for bazel porting, I'm trying to base my meson header generation function on rules_cc_autoconf (https://github.com/comicfans/rules_cc_autoconf/tree/meson).
currently checks.AC_ macro supports condition to get 'and' behavior , this makes condition construction complex even for simple bool logic, for example
then I have to write something like
it might also lead unexpected define.
I wonder if we can support arbitrary expression evaluation, for example a python helper , inject all checks as variable, then complex condition expression can be used ease the bazel port