-
Notifications
You must be signed in to change notification settings - Fork 18
/
configure.ac
161 lines (135 loc) · 4.62 KB
/
configure.ac
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
## Configure template for mul
## Written for mul by Dipjyoti Saikia
AC_PREREQ(2.6)
AC_INIT(MuL, 1.1, [http://sourceforge.net/projects/mul/])
AC_CONFIG_SRCDIR(common/mul_of_msg.h)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(common/config.h)
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_GCC_TRADITIONAL
dnl -----------------
dnl System extensions
dnl -----------------
AC_GNU_SOURCE
dnl -------
dnl libtool
dnl -------
AC_PROG_LIBTOOL
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
sys/types.h linux/version.h netdb.h asm/types.h \
sys/param.h limits.h signal.h \
sys/socket.h netinet/in.h time.h sys/time.h])
# Checks for library functions.
AC_FUNC_MALLOC
AC_CHECK_FUNCS([inet_ntoa memset mkfifo strrchr strtoul strtoull])
dnl ---------------
dnl other functions
dnl ---------------
AC_CHECK_FUNCS([dup2 ftruncate getcwd gethostbyname getpagesize gettimeofday \
inet_ntoa inet_aton strnlen \
memchr memmove memset select socket \
strcasecmp strchr strcspn strdup strerror \
strncasecmp strndup strrchr strspn strstr \
strtol strtoul strlcat strlcpy \
daemon snprintf vsnprintf \
if_nametoindex if_indextoname getifaddrs \
uname fcntl])
AC_CHECK_PROG([GAWK],[gawk],[gawk],[not-in-PATH])
if test "x$GAWK" = "xnot-in-PATH" ; then
AC_MSG_ERROR([GNU awk is required by mul])
fi
AC_ARG_VAR([GAWK],[GNU AWK])
if test "$GCC" = "yes" ; then
CFLAGS="$CFLAGS -O2 -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security -Wunused-parameter -Wstrict-aliasing -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -Wno-override-init"
CFLAGS="$CFLAGS -fno-strict-aliasing"
else
AC_MSG_ERROR([GCC/ICC is required by mul])
exit 1;
fi
AC_ARG_WITH(lldp,
[ --with-lldp Set lldp as "m" for lldp as a module])
AM_CONDITIONAL(HAVE_LLDP_MODULE, test "$with_lldp" = m)
AC_SUBST([HAVE_LLDP_MODULE])
AC_ARG_WITH(l2sw,
[ --with-l2sw Set l2sw as "m" for l2sw as a module])
AM_CONDITIONAL(HAVE_L2SW_MODULE, test "$with_l2sw" = m)
AC_SUBST([HAVE_L2SW_MODULE])
save_LIBS="$LIBS"
LIBS=""
AC_ARG_WITH(glib,
[ --with-glib Set glib path])
if test "x$with_glib" != "x" ; then
LIB_GLIB="$with_glib"/glib/.libs ;
GLIB_INCLUDE="$with_glib"/glib
if ! test -f "$LIB_GLIB/libglib-2.0.so"; then
AC_MSG_ERROR([glib not found])
fi
if ! test -f "$GLIB_INCLUDE/glib.h"; then
AC_MSG_ERROR([glib header file not found])
fi
have_glib=no
else
LIB_GLIB=
GLIB_INCLUDE=
AC_SEARCH_LIBS([g_get_monotonic_time], [glib-2.0],
[have_glib=yes],
[AC_MSG_ERROR([glib is not installed])])
AC_CHECK_HEADERS([glib.h], [],
[AC_MSG_ERROR([glib header file not found])])
fi
LIBS="$save_LIBS"
AM_CONDITIONAL(HAVE_EXT_GLIB, test "$have_glib" = yes)
AC_SUBST([LIB_GLIB])
AC_SUBST([GLIB_INCLUDE])
save_LIBS="$LIBS"
LIBS=""
AC_ARG_WITH(libevent,
[ --with-libevent Set libevent path])
if test "x$with_libevent" != "x" ; then
LIB_EVENT="$with_libevent"/.libs ;
LIBEVENT_INCLUDE="$with_libevent"/include;
if ! test -f "$LIB_EVENT/libevent.so"; then
AC_MSG_ERROR([libevent not found])
fi
if ! test -f "$LIBEVENT_INCLUDE/event2/event.h"; then
AC_MSG_ERROR([libevent header file not found])
fi
have_libevent=no
else
LIB_EVENT=
LIBEVENT_INCLUDE=
AC_SEARCH_LIBS([event_new], [event],
[have_libevent=yes],
[AC_MSG_ERROR([libevent is not installed])])
AC_CHECK_HEADERS([event2/event.h], [],
[AC_MSG_ERROR([libevent header file not found])])
fi
LIBS="$save_LIBS"
AM_CONDITIONAL(HAVE_EXT_LIBEVENT, test "$have_libevent" = yes)
AC_SUBST([LIB_EVENT])
AC_SUBST([LIBEVENT_INCLUDE])
save_LIBS="$LIBS"
LIBS=""
AC_SEARCH_LIBS([pthread_create], [pthread],
[],
[AC_MSG_ERROR([libpthread is not installed])])
AC_CHECK_HEADERS([pthread.h])
LIBS="$save_LIBS"
AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP,,inet_ntop)])
AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON,,inet_pton)])
AC_CHECK_LIB(crypt, crypt)
AC_CONFIG_FILES([Makefile mul/Makefile application/hello/Makefile application/l2switch/Makefile application/fabric/Makefile application/cli/Makefile services/loadable/topo_routing/Makefile common-libs/3rd-party/derived-lib/Makefile common-libs/3rd-party/quagga-lib/Makefile common-libs/mul-lib/Makefile])
AC_OUTPUT