-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
128 lines (116 loc) · 3.24 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
AC_INIT(os/os.cpp)
AC_CONFIG_HEADER(config.h)
AC_SUBST(FASTDEP)
AC_SUBST(MAKEFILE_LIST)
AC_SUBST(CPPFLAGS)
AC_SUBST(UINT32)
AC_SUBST(PRODUCTNAME)
AC_SUBST(PRODUCTVERSION)
AC_SUBST(LIBS)
AC_SUBST(KYLIXPATH)
AC_SUBST(STARTBCB)
ALL_LINGUAS="en"
UINT32=[unsigned]
ACTIONS=[true]
PRODUCTNAME="traffic"
PRODUCTVERSION=[0.1.3]
AC_ARG_ENABLE(release, [--enable-release - Specified when you want optimized output binaries. This is still beta, don't be brave.], [CPPFLAGS=-O2], [CPPFLAGS=-g] )
AC_ARG_WITH(kylix3, [--with-kylix3 - Specified when you have Borland Kylix installed and you want to compile the Kylix components], [KYLIXPATH="$with_kylix3/bin"], [])
AC_LANG_CPLUSPLUS
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_ISC_POSIX
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(netdb.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(sys/poll.h)
AC_CHECK_HEADERS(memory.h)
AC_CHECK_HEADERS(map,[],AC_ERROR(You need the STL include files: map))
AC_CHECK_HEADERS(deque,[],AC_ERROR(You need the STL include files: dequeue))
AC_CHECK_HEADERS(iostream,[],AC_ERROR(You need the STL include files: iostream))
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(netinet/in.h)
AC_STDC_HEADERS
AC_CHECK_SIZEOF(unsigned,4)
AC_CHECK_SIZEOF(short unsigned,2)
AC_CHECK_SIZEOF(long unsigned,4)
AC_CHECK_SIZEOF(char,1)
AC_PATH_PROG(FASTDEP, fastdep, [])
AC_CHECK_LIB(dl,dlopen)
AC_LANG_C
AC_SEARCH_LIBS(pthread_create,[pthread c_r],,AC_ERROR(You need the pthread functions))
AC_MSG_CHECKING("Kylix3")
STARTBCB=[]
if test ! -z $KYLIXPATH; then
if test -x $KYLIXPATH/startbcb; then
STARTBCB="$KYLIXPATH/startbcb";
AC_MSG_RESULT( $STARTBCB )
fi
fi
if test -z $STARTBCB; then
STARTBCB=`which startbcb 2> /dev/null`
if test ! -z $STARTBCB; then
if test -x $STARTBCB; then
AC_MSG_RESULT( $STARTBCB )
else
AC_MSG_RESULT( "no" )
fi
else
AC_MSG_RESULT( "no" )
fi
fi
AC_LANG_CPLUSPLUS
if test "$ac_cv_sizeof_unsigned" != "4"; then
if test "$ac_cv_sizeof_short_unsigned" != "4"; then
UINT32=[short unsigned]
else
if test "$ac_cv_sizeof_long_unsigned" != "4"; then
UINT32=[long unsigned]
else
AC_ERROR( This will only work on compilers with 32-bit integers )
fi
fi
fi
if test "$ac_cv_sizeof_char" != "1"; then
AC_ERROR( char is assumed to be 1 byte in size )
fi
if test "$FASTDEP" = ""; then
AC_ERROR( You need fastdep in the path to be able to build this project )
fi
if test ! -d "lib_dynamic"; then
ACTIONS=["$ACTIONS ; echo Creating lib_dynamic ; mkdir lib_dynamic"]
fi
if test ! -d "lib_static"; then
ACTIONS=["$ACTIONS ; echo Creating lib_static ; mkdir lib_static"];
fi
MAKEFILE_LIST=" Makefile \
os/Makefile \
protocols/Makefile \
protocols/tcp/Makefile \
protocols/udp/Makefile \
reply/Makefile \
reply/ack/Makefile \
reply/echo/Makefile \
payload/Makefile \
payload/fixed/Makefile \
payload/increasing/Makefile \
payload/random/Makefile \
client/Makefile \
client/fixed/Makefile \
interface/Makefile \
interface/cmdline/Makefile \
server/Makefile \
server/basic/Makefile \
"
dnl TODO other -D's for other OS's
if test `uname` = FreeBSD; then
FASTDEP=["$FASTDEP -D__FreeBSD__"]
else
FASTDEP=["$FASTDEP -DLINUX"]
fi
AC_OUTPUT($MAKEFILE_LIST mytypes.h,
[$ACTIONS],
[ACTIONS=$ACTIONS])