| git.druid.rocks | index | druid520 | q | sc.conf |
sc.conf
# q build config -- read once by "sc", which probes everything below and
# generates config.h, mk.conf, makefile, and mk/{b,c,d,dc,dh,dm}.sh.
# only bin= and oss= are required; everything else defaults to unset.
bin="q" # the single q binary, built from every .c under src/.
src="src" # dir of the .c sources (q.c is q's own entry point, the
# rest are shared).
# out="out" # build output dir (default "out").
# docsdir="docs" # q ships no btft docs, so the dh/dm/d/dc targets are inert.
# supported oses (matched against "uname -s | tr A-Z a-z"). q is plain
# c89 + posix, so it should build on any of these.
oss="linux freebsd netbsd openbsd"
# hard_*: must pass or sc aborts. soft_*: checked the same way, but a
# failure just moves on (config.h still gets the macro, valued 0) -- so
# the strict gcc-specific warnings below degrade gracefully on clang/tcc
# instead of hard-failing the build.
hard_cflags="-std=c89 -pedantic-errors -Werror -Os"
soft_cflags="-Wall -Wextra -Wshadow -Wcast-qual -Wwrite-strings \
-Wpointer-arith -Wcast-align -Wundef -Wsign-conversion -Wconversion \
-Wformat=2 -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes \
-Wmissing-declarations"
# the posix headers q includes beyond the c89 standard set -- hard, since
# q is a posix package manager and cannot work without them. (stdio.h/
# stdlib.h/string.h/errno.h are c89 and are never probed: they cannot be
# absent from a c89 compiler.)
hard_headers="unistd.h sys/wait.h dirent.h sys/stat.h sys/types.h"
# the posix functions q calls beyond the c89 standard library -- hard for
# the same reason. (getenv/free/qsort/realloc and the stdio/string set
# are c89, and are never probed.)
hard_funcs="_exit access closedir execlp fork lstat mkdir opendir pclose \
popen readdir rmdir setenv unlink waitpid"
# no external libraries and no special link flags -- q links against libc
# alone, so libs/ldflags stay unset.