>> You need to use ${PREFIX} instead of /usr/local
>
> Indeed, thank you. The matter of fact is the code for the
> other unix platforms use either procfs or sysctl for getting
> the full path, I thought it should do the same for OpenBSD.
> What would be best to do?
>
> For other bsd's there's a sysctl for getting the full path
> but I'm not sure if such a thing exists for openbsd.
> I looked at sysctl(3) and tried to get it with dlattr. Another
> way would be traversing the users path to find it.
>
This is a port which going to be a package, so you read the OpenBSD
porting FAQ which explains why OpenBSD uses ${PREFIX} and ${LOCALBASE}
and ${WRKDIR} etc...
man bsd.port.mk if you have /usr/ports installed
Hope you get the idea.