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.1, bugs@i-scream.org) |
10 |
> |
AM_INIT_AUTOMAKE(libstatgrab, 0.8.1) |
11 |
|
|
12 |
|
# Revision number (automatically updated) |
13 |
|
AC_REVISION($Revision$) |
34 |
|
AC_FUNC_REALLOC |
35 |
|
AC_CHECK_FUNCS(atoll) |
36 |
|
|
37 |
< |
# Default needing setgid to false |
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 |
> |
# Default needing setgid/setuid to false |
44 |
|
AM_CONDITIONAL(SETGIDBINS, false) |
45 |
+ |
AM_CONDITIONAL(SETUIDBINS, false) |
46 |
|
|
47 |
|
# Set things up for different OS's |
48 |
|
# We define the name of the OS so the code can act accordingly |
52 |
|
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
53 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
54 |
|
AC_DEFINE(SOL7, , [Building on Solaris 2.7]) |
55 |
< |
LINKFLAGS="-lkstat" |
55 |
> |
AM_CONDITIONAL(SETUIDBINS, true) |
56 |
> |
LINKFLAGS="-lkstat -ldevinfo" |
57 |
|
;; |
58 |
|
solaris2.*) |
59 |
|
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
60 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
61 |
< |
LINKFLAGS="-lkstat" |
61 |
> |
AM_CONDITIONAL(SETUIDBINS, true) |
62 |
> |
LINKFLAGS="-lkstat -ldevinfo" |
63 |
|
;; |
64 |
|
freebsd4.*) |
65 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
66 |
|
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
67 |
|
AM_CONDITIONAL(SETGIDBINS, true) |
68 |
|
LINKFLAGS="-lkvm -ldevstat" |
69 |
|
;; |
70 |
|
freebsd5.*) |
71 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
72 |
|
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
73 |
|
AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) |
74 |
|
AM_CONDITIONAL(SETGIDBINS, true) |
75 |
|
LINKFLAGS="-lkvm -ldevstat" |
76 |
|
;; |
77 |
+ |
netbsdelf*) |
78 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
79 |
+ |
AC_DEFINE(NETBSD, , [Building on NetBSD]) |
80 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
81 |
+ |
LINKFLAGS="-lkvm" |
82 |
+ |
;; |
83 |
|
linux-gnu) |
84 |
|
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
85 |
|
;; |
86 |
+ |
cygwin) |
87 |
+ |
AC_DEFINE(CYGWIN, , [Building on Cygwin]) |
88 |
+ |
;; |
89 |
|
*) |
90 |
|
AC_MSG_ERROR([Cannot build on unknown OS: $host_os]) |
91 |
|
;; |
154 |
|
) |
155 |
|
|
156 |
|
# Check if the user wants to turn off setgid binaries |
137 |
– |
# (only really relevant on FreeBSD) |
157 |
|
AC_ARG_ENABLE(setgid-binaries, |
158 |
|
[ --disable-setgid-binaries disable binaries being setgid], |
159 |
|
[ |
163 |
|
] |
164 |
|
) |
165 |
|
|
166 |
< |
# User specified pkgconfig dir |
167 |
< |
AC_ARG_WITH([pkgconfig-dir], |
168 |
< |
[ --with-pkgconfig-dir=PATH pkgconfig lib directory (PREFIX/lib/pkgconfig)], |
169 |
< |
[ PKGCONFIG_DIR=$withval ], |
170 |
< |
[ PKGCONFIG_DIR="\$(libdir)/pkgconfig" ] |
166 |
> |
# Check if the user wants to turn off setuid binaries |
167 |
> |
AC_ARG_ENABLE(setuid-binaries, |
168 |
> |
[ --disable-setuid-binaries disable binaries being setuid], |
169 |
> |
[ |
170 |
> |
if test "x$enableval" = "xno" ; then |
171 |
> |
AM_CONDITIONAL(SETUIDBINS, false) |
172 |
> |
fi |
173 |
> |
] |
174 |
|
) |
153 |
– |
AC_SUBST(PKGCONFIG_DIR) |
175 |
|
|
176 |
|
# The LIBS and CPPFLAGS that saidar needs |
177 |
|
AC_SUBST(SAIDARLIBS) |