0001-src-Fix-error-in-cross-compile.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. From 27910ea19260b7f7a3f9c0465addd1dea80cf3bd Mon Sep 17 00:00:00 2001
  2. From: Li Xin <lixin.fnst@cn.fujitsu.com>
  3. Date: Thu, 8 Oct 2015 15:11:17 +0900
  4. Subject: [PATCH] src: Fix error in cross-compile
  5. The errors are like this:
  6. tcptable.h:26:25: fatal error: linux/if_tr.h: No such file or directory
  7. ld: cannot find -ltextbox
  8. Upstream-Status: pending
  9. Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
  10. ---
  11. src/Makefile | 2 +-
  12. src/hostmon.c | 2 +-
  13. src/install.sh | 4 ++--
  14. src/othptab.c | 2 +-
  15. src/packet.c | 2 +-
  16. src/tcptable.h | 2 +-
  17. src/tr.c | 2 +-
  18. support/Makefile | 3 +--
  19. 8 files changed, 9 insertions(+), 10 deletions(-)
  20. diff --git a/src/Makefile b/src/Makefile
  21. index 2043c2d..0f77bea 100644
  22. --- a/src/Makefile
  23. +++ b/src/Makefile
  24. @@ -39,7 +39,7 @@ LDOPTS = #-static
  25. # you may want to change this to point to your ncurses include directory
  26. # if the ncurses include files are not in the default location.
  27. -INCLUDEDIR = -I/usr/include/ncurses -I../support
  28. +INCLUDEDIR = -I../support
  29. # You can uncomment this one to disable the backspace key in input fields.
  30. # This means you must use the Del key or Ctrl+H combination to erase the
  31. diff --git a/src/hostmon.c b/src/hostmon.c
  32. index 14df2c8..6571562 100644
  33. --- a/src/hostmon.c
  34. +++ b/src/hostmon.c
  35. @@ -31,7 +31,7 @@ details.
  36. #include <linux/if_packet.h>
  37. #include <linux/if_ether.h>
  38. #include <linux/if_fddi.h>
  39. -#include <linux/if_tr.h>
  40. +#include <netinet/if_tr.h>
  41. #include <net/if_arp.h>
  42. #include <stdlib.h>
  43. #include <time.h>
  44. diff --git a/src/install.sh b/src/install.sh
  45. index d2fd360..36d3516 100755
  46. --- a/src/install.sh
  47. +++ b/src/install.sh
  48. @@ -23,9 +23,9 @@ echo
  49. echo "*** Installing executable programs and preparing work directories"
  50. echo
  51. echo ">>> Installing iptraf in $TARGET"
  52. -$INSTALL -m 0700 -o root -g root -s iptraf $TARGET
  53. +$INSTALL -m 0700 -o root -g root iptraf $TARGET
  54. echo ">>> Installing rvnamed in $TARGET"
  55. -$INSTALL -m 0700 -o root -g root -s rvnamed $TARGET
  56. +$INSTALL -m 0700 -o root -g root rvnamed $TARGET
  57. if [ ! -d $WORKDIR ]; then
  58. echo ">>> Creating IPTraf work directory $WORKDIR"
  59. diff --git a/src/othptab.c b/src/othptab.c
  60. index 97771d1..a8bb536 100644
  61. --- a/src/othptab.c
  62. +++ b/src/othptab.c
  63. @@ -18,7 +18,7 @@ details.
  64. #include <asm/types.h>
  65. #include <linux/if_ether.h>
  66. -#include <linux/if_tr.h>
  67. +#include <netinet/if_tr.h>
  68. #include <linux/if_fddi.h>
  69. #include <winops.h>
  70. #include "arphdr.h"
  71. diff --git a/src/packet.c b/src/packet.c
  72. index 33fdf2a..1e2b81b 100644
  73. --- a/src/packet.c
  74. +++ b/src/packet.c
  75. @@ -36,7 +36,7 @@ details.
  76. #include <linux/if_packet.h>
  77. #include <linux/if_ether.h>
  78. #include <linux/if_fddi.h>
  79. -#include <linux/if_tr.h>
  80. +#include <netinet/if_tr.h>
  81. #include <linux/isdn.h>
  82. #include <linux/sockios.h>
  83. #include <msgboxes.h>
  84. diff --git a/src/tcptable.h b/src/tcptable.h
  85. index 3e17793..d1380b5 100644
  86. --- a/src/tcptable.h
  87. +++ b/src/tcptable.h
  88. @@ -23,7 +23,7 @@
  89. #include <linux/if_packet.h>
  90. #include <linux/if_ether.h>
  91. #include <linux/if_fddi.h>
  92. -#include <linux/if_tr.h>
  93. +#include <netinet/if_tr.h>
  94. #include <net/if.h>
  95. #include <netinet/ip.h>
  96. #include <netinet/udp.h>
  97. diff --git a/src/tr.c b/src/tr.c
  98. index 40c9e63..11f8045 100644
  99. --- a/src/tr.c
  100. +++ b/src/tr.c
  101. @@ -7,7 +7,7 @@
  102. */
  103. #include <asm/types.h>
  104. -#include <linux/if_tr.h>
  105. +#include <netinet/if_tr.h>
  106. #include <netinet/in.h>
  107. unsigned int get_tr_ip_offset(unsigned char *pkt)
  108. diff --git a/support/Makefile b/support/Makefile
  109. index 114bfc3..c962c09 100644
  110. --- a/support/Makefile
  111. +++ b/support/Makefile
  112. @@ -1,4 +1,3 @@
  113. -INCLUDEDIR = -I/usr/include/ncurses
  114. OBJS = input.o menurt.o listbox.o winops.o labels.o \
  115. msgboxes.o txbox.o
  116. @@ -12,7 +11,7 @@ libtextbox.a: $(OBJS)
  117. # gcc -shared -o libtextbox.so $(OBJS)
  118. %.o: %.c *.h
  119. - gcc -O2 -g -Wall -fPIC $(INCLUDEDIR) -c -o $*.o $<
  120. + ${CC} -O2 -g -Wall -fPIC -c -o $*.o $<
  121. clean:
  122. rm -rf *.o *~ libtextbox.a libtextbox.so
  123. --
  124. 1.8.4.2