1 AC_INIT([Conky],[1.4.3],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.4.3)
4 AM_CONFIG_HEADER(src/config.h)
9 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
10 dnl libtool must be deleted with make distclean to see this fix.
11 if test x"$CFLAGS" = x""; then
17 PKG_PROG_PKG_CONFIG([0.17.2])
47 # Solaris doesn't work at all right now
53 echo "Your operating system $uname isn't supported"
54 echo "Feel free to help. :P"
59 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
60 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
61 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
62 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
63 # AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
65 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
66 BUILD_ARCH="$(uname -sr) ($(uname -m))"
76 [ --enable-xft enable if you want to use Xft [[default=yes]]],
77 [want_xft="$enableval"])
84 AC_ARG_ENABLE(own_window,
85 [ --enable-own-window enable if you want support for creating own window [[default=yes]]],
88 if test $dah != "no"; then
89 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
93 dnl PROC_UPTIME option
97 AC_ARG_ENABLE(proc_uptime,
98 [ --enable-proc-uptime enable using /proc/uptime for uptime [[default=yes]]],
101 if test $dah = "yes"; then
102 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
111 [ --enable-xmms enable xmms (ver. 1) media player support [[default=auto]]],
112 [want_xmms="$enableval"])
117 ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
118 PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2], [], [want_xmms=no])])
120 if test x$want_xmms = xyes; then
121 AC_CHECK_HEADERS([dlfcn.h], [], [want_xmms=no])
122 if test x$want_xmms = xyes; then
123 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
124 [AC_CHECK_FUNCS(dlopen,[],
126 if test x$want_xmms = xyes; then
127 CFLAGS="$CFLAGS $XMMS_CFLAGS"
128 ### if we link to glib 1.2, that means 2.0 wasn't found ###
129 ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
130 LIBS="$LIBS $XMMS_LIBS"
131 AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
137 ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
138 PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2])])
139 CFLAGS="$CFLAGS $XMMS_CFLAGS"
140 ### if we link to glib 1.2, that means 2.0 wasn't found ###
141 ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
142 LIBS="$LIBS $XMMS_LIBS"
143 AC_CHECK_HEADERS([dlfcn.h], [],
144 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
145 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
146 [AC_CHECK_FUNCS(dlopen,[],
147 [AC_MSG_ERROR([dlopen() not available])])])
148 AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
153 echo "Error: invalid xmms parameter specified: $want_xmms"
157 AM_CONDITIONAL(BUILD_XMMS, test x$want_xmms = xyes)
160 dnl BMP (through 0.9.7.1)
165 [ --enable-bmp enable beep media media player support [[default=auto]]],
166 [want_bmp="$enableval"])
171 PKG_CHECK_MODULES([BMP], [glib-2.0], [], [want_bmp=no])
172 if test x$want_bmp = xyes; then
173 AC_CHECK_HEADERS([dlfcn.h], [], [want_bmp=no])
174 if test x$want_bmp = xyes; then
175 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
176 [AC_CHECK_FUNCS(dlopen,[],
178 if test x$want_bmp = xyes; then
179 CFLAGS="$CFLAGS $BMP_CFLAGS"
180 LIBS="$LIBS $BMP_LIBS"
181 AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
187 PKG_CHECK_MODULES([BMP], [glib-2.0 >= 2.0])
188 CFLAGS="$CFLAGS $BMP_CFLAGS"
189 LIBS="$LIBS $BMP_LIBS"
190 AC_CHECK_HEADERS([dlfcn.h], [],
191 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
192 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
193 [AC_CHECK_FUNCS(dlopen,[],
194 [AC_MSG_ERROR([dlopen() not available])])])
195 AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
200 echo "Error: invalid bmp parameter specified: $want_bmp"
204 AM_CONDITIONAL(BUILD_BMP, test x$want_bmp = xyes)
207 dnl Audacious Media Player
211 AC_ARG_ENABLE(audacious,
212 [ --enable-audacious enable audacious player support [[default=auto]]],
213 [want_audacious="$enableval"])
215 case x$want_audacious in
218 PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0], [], [want_audacious=no])
219 if test x$want_audacious = xyes; then
220 AC_CHECK_HEADERS([dlfcn.h], [], [want_audacious=no])
221 if test x$want_audacious = xyes; then
222 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
223 [AC_CHECK_FUNCS(dlopen,[],
224 [want_audacious=no])])
225 if test x$want_audacious = xyes; then
226 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
227 LIBS="$LIBS $AUDACIOUS_LIBS"
228 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
234 PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0])
235 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
236 LIBS="$LIBS $AUDACIOUS_LIBS"
237 AC_CHECK_HEADERS([dlfcn.h], [],
238 [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
239 AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
240 [AC_CHECK_FUNCS(dlopen,[],
241 [AC_MSG_ERROR([dlopen() not available])])])
242 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
247 echo "Error: invalid audacious parameter specified: $want_audacious"
251 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
254 dnl InfoPipe (Version 1.3)
258 AC_ARG_ENABLE(infopipe,
259 [ --enable-infopipe enable xmms/bmp infopipe support [[default=yes]]],
260 [want_infopipe="$enableval"])
262 case x$want_infopipe in
264 AC_DEFINE(INFOPIPE, 1, [Define for InfoPipe support])
269 echo "Error: invalid infopipe parameter specified: $want_infopipe"
273 AM_CONDITIONAL(BUILD_INFOPIPE, test x$want_infopipe = xyes)
281 [ --enable-bmpx enable if you want BMPx support [[default=no]]],
282 [want_bmpx="$enableval"])
284 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
285 if test x$want_bmpx = xyes; then
286 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
287 CFLAGS="$CFLAGS $BMPX_CFLAGS"
288 LIBS="$LIBS $BMPX_LIBS"
289 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
298 [ --enable-seti enable if you want SETI at Home stats [[default=yes]]],
299 [want_seti="$enableval"])
301 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
302 if test x$want_seti = xyes; then
303 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
311 AC_ARG_ENABLE(hddtemp,
312 [ --enable-hddtemp enable if you want hddtemp support [[default=yes]]],
313 [want_hddtemp="$enableval"])
315 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
316 if test x$want_hddtemp = xyes; then
317 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
326 [ --enable-mpd enable if you want MPD support [[default=yes]]],
327 [want_mpd="$enableval"])
329 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
330 if test x$want_mpd = xyes; then
331 AC_DEFINE(MPD, 1, [Define if you want MPD support])
340 [ --enable-xmms2 enable if you want XMMS2 support [[default=no]]],
341 [want_xmms2="$enableval"])
343 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
344 if test x$want_xmms2 = xyes; then
345 CFLAGS="$CFLAGS `pkg-config --cflags xmms2-client`"
346 LIBS="$LIBS `pkg-config --libs xmms2-client`"
347 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
355 AC_ARG_ENABLE(imlib2,
356 [ --enable-imlib2 enable if you want Imlib2 support [[default=no]]],
357 [want_imlib2="$enableval"])
359 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
360 if test x$want_imlib2 = xyes; then
361 PKG_CHECK_MODULES([Imlib2], [imlib2])
362 CFLAGS="$CFLAGS $Imlib2_CFLAGS"
363 LIBS="$LIBS $Imlib2_LIBS"
364 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
372 AC_ARG_ENABLE(portmon,
373 [ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=yes]]],
374 [want_portmon="$enableval"])
376 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
377 if test x$want_portmon = xyes; then
378 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
379 if test "x$PORT_MONITORS_MISSING" = xyes; then
380 AC_MSG_ERROR([missing a needed network header for port monitoring])
382 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
394 AC_ARG_ENABLE(mldonkey,
395 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
396 [want_mldonkey="$enableval"])
398 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
399 if test x$want_mldonkey = xyes; then
400 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
408 if test "$am_cv_func_iconv" != yes; then
409 AC_MSG_WARN([Could not find libiconv])
411 LIBS="$LIBS $LIBICONV"
420 [ --enable-debug compile with debug symbols [[default=no]]],
421 [want_debug="$enableval"])
423 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
432 AC_ARG_ENABLE(double_buffer,
433 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
437 AC_ARG_ENABLE(xdamage,
438 [ --enable-xdamage enable if you want Xdamage support [[default=yes]]],
439 [want_xdamage="$enableval"])
443 [ --enable-x11 enable if you want X11 support [[default=yes]]],
444 [want_x11="$enableval"])
447 if test "x$want_x11" = "xyes"; then
450 CFLAGS="$CFLAGS $X_CFLAGS"
451 LIBS="$LIBS $X_LIBS $X11_LIBS"
452 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
453 if test "x$X_DISPLAY_MISSING" = xyes; then
454 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])
456 AC_DEFINE(X11, 1, [Define if you want to use X11])
457 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
458 AM_CONDITIONAL(BUILD_X11, true)
459 if test "x$dah" != xno; then
460 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
461 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
462 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
465 if test "x$want_xdamage" = "xyes"; then
466 AC_DEFINE(XDAMAGE, 1, [Define if you want support for the Xdamage extension])
467 AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
468 [AC_DEFINE([HAVE_XDAMAGE], 1, [Xdamage]) LIBS="$LIBS -lXdamage"],
469 [AC_MSG_ERROR([something went wrong when checking for Xdamage])])
472 AM_CONDITIONAL(BUILD_X11, false)
479 if test x$want_xft && test x$want_x11; then
480 PKG_CHECK_MODULES(XFT, [xft],
482 AC_DEFINE(XFT, 1, [Define if you are using Xft])
483 CFLAGS="$CFLAGS $XFT_CFLAGS"
493 if test x$WANT_KVM = xyes; then
494 AC_CHECK_LIB(kvm, kvm_open,
496 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
504 if test x$WANT_DEVSTAT = xyes; then
505 AC_CHECK_LIB(devstat, devstat_getversion,
506 LIBS="$LIBS -ldevstat",
507 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
512 dnl OSSLIB for NetBSD/OpenBSD
515 if test x$WANT_OSSLIB = xyes; then
516 AC_CHECK_LIB(ossaudio, _oss_ioctl,
517 LIBS="$LIBS -lossaudio",
518 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
523 dnl Some random headers
527 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
528 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
529 AC_CHECK_HEADERS([sys/mount.h], [], [],
530 [#ifdef HAVE_SYS_PARAM_H
531 #include <sys/param.h>
539 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
540 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
541 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
542 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
543 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
545 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
552 if test x$WANT_SYSINFO = xyes; then
554 AC_MSG_CHECKING(for sysinfo)
556 [#include <sys/types.h>
557 #include <sys/sysinfo.h>],
558 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
559 [AC_MSG_RESULT(yes); dah=yes],
560 [AC_MSG_RESULT(not usable); dah=no])
562 if test x$dah = xyes; then
563 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
571 if test x$WANT_KSTAT = xyes; then
573 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
575 if test x$dah = xyes; then
576 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
577 LDFLAGS="$LDFLAGS -lkstat"
581 AC_DEFUN([AM_LANGINFO_CODESET],
583 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
584 [AC_TRY_LINK([#include <langinfo.h>],
585 [char* cs = nl_langinfo(CODESET);],
586 am_cv_langinfo_codeset=yes,
587 am_cv_langinfo_codeset=no)
589 if test $am_cv_langinfo_codeset = yes; then
590 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
591 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
599 AC_MSG_CHECKING(for getloadavg)
601 [#include <stdlib.h>],
602 [double v[3]; getloadavg(v, 3);],
604 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
611 AC_CHECK_FUNCS(popen)
617 CFLAGS="$CFLAGS -Wall -W"
629 $PACKAGE $VERSION configured successfully:
631 Installing into: $prefix
632 C compiler flags: $CFLAGS
633 Linker flags: $LDFLAGS
637 x11 support: $want_x11
638 xft support: $want_xft
639 xdamage extension: $want_xdamage
644 audacious: $want_audacious
645 infopipe: $want_infopipe
651 portmon: $want_portmon
652 mldonkey: $want_mldonkey
653 hddtemp: $want_hddtemp