Fix netstat tool compilation on linux

This commit is contained in:
taras 2024-09-28 00:24:35 +02:00
parent 5b97230c85
commit 234ea262a5
2 changed files with 15 additions and 11 deletions

View File

@ -58,15 +58,6 @@ $ cd ../examples
$ make $ 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 ## Compile dpdk in virtual machine
- f-stack/dpdk/kernel/linux/igb_uio/igb_uio.c line 274: - f-stack/dpdk/kernel/linux/igb_uio/igb_uio.c line 274:

View File

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