Annotation of embedaddon/hping2/configure, revision 1.1.1.1.2.1
1.1 misho 1: #!/bin/sh
2:
3: show_help()
4: {
5: echo configure help:
6: echo "--help show this help"
7: echo "--force-libpcap build a libpcap based binary under linux"
8: echo " even if uid != euid"
9: }
10:
11: if [ "$1" = "--help" ]; then
12: show_help
13: exit 0
14: fi
15:
16: CC=${CC:=cc}
17:
18: echo build byteorder.c...
19: $CC byteorder.c -o byteorder || exit 1
20:
21: INSTALL_MANPATH=`echo $MANPATH|cut -f1 -d:`
22: if [ "$INSTALL_MANPATH" = "" ]; then
23: INSTALL_MANPATH="/usr/local/man"
24: fi
25: BYTEORDER=`./byteorder -m`
26:
27: echo create byteorder.h...
28: cat > byteorder.h <<EOF
29: #ifndef __BYTEORDER_H
30: #define __BYTEORDER_H
31:
32: EOF
33: echo \#ifndef $BYTEORDER >> byteorder.h
34: echo \#define $BYTEORDER >> byteorder.h
35: echo \#endif /\* $BYTEORDER \*/ >> byteorder.h
36: cat >> byteorder.h <<EOF
37:
38: #endif /* __BYTEORDER_H */
39: EOF
40:
41: CONFIGOSTYPE=`uname -s | tr [a-z] [A-Z]`
42: if [ ! "$CONFIGOSTYPE" ]; then
43: CONFIGOSTYPE=UNKNOWN
44: fi
45:
46: # for BSD/OS use the historical name as it doesn't include '/'
47: if [ $CONFIGOSTYPE = "BSD/OS" ]; then
48: CONFIGOSTYPE=BSDI
49: fi
50:
51: case $CONFIGOSTYPE in
52: SUNOS)
53: SOLARISLIB="-lsocket -lresolv -lnsl"
54: BUG='/* #define STUPID_SOLARIS_CHECKSUM_BUG */'
55: case `uname -r` in
56: 2.0*|5.0*|2.1*|5.1*|2.2*|5.2*|2.3*|5.3*|2.4*|5.4*|5.5.1)
57: BUG='#define STUPID_SOLARIS_CHECKSUM_BUG' ;;
58: esac
59: esac
60:
61: #
62: # configurable stuff
63: #
64: FORCE_LIBPCAP=""
65: if [ "$CONFIGOSTYPE" = "LINUX" ]; then
66: PCAP=""
67: PCAP_INCLUDE=""
68: else
69: PCAP="PCAP=-lpcap"
70: PCAP_INCLUDE=""
71: fi
72:
73: for ARG in $*; do
74: case "$ARG" in
75: *"--force-libpcap")
76: FORCE_LIBPCAP="-DFORCE_LIBPCAP"
77: PCAP="PCAP=-lpcap"
78: PCAP_INCLUDE=""
79: ;;
80: esac
81: done
82:
83: echo --------------------------------------
84: echo system type: $CONFIGOSTYPE
85: echo
86: echo "FORCE_LIBPCAP: $FORCE_LIBPCAP"
87: echo "LIBPCAP : $PCAP"
88: echo "PCAP_INCLUDE : $PCAP_INCLUDE"
89: echo "MANPATH : $INSTALL_MANPATH"
90: echo
91: echo "(to modify try configure --help)"
92: echo --------------------------------------
93:
94: echo creating Makefile...
95: sed -e "s/@FORCE_LIBPCAP@/$FORCE_LIBPCAP/g" \
96: -e "s^@PCAP@^$PCAP^g" \
97: -e "s^@PCAP_INCLUDE@^$PCAP_INCLUDE^g" \
98: -e "s^@MANPATH@^$INSTALL_MANPATH^g" \
99: -e "s^@SOLARISLIB@^$SOLARISLIB^g" \
100: <Makefile.in > Makefile
101:
102: #
103: #
104: #
105:
106: cat > systype.h <<EOF
107: #ifndef __SYSTYPE_H
108: #define __SYSTYPE_H
109:
110: EOF
111: echo \#define OSTYPE_${CONFIGOSTYPE} >> systype.h
112: cat >> systype.h <<EOF
113:
114: #endif /* SYSTYPE_H */
115: EOF
116:
117: echo now you can try \`make\'
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>