1 AC_INIT([Conky],[1.3.1],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3.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])
115 [ --enable-cairo enable if you want Cairo support [default=no]],
116 [want_cairo="$enableval"])
118 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo = xyes)
121 if test "$want_cairo" = "yes"; then
122 AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
123 if test "x$CAIRO_MISSING" = xyes; then
124 AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
126 AC_PATH_PROG(CAIROCONFIG, pkg-config)
127 if test x$CAIROCONFIG != x; then
128 dnl TODO: needs more checks
130 AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
131 CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
132 CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
144 AC_ARG_ENABLE(mldonkey,
145 [ --enable-mldonkey enable if you want MLDonkey support [default=no]],
146 [want_mldonkey="$enableval"])
148 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
149 if test x$want_mldonkey = xyes; then
150 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
164 AC_ARG_ENABLE(double_buffer,
165 [ --enable-double-buffer enable if you want to support flicker-free operation [default=yes]],
170 [ --enable-x11 enable if you want X11 support [default=yes]],
171 [want_x11="$enableval"])
174 if test "x$want_x11" = "xyes"; then
177 CFLAGS="$CFLAGS $X_CFLAGS"
178 LIBS="$LIBS $X_LIBS $X11_LIBS"
179 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
180 if test "x$X_DISPLAY_MISSING" = xyes; then
181 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])
183 AC_DEFINE(X11, 1, [Define if you want to use X11])
184 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
185 AM_CONDITIONAL(BUILD_X11, true)
186 if test $dah != "no"; then
187 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
188 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
189 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
192 AM_CONDITIONAL(BUILD_X11, false)
199 if test x$want_xft && test x$want_x11; then
200 AC_PATH_PROG(XFTCONFIG, xft-config)
201 if test x$XFTCONFIG != x; then
202 dnl TODO: needs more checks
204 dnl This won't work for some reason
205 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
206 if test "x$XFT_MISSING" = xyes; then
207 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
210 AC_DEFINE(XFT, 1, [Define if you are using Xft])
211 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
212 XFT_LIBS=`$XFTCONFIG --libs`
222 if test x$WANT_KVM = xyes; then
223 AC_CHECK_LIB(kvm, kvm_open,
225 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
233 if test x$WANT_DEVSTAT = xyes; then
234 AC_CHECK_LIB(devstat, devstat_getversion,
235 LIBS="$LIBS -ldevstat",
236 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
241 dnl OSSLIB for NetBSD
244 if test x$WANT_OSSLIB = xyes; then
245 AC_CHECK_LIB(ossaudio, _oss_ioctl,
246 LIBS="$LIBS -lossaudio",
247 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
252 dnl Some random headers
256 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
257 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
258 AC_CHECK_HEADERS([sys/mount.h], [], [],
259 [#ifdef HAVE_SYS_PARAM_H
260 #include <sys/param.h>
269 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
270 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
271 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
272 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
273 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
275 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
282 if test x$WANT_SYSINFO = xyes; then
284 AC_MSG_CHECKING(for sysinfo)
286 [#include <sys/types.h>
287 #include <sys/sysinfo.h>],
288 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
289 [AC_MSG_RESULT(yes); dah=yes],
290 [AC_MSG_RESULT(not usable); dah=no])
292 if test x$dah = xyes; then
293 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
301 if test x$WANT_KSTAT = xyes; then
303 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
305 if test x$dah = xyes; then
306 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
307 LDFLAGS="$LDFLAGS -lkstat"
311 AC_DEFUN([AM_LANGINFO_CODESET],
313 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
314 [AC_TRY_LINK([#include <langinfo.h>],
315 [char* cs = nl_langinfo(CODESET);],
316 am_cv_langinfo_codeset=yes,
317 am_cv_langinfo_codeset=no)
319 if test $am_cv_langinfo_codeset = yes; then
320 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
321 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
329 AC_MSG_CHECKING(for getloadavg)
331 [#include <stdlib.h>],
332 [double v[3]; getloadavg(v, 3);],
334 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
341 AC_CHECK_FUNCS(popen)
347 CFLAGS="$CFLAGS -Wall -W"