3 AM_INIT_AUTOMAKE(conky, 1.3)
4 AM_CONFIG_HEADER(config.h)
19 # Solaris doesn't work at all right now
26 echo "Your operating system $uname isn't supported"
27 echo "Feel free to help. :P"
32 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
33 AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
34 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
35 AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
43 [ --enable-xft enable if you want to use Xft [default=no]],
44 [want_xft="$enableval"])
51 AC_ARG_ENABLE(own_window,
52 [ --enable-own-window enable if you want support for creating own window [default=yes]],
55 if test $dah != "no"; then
56 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
60 dnl DOUBLE_BUFFER option
64 AC_ARG_ENABLE(double_buffer,
65 [ --enable-double-buffer enable if you want to support flicker-free operation [default=yes]],
68 if test $dah != "no"; then
69 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
70 AC_CHECK_HEADERS([X11/extensions/Xdbe.h], [AC_DEFINE([HAVE_XDBE], 1, [Xdbe])], [XDBE_MISSING=yes])
71 if test "x$XDBE_MISSING" = xyes; then
72 AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension])
77 dnl PROC_UPTIME option
81 AC_ARG_ENABLE(proc_uptime,
82 [ --enable-proc-uptime enable using /proc/uptime for uptime [default=no]],
85 if test $dah = "yes"; then
86 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
95 [ --enable-seti enable if you want SETI at Home stats [default=no]],
96 [want_seti="$enableval"])
98 AM_CONDITIONAL(BUILD_SETI, test x$want_seti == xyes)
99 if test x$want_seti == xyes; then
100 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
109 [ --enable-mpd enable if you want MPD support [default=no]],
110 [want_mpd="$enableval"])
112 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd == xyes)
113 if test x$want_mpd == xyes; then
114 AC_DEFINE(MPD, 1, [Define if you want MPD support])
123 [ --enable-cairo enable if you want Cairo support [default=no]],
124 [want_cairo="$enableval"])
126 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo == xyes)
129 if test "$want_cairo" = "yes"; then
130 AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
131 if test "x$CAIRO_MISSING" = xyes; then
132 AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
134 AC_PATH_PROG(CAIROCONFIG, pkg-config)
135 if test x$CAIROCONFIG != x; then
136 dnl TODO: needs more checks
138 AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
139 CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
140 CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
151 [ --enable-metar enable if you want metar stats (weather information) [default=no]],
152 [want_metar="$enableval"])
154 AM_CONDITIONAL(BUILD_METAR, test x$want_metar == xyes)
155 if test x$want_metar == xyes; then
156 AC_CHECK_HEADERS([metar.h], [], [METAR_MISSING=yes])
157 if test "x$METAR_MISSING" = xyes; then
158 AC_MSG_ERROR([something went wrong when checking for mdsplib, you're probably missing headers or it's not installed])
160 AC_DEFINE(METAR, 1, [Define if you want metar stats (weather information)])
171 AC_ARG_ENABLE(mldonkey,
172 [ --enable-mldonkey enable if you want MLDonkey support [default=no]],
173 [want_mldonkey="$enableval"])
175 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey == xyes)
176 if test x$want_mldonkey == xyes; then
177 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
192 [ --enable-x11 enable if you want X11 support [default=yes]],
193 [want_x11="$enableval"])
196 AM_CONDITIONAL(BUILD_X11, test x$want_x11 == xyes)
197 if test x$want_x11 == xyes; then
198 AC_CHECK_HEADERS([X11/Xlib.h], [], [X11_MISSING=yes])
199 AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
200 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
201 X11_LIBS="$X11_LIBS -lXext"
202 AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
203 ], [], [[-L$x_libraries $X11_LIBS]])
204 if test "x$X11_MISSING" = xyes; then
205 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])
207 AC_DEFINE(X11, 1, [Define if you want to use X11])
208 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
210 dnl AC_PATH_X if test $have_x != "yes"; then
211 dnl echo "Sorry, X is very much needed"
214 dnl AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
216 AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
217 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
218 X11_LIBS="$X11_LIBS -lXext"
219 AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
220 ], [], [[-L$x_libraries $X11_LIBS]])
222 if test "$x_libraries" != ""; then
223 LDFLAGS="$LDFLAGS -L$x_libraries"
226 if test "$x_includes" != ""; then
227 CFLAGS="$CFLAGS -Wall -I$x_includes"
234 if test "$want_xft" = "yes"; then
235 AC_PATH_PROG(XFTCONFIG, xft-config)
236 if test x$XFTCONFIG != x; then
237 dnl TODO: needs more checks
239 dnl This won't work for some reason
240 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
241 if test "x$XFT_MISSING" = xyes; then
242 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
245 AC_DEFINE(XFT, 1, [Define if you are using Xft])
246 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
247 XFT_LIBS=`$XFTCONFIG --libs`
257 if test x$WANT_KVM = xyes; then
258 AC_CHECK_LIB(kvm, kvm_open,
260 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
265 dnl OSSLIB for NetBSD
268 if test x$WANT_OSSLIB = xyes; then
269 AC_CHECK_LIB(ossaudio, _oss_ioctl,
270 LIBS="$LIBS -lossaudio",
271 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
276 dnl Some random headers
280 AC_CHECK_HEADERS([signal.h unistd.h X11/Xlib.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h])
281 AC_CHECK_HEADERS([sys/statfs.h sys/param.h sys/mount.h])
288 AC_PATH_PROG(HELP2MAN, help2man)
289 AM_CONDITIONAL(HAVE_HELP2MAN, test x$HELP2MAN != x)
295 if test x$WANT_SYSINFO = xyes; then
297 AC_MSG_CHECKING(for sysinfo)
299 [#include <sys/types.h>
300 #include <sys/sysinfo.h>],
301 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
302 [AC_MSG_RESULT(yes); dah=yes],
303 [AC_MSG_RESULT(not usable); dah=no])
305 if test x$dah = xyes; then
306 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
314 if test x$WANT_KSTAT = xyes; then
316 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
318 if test x$dah = xyes; then
319 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
320 LDFLAGS="$LDFLAGS -lkstat"
324 AC_DEFUN([AM_LANGINFO_CODESET],
326 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
327 [AC_TRY_LINK([#include <langinfo.h>],
328 [char* cs = nl_langinfo(CODESET);],
329 am_cv_langinfo_codeset=yes,
330 am_cv_langinfo_codeset=no)
332 if test $am_cv_langinfo_codeset = yes; then
333 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
334 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
342 AC_MSG_CHECKING(for getloadavg)
344 [#include <stdlib.h>],
345 [double v[3]; getloadavg(v, 3);],
347 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
354 AC_CHECK_FUNCS(popen)
360 CFLAGS="$CFLAGS -Wall -W"