1 AC_INIT([Conky],[1.3.6_CVS_20060107],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3.6_CVS_20060107)
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)
46 PKG_PROG_PKG_CONFIG([0.17.2])
54 [ --enable-xft enable if you want to use Xft [[default=yes]]],
55 [want_xft="$enableval"])
62 AC_ARG_ENABLE(own_window,
63 [ --enable-own-window enable if you want support for creating own window [[default=yes]]],
66 if test $dah != "no"; then
67 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
71 dnl PROC_UPTIME option
75 AC_ARG_ENABLE(proc_uptime,
76 [ --enable-proc-uptime enable using /proc/uptime for uptime [[default=yes]]],
79 if test $dah = "yes"; then
80 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
88 AC_ARG_ENABLE(xmms-support,
89 [ --enable-xmms-support[[=project]]
90 Specify the XMMS-related Project:
91 none: none [[default]]
92 xmms: XMMS (version 1) Support
93 bmp: Beep Media Player (not BMPx) Support
94 audacious: Audacious (version >= 0.1) Media Player Support
95 infopipe: XMMS/BMP InfoPipe (version 1.3) Plugin Support ],
96 [xmms_support="$enableval"])
98 case x$xmms_support in
102 AC_DEFINE(XMMS, 1, [Define for XMMS support])
103 echo "Sorry, xmms isn't supported yet"
107 PKG_CHECK_MODULES([BMP], [bmp], [])
108 CFLAGS="$CFLAGS $BMP_CFLAGS"
109 LIBS="$LIBS $BMP_LIBS"
110 AC_DEFINE(BMP, 1, [Define for BMP support])
113 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1])
114 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
115 LIBS="$LIBS $AUDACIOUS_LIBS"
116 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
119 AC_DEFINE(INFOPIPE, 1, [Define for XMMS/BMP InfoPipe support])
122 echo "Error: invalid xmms-status specified: $xmms_support"
126 AM_CONDITIONAL(BUILD_XMMS, test x$xmms_support = xxmms)
127 AM_CONDITIONAL(BUILD_BMP, test x$xmms_support = xbmp)
128 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$xmms_support = xaudacious)
129 AM_CONDITIONAL(BUILD_INFOPIPE, test x$xmms_support = xinfopipe)
137 [ --enable-bmpx enable if you want BMPx support [[default=no]]],
138 [want_bmpx="$enableval"])
140 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
141 if test x$want_bmpx = xyes; then
142 PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.35 dbus-glib-1 >= 0.35])
143 CFLAGS="$CFLAGS $DBUS_CFLAGS"
144 LIBS="$LIBS $DBUS_LIBS"
145 AC_CHECK_HEADERS([bmpx/dbus.h], [], [BMPX_MISSING=yes])
146 if test "x$BMPX_MISSING" = xyes; then
147 AC_MSG_ERROR([bmpx doesn't seem to be installed, or the headers aren't available])
149 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
158 [ --enable-seti enable if you want SETI at Home stats [[default=yes]]],
159 [want_seti="$enableval"])
161 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
162 if test x$want_seti = xyes; then
163 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
172 [ --enable-mpd enable if you want MPD support [[default=yes]]],
173 [want_mpd="$enableval"])
175 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
176 if test x$want_mpd = xyes; then
177 AC_DEFINE(MPD, 1, [Define if you want MPD support])
185 AC_ARG_ENABLE(portmon,
186 [ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=yes]]],
187 [want_portmon="$enableval"])
189 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
190 if test x$want_portmon = xyes; then
191 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
192 if test "x$PORT_MONITORS_MISSING" = xyes; then
193 AC_MSG_ERROR([missing a needed network header for port monitoring])
195 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
207 AC_ARG_ENABLE(mldonkey,
208 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
209 [want_mldonkey="$enableval"])
211 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
212 if test x$want_mldonkey = xyes; then
213 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
227 AC_ARG_ENABLE(double_buffer,
228 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
233 [ --enable-x11 enable if you want X11 support [[default=yes]]],
234 [want_x11="$enableval"])
237 if test "x$want_x11" = "xyes"; then
240 CFLAGS="$CFLAGS $X_CFLAGS"
241 LIBS="$LIBS $X_LIBS $X11_LIBS"
242 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
243 if test "x$X_DISPLAY_MISSING" = xyes; then
244 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])
246 AC_DEFINE(X11, 1, [Define if you want to use X11])
247 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
248 AM_CONDITIONAL(BUILD_X11, true)
249 if test $dah != "no"; then
250 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
251 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
252 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
255 AM_CONDITIONAL(BUILD_X11, false)
262 if test x$want_xft && test x$want_x11; then
263 AC_PATH_PROG(XFTCONFIG, xft-config)
264 if test x$XFTCONFIG != x; then
265 dnl TODO: needs more checks
267 dnl This won't work for some reason
268 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
269 if test "x$XFT_MISSING" = xyes; then
270 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
273 AC_DEFINE(XFT, 1, [Define if you are using Xft])
274 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
275 XFT_LIBS=`$XFTCONFIG --libs`
285 if test x$WANT_KVM = xyes; then
286 AC_CHECK_LIB(kvm, kvm_open,
288 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
296 if test x$WANT_DEVSTAT = xyes; then
297 AC_CHECK_LIB(devstat, devstat_getversion,
298 LIBS="$LIBS -ldevstat",
299 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
304 dnl OSSLIB for NetBSD
307 if test x$WANT_OSSLIB = xyes; then
308 AC_CHECK_LIB(ossaudio, _oss_ioctl,
309 LIBS="$LIBS -lossaudio",
310 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
315 dnl Some random headers
319 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
320 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
321 AC_CHECK_HEADERS([sys/mount.h], [], [],
322 [#ifdef HAVE_SYS_PARAM_H
323 #include <sys/param.h>
331 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
332 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
333 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
334 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
335 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
337 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
344 if test x$WANT_SYSINFO = xyes; then
346 AC_MSG_CHECKING(for sysinfo)
348 [#include <sys/types.h>
349 #include <sys/sysinfo.h>],
350 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
351 [AC_MSG_RESULT(yes); dah=yes],
352 [AC_MSG_RESULT(not usable); dah=no])
354 if test x$dah = xyes; then
355 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
363 if test x$WANT_KSTAT = xyes; then
365 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
367 if test x$dah = xyes; then
368 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
369 LDFLAGS="$LDFLAGS -lkstat"
373 AC_DEFUN([AM_LANGINFO_CODESET],
375 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
376 [AC_TRY_LINK([#include <langinfo.h>],
377 [char* cs = nl_langinfo(CODESET);],
378 am_cv_langinfo_codeset=yes,
379 am_cv_langinfo_codeset=no)
381 if test $am_cv_langinfo_codeset = yes; then
382 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
383 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
391 AC_MSG_CHECKING(for getloadavg)
393 [#include <stdlib.h>],
394 [double v[3]; getloadavg(v, 3);],
396 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
403 AC_CHECK_FUNCS(popen)
409 CFLAGS="$CFLAGS -Wall -W"