1 AC_INIT([Conky],[1.3.5dev3.1],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3.5dev3.1)
4 AM_CONFIG_HEADER(src/config.h)
29 # Solaris doesn't work at all right now
35 echo "Your operating system $uname isn't supported"
36 echo "Feel free to help. :P"
41 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
42 AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
43 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
44 AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
52 [ --enable-xft enable if you want to use Xft [[default=no]]],
53 [want_xft="$enableval"])
60 AC_ARG_ENABLE(own_window,
61 [ --enable-own-window enable if you want support for creating own window [[default=yes]]],
64 if test $dah != "no"; then
65 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
69 dnl PROC_UPTIME option
73 AC_ARG_ENABLE(proc_uptime,
74 [ --enable-proc-uptime enable using /proc/uptime for uptime [[default=no]]],
77 if test $dah = "yes"; then
78 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
87 [ --enable-seti enable if you want SETI at Home stats [[default=no]]],
88 [want_seti="$enableval"])
90 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
91 if test x$want_seti = xyes; then
92 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
101 [ --enable-mpd enable if you want MPD support [[default=no]]],
102 [want_mpd="$enableval"])
104 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
105 if test x$want_mpd = xyes; then
106 AC_DEFINE(MPD, 1, [Define if you want MPD support])
114 AC_ARG_ENABLE(portmon,
115 [ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=no]]],
116 [want_portmon="$enableval"])
118 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
119 if test x$want_portmon = xyes; then
120 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
121 if test "x$PORT_MONITORS_MISSING" = xyes; then
122 AC_MSG_ERROR([missing a needed network header for port monitoring])
124 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
136 AC_ARG_ENABLE(mldonkey,
137 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
138 [want_mldonkey="$enableval"])
140 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
141 if test x$want_mldonkey = xyes; then
142 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
156 AC_ARG_ENABLE(double_buffer,
157 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
162 [ --enable-x11 enable if you want X11 support [[default=yes]]],
163 [want_x11="$enableval"])
166 if test "x$want_x11" = "xyes"; then
169 CFLAGS="$CFLAGS $X_CFLAGS"
170 LIBS="$LIBS $X_LIBS $X11_LIBS"
171 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
172 if test "x$X_DISPLAY_MISSING" = xyes; then
173 AC_MSG_ERROR([something went wrong when checking for X11, you're probably missing headers or it's not installed, either re-run configure with --disable-x11, or fix this])
175 AC_DEFINE(X11, 1, [Define if you want to use X11])
176 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
177 AM_CONDITIONAL(BUILD_X11, true)
178 if test $dah != "no"; then
179 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
180 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
181 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
184 AM_CONDITIONAL(BUILD_X11, false)
191 if test x$want_xft && test x$want_x11; then
192 AC_PATH_PROG(XFTCONFIG, xft-config)
193 if test x$XFTCONFIG != x; then
194 dnl TODO: needs more checks
196 dnl This won't work for some reason
197 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
198 if test "x$XFT_MISSING" = xyes; then
199 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
202 AC_DEFINE(XFT, 1, [Define if you are using Xft])
203 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
204 XFT_LIBS=`$XFTCONFIG --libs`
214 if test x$WANT_KVM = xyes; then
215 AC_CHECK_LIB(kvm, kvm_open,
217 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
225 if test x$WANT_DEVSTAT = xyes; then
226 AC_CHECK_LIB(devstat, devstat_getversion,
227 LIBS="$LIBS -ldevstat",
228 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
233 dnl OSSLIB for NetBSD
236 if test x$WANT_OSSLIB = xyes; then
237 AC_CHECK_LIB(ossaudio, _oss_ioctl,
238 LIBS="$LIBS -lossaudio",
239 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
244 dnl Some random headers
248 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
249 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
250 AC_CHECK_HEADERS([sys/mount.h], [], [],
251 [#ifdef HAVE_SYS_PARAM_H
252 #include <sys/param.h>
260 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
261 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
262 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
263 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
264 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
266 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
273 if test x$WANT_SYSINFO = xyes; then
275 AC_MSG_CHECKING(for sysinfo)
277 [#include <sys/types.h>
278 #include <sys/sysinfo.h>],
279 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
280 [AC_MSG_RESULT(yes); dah=yes],
281 [AC_MSG_RESULT(not usable); dah=no])
283 if test x$dah = xyes; then
284 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
292 if test x$WANT_KSTAT = xyes; then
294 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
296 if test x$dah = xyes; then
297 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
298 LDFLAGS="$LDFLAGS -lkstat"
302 AC_DEFUN([AM_LANGINFO_CODESET],
304 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
305 [AC_TRY_LINK([#include <langinfo.h>],
306 [char* cs = nl_langinfo(CODESET);],
307 am_cv_langinfo_codeset=yes,
308 am_cv_langinfo_codeset=no)
310 if test $am_cv_langinfo_codeset = yes; then
311 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
312 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
320 AC_MSG_CHECKING(for getloadavg)
322 [#include <stdlib.h>],
323 [double v[3]; getloadavg(v, 3);],
325 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
332 AC_CHECK_FUNCS(popen)
338 CFLAGS="$CFLAGS -Wall -W"