1 AC_INIT([Conky],[1.4.2],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.4.2)
4 AM_CONFIG_HEADER(src/config.h)
11 PKG_PROG_PKG_CONFIG([0.17.2])
41 # Solaris doesn't work at all right now
47 echo "Your operating system $uname isn't supported"
48 echo "Feel free to help. :P"
53 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
54 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
55 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
56 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
57 # AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
59 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
60 BUILD_ARCH="$(uname -sr) ($(uname -m))"
70 [ --enable-xft enable if you want to use Xft [[default=yes]]],
71 [want_xft="$enableval"])
78 AC_ARG_ENABLE(own_window,
79 [ --enable-own-window enable if you want support for creating own window [[default=yes]]],
82 if test $dah != "no"; then
83 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
87 dnl PROC_UPTIME option
91 AC_ARG_ENABLE(proc_uptime,
92 [ --enable-proc-uptime enable using /proc/uptime for uptime [[default=yes]]],
95 if test $dah = "yes"; then
96 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
105 [ --enable-xmms enable xmms (ver. 1) media player support [[default=auto]]],
106 [want_xmms="$enableval"])
111 ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
112 PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2], [], [want_xmms=no])])
114 if test x$want_xmms = xyes; then
115 AC_CHECK_HEADERS([dlfcn.h], [], [want_xmms=no])
116 if test x$want_xmms = xyes; then
117 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
118 [AC_CHECK_FUNCS(dlopen,[],
120 if test x$want_xmms = xyes; then
121 CFLAGS="$CFLAGS $XMMS_CFLAGS"
122 ### if we link to glib 1.2, that means 2.0 wasn't found ###
123 ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
124 LIBS="$LIBS $XMMS_LIBS"
125 AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
131 ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
132 PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2])])
133 CFLAGS="$CFLAGS $XMMS_CFLAGS"
134 ### if we link to glib 1.2, that means 2.0 wasn't found ###
135 ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
136 LIBS="$LIBS $XMMS_LIBS"
137 AC_CHECK_HEADERS([dlfcn.h], [],
138 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
139 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
140 [AC_CHECK_FUNCS(dlopen,[],
141 [AC_MSG_ERROR([dlopen() not available])])])
142 AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
147 echo "Error: invalid xmms parameter specified: $want_xmms"
151 AM_CONDITIONAL(BUILD_XMMS, test x$want_xmms = xyes)
154 dnl BMP (through 0.9.7.1)
159 [ --enable-bmp enable beep media media player support [[default=auto]]],
160 [want_bmp="$enableval"])
165 PKG_CHECK_MODULES([BMP], [glib-2.0], [], [want_bmp=no])
166 if test x$want_bmp = xyes; then
167 AC_CHECK_HEADERS([dlfcn.h], [], [want_bmp=no])
168 if test x$want_bmp = xyes; then
169 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
170 [AC_CHECK_FUNCS(dlopen,[],
172 if test x$want_bmp = xyes; then
173 CFLAGS="$CFLAGS $BMP_CFLAGS"
174 LIBS="$LIBS $BMP_LIBS"
175 AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
181 PKG_CHECK_MODULES([BMP], [glib-2.0 >= 2.0])
182 CFLAGS="$CFLAGS $BMP_CFLAGS"
183 LIBS="$LIBS $BMP_LIBS"
184 AC_CHECK_HEADERS([dlfcn.h], [],
185 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
186 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
187 [AC_CHECK_FUNCS(dlopen,[],
188 [AC_MSG_ERROR([dlopen() not available])])])
189 AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
194 echo "Error: invalid bmp parameter specified: $want_bmp"
198 AM_CONDITIONAL(BUILD_BMP, test x$want_bmp = xyes)
201 dnl Audacious Media Player
205 AC_ARG_ENABLE(audacious,
206 [ --enable-audacious enable audacious player support [[default=auto]]],
207 [want_audacious="$enableval"])
209 case x$want_audacious in
212 PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0], [], [want_audacious=no])
213 if test x$want_audacious = xyes; then
214 AC_CHECK_HEADERS([dlfcn.h], [], [want_audacious=no])
215 if test x$want_audacious = xyes; then
216 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
217 [AC_CHECK_FUNCS(dlopen,[],
218 [want_audacious=no])])
219 if test x$want_audacious = xyes; then
220 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
221 LIBS="$LIBS $AUDACIOUS_LIBS"
222 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
228 PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0])
229 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
230 LIBS="$LIBS $AUDACIOUS_LIBS"
231 AC_CHECK_HEADERS([dlfcn.h], [],
232 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
233 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
234 [AC_CHECK_FUNCS(dlopen,[],
235 [AC_MSG_ERROR([dlopen() not available])])])
236 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
241 echo "Error: invalid audacious parameter specified: $want_audacious"
245 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
248 dnl InfoPipe (Version 1.3)
252 AC_ARG_ENABLE(infopipe,
253 [ --enable-infopipe enable xmms/bmp infopipe support [[default=yes]]],
254 [want_infopipe="$enableval"])
256 case x$want_infopipe in
258 AC_DEFINE(INFOPIPE, 1, [Define for InfoPipe support])
263 echo "Error: invalid infopipe parameter specified: $want_infopipe"
267 AM_CONDITIONAL(BUILD_INFOPIPE, test x$want_infopipe = xyes)
275 [ --enable-bmpx enable if you want BMPx support [[default=no]]],
276 [want_bmpx="$enableval"])
278 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
279 if test x$want_bmpx = xyes; then
280 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
281 CFLAGS="$CFLAGS $BMPX_CFLAGS"
282 LIBS="$LIBS $BMPX_LIBS"
283 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
292 [ --enable-seti enable if you want SETI at Home stats [[default=yes]]],
293 [want_seti="$enableval"])
295 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
296 if test x$want_seti = xyes; then
297 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
305 AC_ARG_ENABLE(hddtemp,
306 [ --enable-hddtemp enable if you want hddtemp support [[default=yes]]],
307 [want_hddtemp="$enableval"])
309 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
310 if test x$want_hddtemp = xyes; then
311 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
320 [ --enable-mpd enable if you want MPD support [[default=yes]]],
321 [want_mpd="$enableval"])
323 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
324 if test x$want_mpd = xyes; then
325 AC_DEFINE(MPD, 1, [Define if you want MPD support])
334 [ --enable-xmms2 enable if you want XMMS2 support [[default=no]]],
335 [want_xmms2="$enableval"])
337 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
338 if test x$want_xmms2 = xyes; then
339 CFLAGS="$CFLAGS `pkg-config --cflags xmms2-client`"
340 LIBS="$LIBS `pkg-config --libs xmms2-client`"
341 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
349 AC_ARG_ENABLE(imlib2,
350 [ --enable-imlib2 enable if you want Imlib2 support [[default=no]]],
351 [want_imlib2="$enableval"])
353 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
354 if test x$want_imlib2 = xyes; then
355 PKG_CHECK_MODULES([Imlib2], [imlib2])
356 CFLAGS="$CFLAGS $Imlib2_CFLAGS"
357 LIBS="$LIBS $Imlib2_LIBS"
358 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
366 AC_ARG_ENABLE(portmon,
367 [ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=yes]]],
368 [want_portmon="$enableval"])
370 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
371 if test x$want_portmon = xyes; then
372 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
373 if test "x$PORT_MONITORS_MISSING" = xyes; then
374 AC_MSG_ERROR([missing a needed network header for port monitoring])
376 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
388 AC_ARG_ENABLE(mldonkey,
389 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
390 [want_mldonkey="$enableval"])
392 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
393 if test x$want_mldonkey = xyes; then
394 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
402 if test "$am_cv_func_iconv" != yes; then
403 AC_MSG_WARN([Could not find libiconv])
405 LIBS="$LIBS $LIBICONV"
414 AC_ARG_ENABLE(double_buffer,
415 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
419 AC_ARG_ENABLE(xdamage,
420 [ --enable-xdamage enable if you want Xdamage support [[default=yes]]],
421 [want_xdamage="$enableval"])
425 [ --enable-x11 enable if you want X11 support [[default=yes]]],
426 [want_x11="$enableval"])
429 if test "x$want_x11" = "xyes"; then
432 CFLAGS="$CFLAGS $X_CFLAGS"
433 LIBS="$LIBS $X_LIBS $X11_LIBS"
434 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
435 if test "x$X_DISPLAY_MISSING" = xyes; then
436 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])
438 AC_DEFINE(X11, 1, [Define if you want to use X11])
439 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
440 AM_CONDITIONAL(BUILD_X11, true)
441 if test "x$dah" != xno; then
442 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
443 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
444 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
447 if test "x$want_xdamage" = "xyes"; then
448 AC_DEFINE(XDAMAGE, 1, [Define if you want support for the Xdamage extension])
449 AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
450 [AC_DEFINE([HAVE_XDAMAGE], 1, [Xdamage]) LIBS="$LIBS -lXdamage"],
451 [AC_MSG_ERROR([something went wrong when checking for Xdamage])])
454 AM_CONDITIONAL(BUILD_X11, false)
461 if test x$want_xft && test x$want_x11; then
462 PKG_CHECK_MODULES(XFT, [xft],
464 AC_DEFINE(XFT, 1, [Define if you are using Xft])
465 CFLAGS="$CFLAGS $XFT_CFLAGS"
475 if test x$WANT_KVM = xyes; then
476 AC_CHECK_LIB(kvm, kvm_open,
478 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
486 if test x$WANT_DEVSTAT = xyes; then
487 AC_CHECK_LIB(devstat, devstat_getversion,
488 LIBS="$LIBS -ldevstat",
489 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
494 dnl OSSLIB for NetBSD/OpenBSD
497 if test x$WANT_OSSLIB = xyes; then
498 AC_CHECK_LIB(ossaudio, _oss_ioctl,
499 LIBS="$LIBS -lossaudio",
500 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
505 dnl Some random headers
509 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
510 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
511 AC_CHECK_HEADERS([sys/mount.h], [], [],
512 [#ifdef HAVE_SYS_PARAM_H
513 #include <sys/param.h>
521 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
522 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
523 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
524 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
525 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
527 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
534 if test x$WANT_SYSINFO = xyes; then
536 AC_MSG_CHECKING(for sysinfo)
538 [#include <sys/types.h>
539 #include <sys/sysinfo.h>],
540 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
541 [AC_MSG_RESULT(yes); dah=yes],
542 [AC_MSG_RESULT(not usable); dah=no])
544 if test x$dah = xyes; then
545 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
553 if test x$WANT_KSTAT = xyes; then
555 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
557 if test x$dah = xyes; then
558 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
559 LDFLAGS="$LDFLAGS -lkstat"
563 AC_DEFUN([AM_LANGINFO_CODESET],
565 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
566 [AC_TRY_LINK([#include <langinfo.h>],
567 [char* cs = nl_langinfo(CODESET);],
568 am_cv_langinfo_codeset=yes,
569 am_cv_langinfo_codeset=no)
571 if test $am_cv_langinfo_codeset = yes; then
572 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
573 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
581 AC_MSG_CHECKING(for getloadavg)
583 [#include <stdlib.h>],
584 [double v[3]; getloadavg(v, 3);],
586 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
593 AC_CHECK_FUNCS(popen)
599 CFLAGS="$CFLAGS -Wall -W"
611 $PACKAGE $VERSION configured successfully:
613 Installing into: $prefix
616 x11 support: $want_x11
617 xft support: $want_xft
618 xdamage extension: $want_xdamage
623 audacious: $want_audacious
624 infopipe: $want_infopipe
630 portmon: $want_portmon
631 mldonkey: $want_mldonkey
632 hddtemp: $want_hddtemp