1 AC_INIT([Conky],[1.3.0],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3.0)
4 AM_CONFIG_HEADER(src/config.h)
27 # Solaris doesn't work at all right now
34 echo "Your operating system $uname isn't supported"
35 echo "Feel free to help. :P"
40 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
41 AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
42 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
43 AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
51 [ --enable-xft enable if you want to use Xft [default=no]],
52 [want_xft="$enableval"])
59 AC_ARG_ENABLE(own_window,
60 [ --enable-own-window enable if you want support for creating own window [default=yes]],
63 if test $dah != "no"; then
64 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
68 dnl PROC_UPTIME option
72 AC_ARG_ENABLE(proc_uptime,
73 [ --enable-proc-uptime enable using /proc/uptime for uptime [default=no]],
76 if test $dah = "yes"; then
77 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
86 [ --enable-seti enable if you want SETI at Home stats [default=no]],
87 [want_seti="$enableval"])
89 AM_CONDITIONAL(BUILD_SETI, test x$want_seti == xyes)
90 if test x$want_seti == xyes; then
91 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
100 [ --enable-mpd enable if you want MPD support [default=no]],
101 [want_mpd="$enableval"])
103 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd == xyes)
104 if test x$want_mpd == xyes; then
105 AC_DEFINE(MPD, 1, [Define if you want MPD support])
114 [ --enable-cairo enable if you want Cairo support [default=no]],
115 [want_cairo="$enableval"])
117 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo == xyes)
120 if test "$want_cairo" = "yes"; then
121 AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
122 if test "x$CAIRO_MISSING" = xyes; then
123 AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
125 AC_PATH_PROG(CAIROCONFIG, pkg-config)
126 if test x$CAIROCONFIG != x; then
127 dnl TODO: needs more checks
129 AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
130 CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
131 CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
143 AC_ARG_ENABLE(mldonkey,
144 [ --enable-mldonkey enable if you want MLDonkey support [default=no]],
145 [want_mldonkey="$enableval"])
147 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey == xyes)
148 if test x$want_mldonkey == xyes; then
149 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
163 AC_ARG_ENABLE(double_buffer,
164 [ --enable-double-buffer enable if you want to support flicker-free operation [default=yes]],
169 [ --enable-x11 enable if you want X11 support [default=yes]],
170 [want_x11="$enableval"])
173 AM_CONDITIONAL(BUILD_X11, test x$want_x11)
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 if test $dah != "no"; then
186 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
187 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
188 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
191 AM_CONDITIONAL(HAVE_X11, test x$want_x11)
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.])
230 dnl OSSLIB for NetBSD
233 if test x$WANT_OSSLIB = xyes; then
234 AC_CHECK_LIB(ossaudio, _oss_ioctl,
235 LIBS="$LIBS -lossaudio",
236 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
241 dnl Some random headers
245 AC_CHECK_HEADERS([signal.h unistd.h X11/Xlib.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
246 AC_CHECK_HEADERS([sys/statfs.h sys/param.h sys/mount.h])
253 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
254 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
255 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
256 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
257 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
259 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
266 if test x$WANT_SYSINFO = xyes; then
268 AC_MSG_CHECKING(for sysinfo)
270 [#include <sys/types.h>
271 #include <sys/sysinfo.h>],
272 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
273 [AC_MSG_RESULT(yes); dah=yes],
274 [AC_MSG_RESULT(not usable); dah=no])
276 if test x$dah = xyes; then
277 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
285 if test x$WANT_KSTAT = xyes; then
287 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
289 if test x$dah = xyes; then
290 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
291 LDFLAGS="$LDFLAGS -lkstat"
295 AC_DEFUN([AM_LANGINFO_CODESET],
297 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
298 [AC_TRY_LINK([#include <langinfo.h>],
299 [char* cs = nl_langinfo(CODESET);],
300 am_cv_langinfo_codeset=yes,
301 am_cv_langinfo_codeset=no)
303 if test $am_cv_langinfo_codeset = yes; then
304 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
305 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
313 AC_MSG_CHECKING(for getloadavg)
315 [#include <stdlib.h>],
316 [double v[3]; getloadavg(v, 3);],
318 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
325 AC_CHECK_FUNCS(popen)
331 CFLAGS="$CFLAGS -Wall -W"