6 |
|
# |
7 |
|
|
8 |
|
# Change these to change the package name and version |
9 |
< |
AC_INIT(libstatgrab, 0.6, bugs@i-scream.org) |
10 |
< |
AM_INIT_AUTOMAKE(libstatgrab, 0.6) |
9 |
> |
AC_INIT(libstatgrab, 0.8.2, bugs@i-scream.org) |
10 |
> |
AM_INIT_AUTOMAKE(libstatgrab, 0.8.2) |
11 |
|
|
12 |
|
# Revision number (automatically updated) |
13 |
|
AC_REVISION($Revision$) |
34 |
|
AC_FUNC_REALLOC |
35 |
|
AC_CHECK_FUNCS(atoll) |
36 |
|
|
37 |
+ |
# Disk IO read and write statistics are only present on recent NetBSD. |
38 |
+ |
AC_CHECK_MEMBER(struct disk_sysctl.dk_rbytes, |
39 |
+ |
[AC_DEFINE(HAVE_DK_RBYTES, , [New-style NetBSD stats])], |
40 |
+ |
[], |
41 |
+ |
[#include <sys/disk.h>]) |
42 |
+ |
|
43 |
+ |
# Check for loadavg.h |
44 |
+ |
AC_CHECK_HEADERS([sys/loadavg.h]) |
45 |
+ |
|
46 |
+ |
# Default needing setgid/setuid to false |
47 |
+ |
AM_CONDITIONAL(SETGIDBINS, false) |
48 |
+ |
AM_CONDITIONAL(SETUIDBINS, false) |
49 |
+ |
|
50 |
|
# Set things up for different OS's |
51 |
|
# We define the name of the OS so the code can act accordingly |
52 |
|
# We also need to add the right LDFLAGS |
55 |
|
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
56 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
57 |
|
AC_DEFINE(SOL7, , [Building on Solaris 2.7]) |
58 |
< |
LINKFLAGS="-lkstat" |
58 |
> |
AM_CONDITIONAL(SETUIDBINS, true) |
59 |
> |
LINKFLAGS="-lkstat -ldevinfo" |
60 |
|
;; |
61 |
|
solaris2.*) |
62 |
|
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
63 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
64 |
< |
LINKFLAGS="-lkstat" |
64 |
> |
AM_CONDITIONAL(SETUIDBINS, true) |
65 |
> |
LINKFLAGS="-lkstat -ldevinfo" |
66 |
|
;; |
67 |
|
freebsd4.*) |
68 |
< |
AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) |
68 |
> |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
69 |
> |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
70 |
> |
AM_CONDITIONAL(SETGIDBINS, true) |
71 |
|
LINKFLAGS="-lkvm -ldevstat" |
72 |
|
;; |
73 |
+ |
freebsd5.*) |
74 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
75 |
+ |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
76 |
+ |
AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) |
77 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
78 |
+ |
LINKFLAGS="-lkvm -ldevstat" |
79 |
+ |
;; |
80 |
+ |
netbsdelf*) |
81 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
82 |
+ |
AC_DEFINE(NETBSD, , [Building on NetBSD]) |
83 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
84 |
+ |
LINKFLAGS="-lkvm" |
85 |
+ |
;; |
86 |
|
linux-gnu) |
87 |
|
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
88 |
|
;; |
89 |
+ |
cygwin) |
90 |
+ |
AC_DEFINE(CYGWIN, , [Building on Cygwin]) |
91 |
+ |
;; |
92 |
|
*) |
93 |
|
AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) |
94 |
|
;; |
154 |
|
AM_CONDITIONAL(MANPAGES, false) |
155 |
|
fi |
156 |
|
] |
157 |
+ |
) |
158 |
+ |
|
159 |
+ |
# Check if the user wants to turn off setgid binaries |
160 |
+ |
AC_ARG_ENABLE(setgid-binaries, |
161 |
+ |
[ --disable-setgid-binaries disable binaries being setgid], |
162 |
+ |
[ |
163 |
+ |
if test "x$enableval" = "xno" ; then |
164 |
+ |
AM_CONDITIONAL(SETGIDBINS, false) |
165 |
+ |
fi |
166 |
+ |
] |
167 |
+ |
) |
168 |
+ |
|
169 |
+ |
# Check if the user wants to turn off setuid binaries |
170 |
+ |
AC_ARG_ENABLE(setuid-binaries, |
171 |
+ |
[ --disable-setuid-binaries disable binaries being setuid], |
172 |
+ |
[ |
173 |
+ |
if test "x$enableval" = "xno" ; then |
174 |
+ |
AM_CONDITIONAL(SETUIDBINS, false) |
175 |
+ |
fi |
176 |
+ |
] |
177 |
|
) |
178 |
|
|
179 |
|
# The LIBS and CPPFLAGS that saidar needs |