Merge pull request #19372 from cotequeiroz/libgd
[feed/packages.git] / net / hping3 / patches / 011_buildsystem.patch
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
17 hping3: byteorder.h $(OBJ)
18 - $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@
19 + $(CC) -o hping3 $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) @SOLARISLIB@ @TCL_LIB@
20 @echo
21 - ./hping3 -v
22 @echo "use \`make strip' to strip hping3 binary"
23 @echo "use \`make install' to install hping3"
24
25 hping3-static: byteorder.h $(OBJ)
26 - $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) -L/usr/local/lib $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
27 -
28 -byteorder.h:
29 - ./configure
30 + $(CC) -static -o hping3-static $(CCOPT) $(DEBUG) $(OBJ) $(PCAP) @SOLARISLIB@ @TCL_LIB@ -ldl
31
32 .c.o:
33 $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
34 @@ -72,6 +68,8 @@ distclean:
35 rm -rf hping3 *.o byteorder byteorder.h systype.h Makefile libars.a .depend
36
37 install: hping3
38 +
39 +dont-install:
40 cp -f hping3 /usr/sbin/
41 chmod 755 /usr/sbin/hping3
42 ln -s /usr/sbin/hping3 /usr/sbin/hping
43 --- /dev/null
44 +++ b/byteorder.h
45 @@ -0,0 +1,15 @@
46 +
47 +#ifndef __BYTEORDER_H
48 +#define __BYTEORDER_H
49 +
50 +#if defined(__BYTE_ORDER__)
51 + #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
52 + #define __BIG_ENDIAN_BITFIELD
53 + #else
54 + #define __LITTLE_ENDIAN_BITFIELD
55 + #endif
56 +#else
57 + #error Byte order not set
58 +#endif
59 +
60 +#endif /* __BYTEORDER_H */
61 --- a/configure
62 +++ b/configure
63 @@ -1,5 +1,24 @@
64 #!/bin/sh
65
66 +# This fake configure script applies hard-coded settings for OpenWRT
67 +
68 +echo creating Makefile...
69 +sed -e "s^@PCAP@^PCAP=-lpcap^g" \
70 + -e "s^@PCAP_INCLUDE@^^g" \
71 + -e "s^@MANPATH@^/usr/share/man^g" \
72 + -e "s^@SOLARISLIB@^^g" \
73 + -e "s^@USE_TCL@^^g" \
74 + -e "s^@TCL_INC@^^g" \
75 + -e "s^@TCL_VER@^^g" \
76 + -e "s^@TCL_LIB@^^g" \
77 + <Makefile.in > Makefile
78 +
79 +echo now you can try \`make\'
80 +exit 0
81 +
82 +# Original file follows, to make the patch smaller
83 +#!/bin/sh
84 +
85 show_help()
86 {
87 echo configure help:
88 --- /dev/null
89 +++ b/systype.h
90 @@ -0,0 +1,6 @@
91 +#ifndef __SYSTYPE_H
92 +#define __SYSTYPE_H
93 +
94 +#define OSTYPE_LINUX
95 +
96 +#endif /* SYSTYPE_H */