Open purplewall1206 opened 3 years ago
Centos8: modify the content of /usr/include/netdb.h file <rpc/netdb.h> => <tirpc/rpc/netdb.h>
I think is more correct to change the CFLAGS
variable to point to the right include instead of modify the system headers.
diff --git a/src/Makefile b/src/Makefile
index 2555014..dcf3226 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -58,6 +58,8 @@ SAMPLES=lmbench/Results/aix/rs6000 lmbench/Results/hpux/snake \
lmbench/Results/irix/indigo2 lmbench/Results/linux/pentium \
lmbench/Results/osf1/alpha lmbench/Results/solaris/ss20*
+CPPFLAGS:=$(CPPFLAGS) -I /usr/include/tirpc/
+
COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
INCS = bench.h lib_mem.h lib_tcp.h lib_udp.h stats.h timing.h
first replace
#include <rpc/xxx>
by#include <tirpc/rpc/xxx>
second and there are some problems in '/usr/include/tirpc/rpc' directory, cd into it , then
grep '#include <rpc' ./ -lr | xargs sed -i 's/#include <rpc\//#include <tirpc\/rpc\//g'
grep '#include <netconfig' ./ -lr | xargs sed -i 's/#include <netconfig.h>/#include \"..\/netconfig.h\"/g'
finally
make results LDFLAGS=-ltirpc
the problem will be fixed, tested successfully on manjaro 20