do not edit — generated by btf.
git.druid.rocksindexdruid520portsports/init/perp/add.sh

ports/init/perp/add.sh


set -e
 
curl -LO http://b0llix.net/perp/distfiles/perp-2.07.tar.gz
tar xf perp-2.07.tar.gz
cd perp-2.07
# conf.mk has no prefix var, just plain BINDIR/SBINDIR/MANDIR - point them
# at $MP_PREFIX and use our own cc rather than hardcoded gcc. 2013-era code
# declares some function-pointer members with old K&R empty-paren
# prototypes (e.g. "ssize_t (*op)();"), relying on the traditional C
# meaning of () as "unspecified arguments" -- gcc defaulting to c23 (this
# is gnu17.0.0) makes () mean "takes no arguments" like c++ instead,
# breaking every later call through them ("too many arguments to function
# 'op'") and every assignment of a real function to them ("incompatible
# pointer type"). same root cause gnu-m4/add.sh already hit and fixes the
# same way: force an explicit older standard.
#
# conf.mk's own CFLAGS assignment (a plain "=") overrides whatever make
# would otherwise inherit from the environment, so mpx's own -I<prefix>/
# include injection (needed to find the sysroot's own libc headers at
# all, given the active cc's built-in default search path doesn't reach
# it) never took effect without also appending $CFLAGS's actual value
# here, baked into the file.
sed -i \
	-e "s|^CC = gcc|CC = ${CC:-cc}|" \
	-e "s|^CFLAGS = \(.*\)|CFLAGS = -std=gnu17 \1 $CFLAGS|" \
	-e "s|^BINDIR = /usr/bin|BINDIR = $MP_PREFIX/bin|" \
	-e "s|^SBINDIR = /usr/sbin|SBINDIR = $MP_PREFIX/sbin|" \
	-e "s|^MANDIR  = /usr/share/man|MANDIR = $MP_PREFIX/share/man|" \
	conf.mk
make
make install
cd ..
rm -rf perp-2.07 perp-2.07.tar.gz
powered by btf.