/
configure.in
140 lines (119 loc) · 3.46 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
129
130
131
132
133
134
135
136
137
138
139
140
dnl Process this file with autoconf to produce a configure script.
AC_INIT(mlan/mlan.c)
dnl Checks for programs.
AC_PROG_CC(cc -g)
AC_PROG_RANLIB
AC_PATH_PROG(AR, ar, /bin/ar, $PATH)
AC_PATH_PROG(LINT, lint, /bin/lint, $PATH)
AC_PROGRAM_CHECK(UNAMEPROG, uname, uname, )
AC_PROGRAM_CHECK(TRPROG, tr, tr, )
AC_PROGRAM_CHECK(SEDPROG, sed, sed, )
AC_PROGRAM_CHECK(CUTPROG, cut, cut, )
AC_PROGRAM_CHECK(GUILECONF, guile-config, guile-config, )
AC_ARG_ENABLE(mymalloc, [ --enable-mymalloc enable my debug malloc code],
[
echo "Enabling debug malloc."
CPPFLAGS="$CPPFLAGS -DMYMALLOC"
])
AC_ARG_WITH(rrdtool, [ --with-rrdtool path to rrdtool installation],
[if test -d $withval/include && test -d $withval/lib
then
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi])
AC_ARG_WITH(postgresql, [ --with-postgresql path to postgresql installation],
[if test -d $withval/include && test -d $withval/lib
then
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi],
[
AC_MSG_CHECKING(postgres installation)
if test -d /usr/local/pgsql
then
CPPFLAGS="$CPPFLAGS -I/usr/local/pgsql/include"
LDFLAGS="$LDFLAGS -L/usr/local/pgsql/lib"
AC_MSG_RESULT(/usr/local/pgsql)
else
AC_MSG_RESULT(not found)
fi
])
AC_ARG_WITH(pthreads, [ --with-pthreads path to pthreads installation],
[if test -d $withval/include && test -d $withval/lib
then
CPPFLAGS="$CPPFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
fi])
AC_ARG_WITH(mlan-dev, [ --with-mlan-dev path to default mlan device],
CPPFLAGS="$CPPFLAGS -DDEFAULT_MLAN_DEVICE='\"$withval\"'"
)
dnl I needed these for something, might as well not include them if they
dnl don't exist.
if test -d /usr/local/include
then
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
fi
if test -d /usr/local/lib
then
LDFLAGS="$LDFLAGS -L/usr/local/lib"
fi
dnl If there's guile, build the guile stuff.
if test "$GUILECONF" = ""
then
GUILESTUFF=""
GUILEINC=""
else
GUILESTUFF="mlanscm"
GUILEINC=`$GUILECONF compile`
fi
AC_SUBST(GUILESTUFF)
AC_SUBST(GUILEINC)
AC_DEFINE_UNQUOTED(DYNLIBS, $DYNLIBS)
AC_SUBST(DYNLIBS)
AC_DEFINE_UNQUOTED(NEEDUNDERSCORE, $NEEDUNDERSCORE)
AC_SUBST(NEEDUNDERSCORE)
AC_DEFINE_UNQUOTED(MAKESO, $MAKESO)
AC_SUBST(MAKESO)
if test "$OS" = "unixware"
then
AC_CHECK_LIB(ucb, main)
AC_CHECK_LIB(gen, main)
fi
dnl Solaris stuff
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(m, pow)
RRDLIB=""
AC_CHECK_LIB(rrd, rrd_update,
[RRDLIB="-lrrd"
AC_DEFINE_UNQUOTED(RRDLIB, $RRDLIB)])
AC_SUBST(RRDLIB)
POSTGRESLIB=""
AC_CHECK_LIB(pq, PQexec,
[POSTGRESLIB="-lpq"
AC_DEFINE_UNQUOTED(POSTGRESLIB, $POSTGRESLIB)])
AC_SUBST(POSTGRESLIB)
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h sys/errno.h unistd.h getopt.h getopts.h pthread.h)
AC_CHECK_HEADERS(utime.h utimes.h alloca.h)
AC_CHECK_HEADERS(rrd.h libpq-fe.h)
dnl check for working pthreads
SPY_PTHREAD
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(getopt vsprintf vsnprintf snprintf sprintf strerror utime utimes)
if test "$GCC" = "yes"
then
echo "GCC, setting -Wall and -Werror"
CPPFLAGS="$CPPFLAGS -Wall"
CFLAGS="$CFLAGS -Werror"
fi
CFLAGS="$CFLAGS $CPPFLAGS $EXTRACFLAGS"
AC_OUTPUT(Makefile collection/Makefile mlan/Makefile commands/Makefile)