1 |
< |
dnl configure.in for libstatgrab |
2 |
< |
dnl $Id$ |
1 |
> |
# -*- Autoconf -*- |
2 |
> |
# Process this file with autoconf to produce a configure script. |
3 |
> |
# |
4 |
> |
# configure.in for libstatgrab |
5 |
> |
# $Id$ |
6 |
> |
# |
7 |
|
|
8 |
< |
dnl Change these to change the package name and version |
9 |
< |
AC_INIT(libstatgrab, 0.1, dev@i-scream.org.uk) |
10 |
< |
AM_INIT_AUTOMAKE(libstatgrab, 0.1) |
8 |
> |
# Change these to change the package name and version |
9 |
> |
AC_INIT(libstatgrab, 0.6.1, bugs@i-scream.org) |
10 |
> |
AM_INIT_AUTOMAKE(libstatgrab, 0.6.1) |
11 |
|
|
12 |
< |
dnl The file we use to pass #define's to the source |
13 |
< |
AM_CONFIG_HEADER(config.h) |
12 |
> |
# Revision number (automatically updated) |
13 |
> |
AC_REVISION($Revision$) |
14 |
|
|
15 |
< |
dnl We need a CC, install, and ranlib |
15 |
> |
# Might work with older autoconfs... but tested on 2.57 |
16 |
> |
AC_PREREQ(2.57) |
17 |
> |
|
18 |
> |
# The file we use to pass #define's to the source |
19 |
> |
AM_CONFIG_HEADER([config.h]) |
20 |
> |
|
21 |
> |
# Checks for programs |
22 |
|
AC_PROG_CC |
23 |
|
AC_PROG_INSTALL |
24 |
< |
AC_PROG_RANLIB |
24 |
> |
AC_PROG_LIBTOOL |
25 |
|
|
26 |
< |
dnl And we probably need the standard C bits |
26 |
> |
# Checks for header files |
27 |
|
AC_HEADER_STDC |
28 |
|
|
29 |
< |
dnl The program needs to know whether it can use getloadavg |
30 |
< |
AC_CHECK_FUNCS(getloadavg) |
29 |
> |
# Checks for typedefs, structures, and compiler characteristics |
30 |
> |
AC_C_CONST |
31 |
|
|
32 |
< |
dnl Figure out details about the host - we need the OS |
33 |
< |
AC_CANONICAL_HOST |
32 |
> |
# Checks for library functions |
33 |
> |
AC_FUNC_MALLOC |
34 |
> |
AC_FUNC_REALLOC |
35 |
> |
AC_CHECK_FUNCS(atoll) |
36 |
|
|
37 |
< |
dnl Set things up for different OS's |
38 |
< |
dnl We define the name of the OS so the code can act accordingly |
39 |
< |
dnl We also need to add the right LDFLAGS |
37 |
> |
# Default needing setgid to false |
38 |
> |
AM_CONDITIONAL(SETGIDBINS, false) |
39 |
> |
|
40 |
> |
# Set things up for different OS's |
41 |
> |
# We define the name of the OS so the code can act accordingly |
42 |
> |
# We also need to add the right LDFLAGS |
43 |
|
case $host_os in |
44 |
+ |
solaris2.[[6-7]]) |
45 |
+ |
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
46 |
+ |
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
47 |
+ |
AC_DEFINE(SOL7, , [Building on Solaris 2.7]) |
48 |
+ |
LINKFLAGS="-lkstat" |
49 |
+ |
;; |
50 |
|
solaris2.*) |
51 |
+ |
AC_CHECK_HEADERS([kstat.h],,[AC_MSG_ERROR([need kstat.h])]) |
52 |
|
AC_DEFINE(SOLARIS, , [Building on Solaris 2.x]) |
53 |
< |
LDFLAGS="$LDFLAGS -lkstat" |
53 |
> |
LINKFLAGS="-lkstat" |
54 |
|
;; |
55 |
|
freebsd4.*) |
56 |
< |
AC_DEFINE(FREEBSD, , [Building on FreeBSD 4.x]) |
57 |
< |
LDFLAGS="$LDFLAGS -lkvm" |
56 |
> |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
57 |
> |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
58 |
> |
AM_CONDITIONAL(SETGIDBINS, true) |
59 |
> |
LINKFLAGS="-lkvm -ldevstat" |
60 |
|
;; |
61 |
+ |
freebsd5.*) |
62 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
63 |
+ |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
64 |
+ |
AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) |
65 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
66 |
+ |
LINKFLAGS="-lkvm -ldevstat" |
67 |
+ |
;; |
68 |
+ |
netbsdelf1.*) |
69 |
+ |
AC_DEFINE(ALLBSD, , [Building on a BSD-derived system]) |
70 |
+ |
AC_DEFINE(NETBSD, , [Building on NetBSD]) |
71 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
72 |
+ |
LINKFLAGS="-lkvm" |
73 |
+ |
;; |
74 |
|
linux-gnu) |
75 |
|
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
76 |
|
;; |
79 |
|
;; |
80 |
|
esac |
81 |
|
|
82 |
< |
dnl And finish by changing these files |
83 |
< |
AC_OUTPUT([Makefile]) |
82 |
> |
# User specified curses/ncurses prefix |
83 |
> |
AC_ARG_WITH([curses-prefix], |
84 |
> |
[ --with-curses-prefix=PATH curses (or ncurses) is in PATH], |
85 |
> |
[ |
86 |
> |
if test -d "$withval/lib"; then |
87 |
> |
SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}" |
88 |
> |
fi |
89 |
> |
if test -d "$withval/include"; then |
90 |
> |
SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}" |
91 |
> |
fi |
92 |
> |
] |
93 |
> |
) |
94 |
> |
|
95 |
> |
# Check if user wants to disable statgrab |
96 |
> |
AM_CONDITIONAL(STATGRAB, true) |
97 |
> |
AC_ARG_ENABLE(statgrab, |
98 |
> |
[ --disable-statgrab disable building of statgrab], |
99 |
> |
[ |
100 |
> |
if test "x$enableval" = "xno" ; then |
101 |
> |
AM_CONDITIONAL(STATGRAB, false) |
102 |
> |
fi |
103 |
> |
] |
104 |
> |
) |
105 |
> |
|
106 |
> |
# Check if user wants to disable saidar |
107 |
> |
AM_CONDITIONAL(SAIDAR, true) |
108 |
> |
AC_ARG_ENABLE(saidar, |
109 |
> |
[ --disable-saidar disable building of saidar], |
110 |
> |
[ |
111 |
> |
if test "x$enableval" = "xno" ; then |
112 |
> |
AM_CONDITIONAL(SAIDAR, false) |
113 |
> |
fi |
114 |
> |
], |
115 |
> |
[ |
116 |
> |
# saidar needs curses |
117 |
> |
# (if we don't find curses we disable saidar) |
118 |
> |
MP_WITH_CURSES |
119 |
> |
] |
120 |
> |
) |
121 |
> |
|
122 |
> |
# Check if the user would prefer not to build examples |
123 |
> |
AM_CONDITIONAL(EXAMPLES, true) |
124 |
> |
AC_ARG_ENABLE(examples, |
125 |
> |
[ --disable-examples disable building of examples], |
126 |
> |
[ |
127 |
> |
if test "x$enableval" = "xno" ; then |
128 |
> |
AM_CONDITIONAL(EXAMPLES, false) |
129 |
> |
fi |
130 |
> |
] |
131 |
> |
) |
132 |
> |
|
133 |
> |
# Check if user wants to install manpages |
134 |
> |
AM_CONDITIONAL(MANPAGES, true) |
135 |
> |
AC_ARG_ENABLE(manpages, |
136 |
> |
[ --disable-manpages disable installation of manpages], |
137 |
> |
[ |
138 |
> |
if test "x$enableval" = "xno" ; then |
139 |
> |
AM_CONDITIONAL(MANPAGES, false) |
140 |
> |
fi |
141 |
> |
] |
142 |
> |
) |
143 |
> |
|
144 |
> |
# Check if the user wants to turn off setgid binaries |
145 |
> |
# (only really relevant on FreeBSD) |
146 |
> |
AC_ARG_ENABLE(setgid-binaries, |
147 |
> |
[ --disable-setgid-binaries disable binaries being setgid], |
148 |
> |
[ |
149 |
> |
if test "x$enableval" = "xno" ; then |
150 |
> |
AM_CONDITIONAL(SETGIDBINS, false) |
151 |
> |
fi |
152 |
> |
] |
153 |
> |
) |
154 |
> |
|
155 |
> |
# The LIBS and CPPFLAGS that saidar needs |
156 |
> |
AC_SUBST(SAIDARLIBS) |
157 |
> |
AC_SUBST(SAIDARCPPFLAGS) |
158 |
> |
|
159 |
> |
# The flags needed to link to libstatgrab |
160 |
> |
# (ie. our dependencies) |
161 |
> |
AC_SUBST(LINKFLAGS) |
162 |
> |
|
163 |
> |
# And finish by changing these files |
164 |
> |
AC_CONFIG_FILES([Makefile src/Makefile src/libstatgrab/Makefile src/statgrab/Makefile docs/Makefile examples/Makefile libstatgrab.pc src/statgrab/statgrab-make-mrtg-config src/statgrab/statgrab-make-mrtg-index src/saidar/Makefile]) |
165 |
> |
|
166 |
> |
AC_OUTPUT |