1 AC_INIT([Conky],[1.3.3],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3.3)
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])
133 [ --enable-cairo enable if you want Cairo support [[default=no]]],
134 [want_cairo="$enableval"])
136 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo = xyes)
139 if test "$want_cairo" = "yes"; then
140 AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
141 if test "x$CAIRO_MISSING" = xyes; then
142 AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
144 AC_PATH_PROG(CAIROCONFIG, pkg-config)
145 if test x$CAIROCONFIG != x; then
146 dnl TODO: needs more checks
148 AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
149 CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
150 CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
162 AC_ARG_ENABLE(mldonkey,
163 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
164 [want_mldonkey="$enableval"])
166 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
167 if test x$want_mldonkey = xyes; then
168 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
182 AC_ARG_ENABLE(double_buffer,
183 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
188 [ --enable-x11 enable if you want X11 support [[default=yes]]],
189 [want_x11="$enableval"])
192 if test "x$want_x11" = "xyes"; then
195 CFLAGS="$CFLAGS $X_CFLAGS"
196 LIBS="$LIBS $X_LIBS $X11_LIBS"
197 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
198 if test "x$X_DISPLAY_MISSING" = xyes; then
199 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])
201 AC_DEFINE(X11, 1, [Define if you want to use X11])
202 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
203 AM_CONDITIONAL(BUILD_X11, true)
204 if test $dah != "no"; then
205 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
206 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
207 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
210 AM_CONDITIONAL(BUILD_X11, false)
217 if test x$want_xft && test x$want_x11; then
218 AC_PATH_PROG(XFTCONFIG, xft-config)
219 if test x$XFTCONFIG != x; then
220 dnl TODO: needs more checks
222 dnl This won't work for some reason
223 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
224 if test "x$XFT_MISSING" = xyes; then
225 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
228 AC_DEFINE(XFT, 1, [Define if you are using Xft])
229 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
230 XFT_LIBS=`$XFTCONFIG --libs`
240 if test x$WANT_KVM = xyes; then
241 AC_CHECK_LIB(kvm, kvm_open,
243 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
251 if test x$WANT_DEVSTAT = xyes; then
252 AC_CHECK_LIB(devstat, devstat_getversion,
253 LIBS="$LIBS -ldevstat",
254 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
259 dnl OSSLIB for NetBSD
262 if test x$WANT_OSSLIB = xyes; then
263 AC_CHECK_LIB(ossaudio, _oss_ioctl,
264 LIBS="$LIBS -lossaudio",
265 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
270 dnl Some random headers
274 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
275 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
276 AC_CHECK_HEADERS([sys/mount.h], [], [],
277 [#ifdef HAVE_SYS_PARAM_H
278 #include <sys/param.h>
287 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
288 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
289 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
290 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
291 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
293 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
300 if test x$WANT_SYSINFO = xyes; then
302 AC_MSG_CHECKING(for sysinfo)
304 [#include <sys/types.h>
305 #include <sys/sysinfo.h>],
306 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
307 [AC_MSG_RESULT(yes); dah=yes],
308 [AC_MSG_RESULT(not usable); dah=no])
310 if test x$dah = xyes; then
311 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
319 if test x$WANT_KSTAT = xyes; then
321 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
323 if test x$dah = xyes; then
324 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
325 LDFLAGS="$LDFLAGS -lkstat"
329 AC_DEFUN([AM_LANGINFO_CODESET],
331 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
332 [AC_TRY_LINK([#include <langinfo.h>],
333 [char* cs = nl_langinfo(CODESET);],
334 am_cv_langinfo_codeset=yes,
335 am_cv_langinfo_codeset=no)
337 if test $am_cv_langinfo_codeset = yes; then
338 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
339 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
347 AC_MSG_CHECKING(for getloadavg)
349 [#include <stdlib.h>],
350 [double v[3]; getloadavg(v, 3);],
352 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
359 AC_CHECK_FUNCS(popen)
365 CFLAGS="$CFLAGS -Wall -W"