6 |
|
# |
7 |
|
|
8 |
|
# Change these to change the package name and version |
9 |
< |
AC_INIT(libstatgrab, 0.4.1, dev@i-scream.org) |
10 |
< |
AM_INIT_AUTOMAKE(libstatgrab, 0.4.1) |
9 |
> |
AC_INIT(libstatgrab, 0.6.1, bugs@i-scream.org) |
10 |
> |
AM_INIT_AUTOMAKE(libstatgrab, 0.6.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 |
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 |
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 |
< |
LDFLAGS="$LDFLAGS -lkstat" |
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 -ldevstat" |
56 |
> |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
57 |
> |
AM_CONDITIONAL(SETGIDBINS, true) |
58 |
> |
LINKFLAGS="-lkvm -ldevstat" |
59 |
|
;; |
60 |
+ |
freebsd5.*) |
61 |
+ |
AC_DEFINE(FREEBSD, , [Building on FreeBSD]) |
62 |
+ |
AC_DEFINE(FREEBSD5, , [Building on FreeBSD 5.x]) |
63 |
+ |
AM_CONDITIONAL(SETGIDBINS, true) |
64 |
+ |
LINKFLAGS="-lkvm -ldevstat" |
65 |
+ |
;; |
66 |
|
linux-gnu) |
67 |
|
AC_DEFINE(LINUX, , [Building on GNU/Linux]) |
68 |
|
;; |
71 |
|
;; |
72 |
|
esac |
73 |
|
|
74 |
+ |
# User specified curses/ncurses prefix |
75 |
+ |
AC_ARG_WITH([curses-prefix], |
76 |
+ |
[ --with-curses-prefix=PATH curses (or ncurses) is in PATH], |
77 |
+ |
[ |
78 |
+ |
if test -d "$withval/lib"; then |
79 |
+ |
SAIDARLIBS="-L${withval}/lib ${SAIDARLIBS}" |
80 |
+ |
fi |
81 |
+ |
if test -d "$withval/include"; then |
82 |
+ |
SAIDARCPPFLAGS="-I${withval}/include -I${withval}/include/ncurses ${SAIRDARCPPFLAGS}" |
83 |
+ |
fi |
84 |
+ |
] |
85 |
+ |
) |
86 |
+ |
|
87 |
+ |
# Check if user wants to disable statgrab |
88 |
+ |
AM_CONDITIONAL(STATGRAB, true) |
89 |
+ |
AC_ARG_ENABLE(statgrab, |
90 |
+ |
[ --disable-statgrab disable building of statgrab], |
91 |
+ |
[ |
92 |
+ |
if test "x$enableval" = "xno" ; then |
93 |
+ |
AM_CONDITIONAL(STATGRAB, false) |
94 |
+ |
fi |
95 |
+ |
] |
96 |
+ |
) |
97 |
+ |
|
98 |
+ |
# Check if user wants to disable saidar |
99 |
+ |
AM_CONDITIONAL(SAIDAR, true) |
100 |
+ |
AC_ARG_ENABLE(saidar, |
101 |
+ |
[ --disable-saidar disable building of saidar], |
102 |
+ |
[ |
103 |
+ |
if test "x$enableval" = "xno" ; then |
104 |
+ |
AM_CONDITIONAL(SAIDAR, false) |
105 |
+ |
fi |
106 |
+ |
], |
107 |
+ |
[ |
108 |
+ |
# saidar needs curses |
109 |
+ |
# (if we don't find curses we disable saidar) |
110 |
+ |
MP_WITH_CURSES |
111 |
+ |
] |
112 |
+ |
) |
113 |
+ |
|
114 |
+ |
# Check if the user would prefer not to build examples |
115 |
+ |
AM_CONDITIONAL(EXAMPLES, true) |
116 |
+ |
AC_ARG_ENABLE(examples, |
117 |
+ |
[ --disable-examples disable building of examples], |
118 |
+ |
[ |
119 |
+ |
if test "x$enableval" = "xno" ; then |
120 |
+ |
AM_CONDITIONAL(EXAMPLES, false) |
121 |
+ |
fi |
122 |
+ |
] |
123 |
+ |
) |
124 |
+ |
|
125 |
+ |
# Check if user wants to install manpages |
126 |
+ |
AM_CONDITIONAL(MANPAGES, true) |
127 |
+ |
AC_ARG_ENABLE(manpages, |
128 |
+ |
[ --disable-manpages disable installation of manpages], |
129 |
+ |
[ |
130 |
+ |
if test "x$enableval" = "xno" ; then |
131 |
+ |
AM_CONDITIONAL(MANPAGES, false) |
132 |
+ |
fi |
133 |
+ |
] |
134 |
+ |
) |
135 |
+ |
|
136 |
+ |
# Check if the user wants to turn off setgid binaries |
137 |
+ |
# (only really relevant on FreeBSD) |
138 |
+ |
AC_ARG_ENABLE(setgid-binaries, |
139 |
+ |
[ --disable-setgid-binaries disable binaries being setgid], |
140 |
+ |
[ |
141 |
+ |
if test "x$enableval" = "xno" ; then |
142 |
+ |
AM_CONDITIONAL(SETGIDBINS, false) |
143 |
+ |
fi |
144 |
+ |
] |
145 |
+ |
) |
146 |
+ |
|
147 |
+ |
# User specified pkgconfig dir |
148 |
+ |
AC_ARG_WITH([pkgconfig-dir], |
149 |
+ |
[ --with-pkgconfig-dir=PATH pkgconfig lib directory (PREFIX/lib/pkgconfig)], |
150 |
+ |
[ PKGCONFIG_DIR=$withval ], |
151 |
+ |
[ PKGCONFIG_DIR="\$(libdir)/pkgconfig" ] |
152 |
+ |
) |
153 |
+ |
AC_SUBST(PKGCONFIG_DIR) |
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 docs/Makefile]) |
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 |