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])
107 dnl Audacious Media Player
111 AC_ARG_ENABLE(audacious,
112 [ --enable-audacious enable audacious player support [[default=auto]]],
113 [want_audacious="$enableval"])
115 case x$want_audacious in
118 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1], [], [want_audacious=no])
119 if test x$want_audacious = xyes; then
120 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
121 LIBS="$LIBS $AUDACIOUS_LIBS"
122 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
126 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1], [],
127 [AC_MSG_ERROR([Can't find Audacious development files.])])
128 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
129 LIBS="$LIBS $AUDACIOUS_LIBS"
130 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
135 echo "Error: invalid audacious parameter specified: $want_audacious"
139 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
148 [ --enable-bmpx enable if you want BMPx support [[default=no]]],
149 [want_bmpx="$enableval"])
151 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
152 if test x$want_bmpx = xyes; then
153 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
154 CFLAGS="$CFLAGS $BMPX_CFLAGS"
155 LIBS="$LIBS $BMPX_LIBS"
156 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
165 [ --enable-seti enable if you want SETI at Home stats [[default=yes]]],
166 [want_seti="$enableval"])
168 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
169 if test x$want_seti = xyes; then
170 AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
178 AC_ARG_ENABLE(hddtemp,
179 [ --enable-hddtemp enable if you want hddtemp support [[default=yes]]],
180 [want_hddtemp="$enableval"])
182 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
183 if test x$want_hddtemp = xyes; then
184 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
193 [ --enable-mpd enable if you want MPD support [[default=yes]]],
194 [want_mpd="$enableval"])
196 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
197 if test x$want_mpd = xyes; then
198 AC_DEFINE(MPD, 1, [Define if you want MPD support])
207 [ --enable-xmms2 enable if you want XMMS2 support [[default=no]]],
208 [want_xmms2="$enableval"])
210 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
211 if test x$want_xmms2 = xyes; then
212 CFLAGS="$CFLAGS `pkg-config --cflags xmms2-client`"
213 LIBS="$LIBS `pkg-config --libs xmms2-client`"
214 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
222 AC_ARG_ENABLE(imlib2,
223 [ --enable-imlib2 enable if you want Imlib2 support [[default=no]]],
224 [want_imlib2="$enableval"])
226 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
227 if test x$want_imlib2 = xyes; then
228 PKG_CHECK_MODULES([Imlib2], [imlib2])
229 CFLAGS="$CFLAGS $Imlib2_CFLAGS"
230 LIBS="$LIBS $Imlib2_LIBS"
231 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
239 AC_ARG_ENABLE(portmon,
240 [ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=yes]]],
241 [want_portmon="$enableval"])
243 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
244 if test x$want_portmon = xyes; then
245 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
246 if test "x$PORT_MONITORS_MISSING" = xyes; then
247 AC_MSG_ERROR([missing a needed network header for port monitoring])
249 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
261 AC_ARG_ENABLE(mldonkey,
262 [ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
263 [want_mldonkey="$enableval"])
265 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
266 if test x$want_mldonkey = xyes; then
267 AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
275 if test "$am_cv_func_iconv" != yes; then
276 AC_MSG_WARN([Could not find libiconv])
278 LIBS="$LIBS $LIBICONV"
287 [ --enable-debug compile with debug symbols [[default=no]]],
288 [want_debug="$enableval"])
290 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
298 want_double_buffer=yes
299 AC_ARG_ENABLE(double_buffer,
300 [ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
301 [want_double_buffer="$enableval"])
304 AC_ARG_ENABLE(xdamage,
305 [ --enable-xdamage enable if you want Xdamage support [[default=yes]]],
306 [want_xdamage="$enableval"])
310 [ --enable-x11 enable if you want X11 support [[default=yes]]],
311 [want_x11="$enableval"])
314 if test "x$want_x11" = "xyes"; then
317 CFLAGS="$CFLAGS $X_CFLAGS"
318 LIBS="$LIBS $X_LIBS $X11_LIBS"
319 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
321 if test "x$no_x" = xyes; then
322 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])
326 [X11], [XOpenDisplay],[],
327 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
330 AC_DEFINE(X11, 1, [Define if you want to use X11])
331 AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
332 AM_CONDITIONAL(BUILD_X11, true)
334 if test "x$want_double_buffer" != xno; then
335 AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
336 AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
337 [AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
340 if test "x$want_xdamage" = "xyes"; then
341 AC_DEFINE(XDAMAGE, 1, [Define if you want support for the Xdamage extension])
342 AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
343 [AC_DEFINE([HAVE_XDAMAGE], 1, [Xdamage]) LIBS="$LIBS -lXdamage"],
344 [AC_MSG_ERROR([something went wrong when checking for Xdamage])])
347 AM_CONDITIONAL(BUILD_X11, false)
354 if test x$want_xft && test x$want_x11; then
355 PKG_CHECK_MODULES(XFT, [xft],
357 AC_DEFINE(XFT, 1, [Define if you are using Xft])
358 CFLAGS="$CFLAGS $XFT_CFLAGS"
368 if test x$WANT_KVM = xyes; then
369 AC_CHECK_LIB(kvm, kvm_open,
371 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
379 if test x$WANT_DEVSTAT = xyes; then
380 AC_CHECK_LIB(devstat, devstat_getversion,
381 LIBS="$LIBS -ldevstat",
382 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
387 dnl OSSLIB for NetBSD/OpenBSD
390 if test x$WANT_OSSLIB = xyes; then
391 AC_CHECK_LIB(ossaudio, _oss_ioctl,
392 LIBS="$LIBS -lossaudio",
393 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
398 dnl Some random headers
402 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
403 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
404 AC_CHECK_HEADERS([sys/mount.h], [], [],
405 [#ifdef HAVE_SYS_PARAM_H
406 #include <sys/param.h>
414 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
415 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
416 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
417 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
418 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
420 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
427 if test x$WANT_SYSINFO = xyes; then
429 AC_MSG_CHECKING(for sysinfo)
431 [#include <sys/types.h>
432 #include <sys/sysinfo.h>],
433 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
434 [AC_MSG_RESULT(yes); dah=yes],
435 [AC_MSG_RESULT(not usable); dah=no])
437 if test x$dah = xyes; then
438 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
446 if test x$WANT_KSTAT = xyes; then
448 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
450 if test x$dah = xyes; then
451 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
452 LDFLAGS="$LDFLAGS -lkstat"
456 AC_DEFUN([AM_LANGINFO_CODESET],
458 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
459 [AC_TRY_LINK([#include <langinfo.h>],
460 [char* cs = nl_langinfo(CODESET);],
461 am_cv_langinfo_codeset=yes,
462 am_cv_langinfo_codeset=no)
464 if test $am_cv_langinfo_codeset = yes; then
465 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
466 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
474 AC_MSG_CHECKING(for getloadavg)
476 [#include <stdlib.h>],
477 [double v[3]; getloadavg(v, 3);],
479 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
486 AC_CHECK_FUNCS(popen)
492 CFLAGS="$CFLAGS -Wall -W"
504 $PACKAGE $VERSION configured successfully:
506 Installing into: $prefix
507 C compiler flags: $CFLAGS
508 Linker flags: $LDFLAGS
512 x11 support: $want_x11
513 xft support: $want_xft
514 xdamage extension: $want_xdamage
517 audacious: $want_audacious
523 portmon: $want_portmon
524 mldonkey: $want_mldonkey
525 hddtemp: $want_hddtemp