-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfigure.ac
140 lines (114 loc) · 4.16 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.50])
AC_INIT([dhcpsnoopingd], [0.2], [michael-dev@fami-braun.de])
AC_CONFIG_SRCDIR([src])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_LANG(C)
GCC_STACK_PROTECTOR
PKG_CHECK_MODULES(LIBNL, libnl-3.0)
AC_SUBST(LIBNL_CFLAGS)
AC_SUBST(LIBNL_LIBS)
PKG_CHECK_MODULES(LIBNLGENL, libnl-genl-3.0)
AC_SUBST(LIBNLGENL_CFLAGS)
AC_SUBST(LIBNLGENL_LIBS)
PKG_CHECK_MODULES(LIBNLNF, libnl-nf-3.0)
AC_SUBST(LIBNLNF_CFLAGS)
AC_SUBST(LIBNLNF_LIBS)
PKG_CHECK_MODULES(LIBNLROUTE, libnl-route-3.0)
AC_SUBST(LIBNLROUTE_CFLAGS)
AC_SUBST(LIBNLROUTE_LIBS)
#check if we want a debug build
AC_ARG_ENABLE(debug, [ --enable-debug enable debug output], [
if test "x$enableval" != "xno"; then
AC_DEFINE([DEBUG], , [Enable debug output])
fi
])
#check if version is given
AC_ARG_WITH(rev, [ --with-rev enable rev output], [
if test "x$withval" != "x"; then
AC_DEFINE_UNQUOTED([REV],"$withval",[revision])
fi
])
#check if we want roaming
AC_ARG_ENABLE(roaming, [ --enable-roaming enable roaming support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_ROAMING__], , [Enable roaming support])
fi
])
AC_ARG_WITH([nflog-group],
[AS_HELP_STRING([--with-nflog-group], [nflog group id, defaults to 1])],
AC_DEFINE_UNQUOTED([NFLOG_GROUP], $withval , [nflog group]),
AC_DEFINE([NFLOG_GROUP], 1 , [nflog group]))
#check if we want mysql
AC_ARG_ENABLE(mysql, [ --enable-mysql enable MySQL support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_MYSQL__], , [Enable mysql support])
# Get MySQL library and include locations
AC_ARG_WITH([mysql-include-path],
[AS_HELP_STRING([--with-mysql-include-path],
[location of the MySQL headers, defaults to /usr/include/mysql])],
[MYSQL_CFLAGS="-I$withval"],
[MYSQL_CFLAGS='-I/usr/include/mysql'])
AC_SUBST([MYSQL_CFLAGS])
AC_ARG_WITH([mysql-lib-path],
[AS_HELP_STRING([--with-mysql-lib-path], [location of the MySQL libraries])],
[MYSQL_LIBS="-L$withval -lmysqlclient"],
[MYSQL_LIBS='-L/usr/lib/mysql -lmysqlclient'])
AC_SUBST([MYSQL_LIBS])
fi
])
#check if we want pgsql
AC_ARG_ENABLE(pgsql, [ --enable-pgsql enable PostgreSQL support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_PGSQL__], , [Enable pgsql support])
# Get PgSQL library and include locations
PKG_CHECK_MODULES([PGSQL], [libpq])
AC_ARG_WITH([pgsql-include-path],
[AS_HELP_STRING([--with-pgsql-include-path],
[location of the PgSQL headers, defaults to pkg_config])],
[PGSQL_CFLAGS="-I$withval"],
[])
AC_SUBST([PGSQL_CFLAGS])
AC_ARG_WITH([pgsql-lib],
[AS_HELP_STRING([--with-pgsql-lib], [PgSQL libraries])],
[PGSQL_LIBS="$withval"],
[])
AC_ARG_WITH([pgsql-lib-path],
[AS_HELP_STRING([--with-pgsql-lib-path], [location of the PgSQL libraries])],
[PGSQL_LIBS="-L$withval $PGSQL_LIBS"],
[])
AC_SUBST([PGSQL_LIBS])
fi
])
AC_ARG_ENABLE(vlan, [ --enable-vlan enable vlan support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_VLAN__], , [Enable vlan support])
fi
])
AC_ARG_ENABLE(ebtables, [ --enable-ebtables enable ebtables support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_EBTABLES__], , [Enable ebtables support])
fi
])
AC_ARG_ENABLE(nftables, [ --enable-nftables enable nftables support], [
if test "x$enableval" != "xno"; then
AC_DEFINE([__USE_NFTABLES__], , [Enable nftables support])
fi
])
# Checks for header files.
AC_HEADER_STDC
# libnet.h
AC_CHECK_HEADER([libnet.h],
[AC_DEFINE([HAVE_LIBNET_H], [1], [Define to 1 if you have <libnet.h>.])],
[AC_MSG_ERROR([missing 'libnet.h', please install libnet package])])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CONFIG_FILES([Makefile])
AC_OUTPUT