Merge pull request #843 from tarasko/bugfix/fix_netstat_compilation_on_linux

Fix netstat tool compilation on linux. Support `mawk` of ubuntu.
This commit is contained in:
johnjiang 2024-10-14 19:57:12 +08:00 committed by GitHub
commit 30c7c4a391
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View File

@ -59,15 +59,6 @@ $ cd ../examples
$ make
```
## Compile tools in Ubuntu
- remove '\\' in statement printf at f-stack/tools/netstat/Makefile line 70, now it should be:
```
- printf("\#define\tN%s\t%s\n", toupper($$2), i++);
+ printf("#define\tN%s\t%s\n", toupper($$2), i++);
```
## Compile dpdk in virtual machine
- f-stack/dpdk/kernel/linux/igb_uio/igb_uio.c line 274:

View File

@ -49,6 +49,8 @@ endif
include ${TOPDIR}/tools/prog.mk
UNAME := $(shell uname)
nl_symbols.c: nlist_symbols
awk '\
BEGIN { \
@ -60,6 +62,17 @@ nl_symbols.c: nlist_symbols
END { print "\t{ .n_name = NULL },\n};" } \
' < $^ > $@
ifeq ($(UNAME), Linux)
nl_defs.h: nlist_symbols
awk '\
BEGIN { \
print "#include <nlist.h>"; \
print "extern struct nlist nl[];"; \
i = 0; \
} \
!/^\#/ { printf("#define\tN%s\t%s\n", toupper($$2), i++); }' \
< $^ > $@
else
nl_defs.h: nlist_symbols
awk '\
BEGIN { \
@ -69,4 +82,4 @@ nl_defs.h: nlist_symbols
} \
!/^\#/ { printf("\#define\tN%s\t%s\n", toupper($$2), i++); }' \
< $^ > $@
endif