You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.2 KiB

  1. --- a/Makefile.in
  2. +++ b/Makefile.in
  3. @@ -9,8 +9,8 @@
  4. CC= gcc
  5. AR=/usr/bin/ar
  6. RANLIB=/usr/bin/ranlib
  7. -CCOPT= -O2 -Wall @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
  8. -DEBUG= -g
  9. +CCOPT= $(CFLAGS) @PCAP_INCLUDE@ @TCL_INC@ @USE_TCL@
  10. +DEBUG=
  11. #uncomment the following if you need libpcap based build under linux
  12. #(not raccomanded)
  13. COMPILE_TIME=
  14. @@ -50,17 +50,13 @@ libars.a: $(ARSOBJ)
  15. $(RANLIB) $@
  16. hping3: byteorder.h $(OBJ)
  17. - $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
  18. + $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) @SOLARISLIB@ @TCL_LIB@
  19. @echo
  20. - ./hping3 -v
  21. @echo "use \`make strip' to strip hping3 binary"
  22. @echo "use \`make install' to install hping3"
  23. hping3-static: byteorder.h $(OBJ)
  24. - $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
  25. -
  26. -byteorder.h:
  27. - ./configure
  28. + $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
  29. .c.o:
  30. $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
  31. @@ -72,6 +68,8 @@ distclean:
  32. rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend
  33. install: hping3
  34. +
  35. +dont-install:
  36. cp -f hping3 /usr/sbin/
  37. chmod 755 /usr/sbin/hping3
  38. ln -s /usr/sbin/hping3 /usr/sbin/hping
  39. --- /dev/null
  40. +++ b/byteorder.h
  41. @@ -0,0 +1,15 @@
  42. +
  43. +#ifndef __BYTEORDER_H
  44. +#define __BYTEORDER_H
  45. +
  46. +#if defined(__BYTE_ORDER__)
  47. + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  48. + #define __BIG_ENDIAN_BITFIELD
  49. + #else
  50. + #define __LITTLE_ENDIAN_BITFIELD
  51. + #endif
  52. +#else
  53. + #error Byte order not set
  54. +#endif
  55. +
  56. +#endif /* __BYTEORDER_H */
  57. --- a/configure
  58. +++ b/configure
  59. @@ -1,5 +1,24 @@
  60. #!/bin/sh
  61. +# This fake configure script applies hard-coded settings for OpenWRT
  62. +
  63. +echo creating Makefile...
  64. +sed -e "s^@PCAP@^PCAP=-lpcap^g" \
  65. + -e "s^@PCAP_INCLUDE@^^g" \
  66. + -e "s^@MANPATH@^/usr/share/man^g" \
  67. + -e "s^@SOLARISLIB@^^g" \
  68. + -e "s^@USE_TCL@^^g" \
  69. + -e "s^@TCL_INC@^^g" \
  70. + -e "s^@TCL_VER@^^g" \
  71. + -e "s^@TCL_LIB@^^g" \
  72. + <Makefile.in > Makefile
  73. +
  74. +echo now you can try \`make\'
  75. +exit 0
  76. +
  77. +# Original file follows, to make the patch smaller
  78. +#!/bin/sh
  79. +
  80. show_help()
  81. {
  82. echo configure help:
  83. --- /dev/null
  84. +++ b/systype.h
  85. @@ -0,0 +1,6 @@
  86. +#ifndef __SYSTYPE_H
  87. +#define __SYSTYPE_H
  88. +
  89. +#define OSTYPE_LINUX
  90. +
  91. +#endif /* SYSTYPE_H */