Doing static builds of portmap might fail when the C library's perror()
function is pulled in and collides with portmap's definition. So add a
flag to control the local override.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Neil Brown <neilb@suse.de>
CPPFLAGS += -DNO_FORK
endif
+# For static builds, we might hit perror() symbol clashes
+ifneq ($(NO_PERROR),)
+CPPFLAGS += -DNO_PERROR
+endif
+
ifeq ($(PREFIX),)
PREFIX = /usr
endif
Some make variable can be used to control compilation.
NO_FORK= if non-empty, don't use fork (good for nommu systems)
+ NO_PERROR= if non-empty, don't override the perror() func
NO_PIE= if non-empty, don't build portmap as a PIE
NO_TCP_WRAPPER= if non-empty, don't use tcp_wrappers
USE_DNS= if set, tcp_wrappers can check peers based on hostname
abort();
}
+#ifndef NO_PERROR
/* need to override perror calls in rpc library */
void perror(const char *what)
{
syslog(LOG_ERR, "%s: %m", what);
}
+#endif
static struct pmaplist *
find_service(u_long prog, u_long vers, u_long prot)