1 AC_INIT([Conky],[1.3],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.3)
4 AM_CONFIG_HEADER(src/config.h)
25 # Solaris doesn't work at all right now
32 echo "Your operating system $uname isn't supported"
33 echo "Feel free to help. :P"
38 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
39 AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
40 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
41 AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
49 [ --enable-xft enable if you want to use Xft [default=no]],
50 [want_xft="$enableval"])
57 AC_ARG_ENABLE(own_window,
58 [ --enable-own-window enable if you want support for creating own window [default=yes]],
61 if test $dah != "no"; then
62 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
66 dnl DOUBLE_BUFFER option
70 AC_ARG_ENABLE(double_buffer,
71 [ --enable-double-buffer enable if you want to support flicker-free operation [default=yes]],
74 if test $dah != "no"; then
75 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
76 AC_CHECK_HEADERS([X11/extensions/Xdbe.h], [AC_DEFINE([HAVE_XDBE], 1, [Xdbe])], [XDBE_MISSING=yes])
77 if test "x$XDBE_MISSING" = xyes; then
78 AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension])
83 dnl PROC_UPTIME option
87 AC_ARG_ENABLE(proc_uptime,
88 [ --enable-proc-uptime enable using /proc/uptime for uptime [default=no]],
91 if test $dah = "yes"; then
92 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
101 [ --enable-seti enable if you want SETI at Home stats [default=no]],
102 [want_seti="$enableval"])
104 AM_CONDITIONAL(BUILD_SETI, test x$want_seti == xyes)
105 if test x$want_seti == xyes; then
106 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
115 [ --enable-mpd enable if you want MPD support [default=no]],
116 [want_mpd="$enableval"])
118 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd == xyes)
119 if test x$want_mpd == xyes; then
120 AC_DEFINE(MPD, 1, [Define if you want MPD support])
129 [ --enable-cairo enable if you want Cairo support [default=no]],
130 [want_cairo="$enableval"])
132 AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo == xyes)
135 if test "$want_cairo" = "yes"; then
136 AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
137 if test "x$CAIRO_MISSING" = xyes; then
138 AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
140 AC_PATH_PROG(CAIROCONFIG, pkg-config)
141 if test x$CAIROCONFIG != x; then
142 dnl TODO: needs more checks
144 AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
145 CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
146 CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
158 AC_ARG_ENABLE(mldonkey,
159 [ --enable-mldonkey enable if you want MLDonkey support [default=no]],
160 [want_mldonkey="$enableval"])
162 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey == xyes)
163 if test x$want_mldonkey == xyes; then
164 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
179 [ --enable-x11 enable if you want X11 support [default=yes]],
180 [want_x11="$enableval"])
183 AM_CONDITIONAL(BUILD_X11, test x$want_x11 == xyes)
184 if test x$want_x11 == xyes; then
186 AC_CHECK_HEADERS([X11/Xlib.h], [], [X11_MISSING=yes])
187 AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
188 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
189 X11_LIBS="$X11_LIBS -lXext"
190 AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
191 ], [], [[-L$x_libraries $X11_LIBS]])
192 if test "x$X11_MISSING" = xyes; then
193 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])
195 AC_DEFINE(X11, 1, [Define if you want to use X11])
196 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
198 dnl AC_PATH_X if test $have_x != "yes"; then
199 dnl echo "Sorry, X is very much needed"
202 dnl AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
204 AC_CHECK_LIB([X11], [XOpenDisplay], [X11_LIBS="-lX11"], [], [[-L$x_libraries]])
205 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [
206 X11_LIBS="$X11_LIBS -lXext"
207 AC_DEFINE(HAVE_LIBXEXT, 1, [Define if you have libXext])
208 ], [], [[-L$x_libraries $X11_LIBS]])
210 if test "$x_libraries" != ""; then
211 LDFLAGS="$LDFLAGS -L$x_libraries"
214 if test "$x_includes" != ""; then
215 CFLAGS="$CFLAGS -Wall -I$x_includes"
222 if test "$want_xft" = "yes"; then
223 AC_PATH_PROG(XFTCONFIG, xft-config)
224 if test x$XFTCONFIG != x; then
225 dnl TODO: needs more checks
227 dnl This won't work for some reason
228 dnl AC_CHECK_HEADERS([X11/Xft/Xft.h], [], [XFT_MISSING=yes])
229 if test "x$XFT_MISSING" = xyes; then
230 AC_MSG_ERROR([something went wrong when checking for Xft, you're probably missing headers or it's not installed])
233 AC_DEFINE(XFT, 1, [Define if you are using Xft])
234 CFLAGS="$CFLAGS `$XFTCONFIG --cflags`"
235 XFT_LIBS=`$XFTCONFIG --libs`
245 if test x$WANT_KVM = xyes; then
246 AC_CHECK_LIB(kvm, kvm_open,
248 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
253 dnl OSSLIB for NetBSD
256 if test x$WANT_OSSLIB = xyes; then
257 AC_CHECK_LIB(ossaudio, _oss_ioctl,
258 LIBS="$LIBS -lossaudio",
259 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
264 dnl Some random headers
268 AC_CHECK_HEADERS([signal.h unistd.h X11/Xlib.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h])
269 AC_CHECK_HEADERS([sys/statfs.h sys/param.h sys/mount.h])
276 AC_PATH_PROG(DB2X_XSLPROC, db2x_xsltproc)
277 AC_PATH_PROG(DB2X_MANXML, db2x_manxml)
278 AC_PATH_PROG(XSLPROC, xsltproc)
279 AM_CONDITIONAL(HAVE_DOCSTUFF, test $DB2X_XSLPROC -a $DB2X_MANXML -a $XSLPROC)
285 if test x$WANT_SYSINFO = xyes; then
287 AC_MSG_CHECKING(for sysinfo)
289 [#include <sys/types.h>
290 #include <sys/sysinfo.h>],
291 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
292 [AC_MSG_RESULT(yes); dah=yes],
293 [AC_MSG_RESULT(not usable); dah=no])
295 if test x$dah = xyes; then
296 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
304 if test x$WANT_KSTAT = xyes; then
306 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
308 if test x$dah = xyes; then
309 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
310 LDFLAGS="$LDFLAGS -lkstat"
314 AC_DEFUN([AM_LANGINFO_CODESET],
316 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
317 [AC_TRY_LINK([#include <langinfo.h>],
318 [char* cs = nl_langinfo(CODESET);],
319 am_cv_langinfo_codeset=yes,
320 am_cv_langinfo_codeset=no)
322 if test $am_cv_langinfo_codeset = yes; then
323 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
324 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
332 AC_MSG_CHECKING(for getloadavg)
334 [#include <stdlib.h>],
335 [double v[3]; getloadavg(v, 3);],
337 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
344 AC_CHECK_FUNCS(popen)
350 CFLAGS="$CFLAGS -Wall -W"