1 # -*- mode: Makefile; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
3 dnl major, minor and micro version macros.
4 m4_define([conky_version_major], [1])
5 m4_define([conky_version_minor], [8])
6 m4_define([conky_version_micro], [1])
7 m4_define([conky_version_tag], [pre]) dnl [] for releases
8 m4_define([conky_version_revision],[_pre@REVISION@])
9 m4_define([conky_version],
10 [conky_version_major().conky_version_minor().conky_version_micro()ifelse(
11 conky_version_tag(), [pre],
12 [conky_version_revision()],
13 [ifelse(conky_version_tag(), [], [], [conky_version_tag()])])])
15 AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net])
17 AM_INIT_AUTOMAKE(conky, conky_version())
18 AM_CONFIG_HEADER(src/config.h)
19 AC_CONFIG_MACRO_DIR([m4])
21 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
22 dnl libtool must be deleted with make distclean to see this fix.
23 if test x"$CFLAGS" = x""; then
27 AC_DEFINE([_GNU_SOURCE], [], [Define for GNU source and extensions])
39 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
40 if test x"$HAVE_PKGCONFIG" = x"no"; then
41 AC_MSG_ERROR([pkg-config is required!])
43 PKG_PROG_PKG_CONFIG([0.19])
60 FreeBSD*|GNU/kFreeBSD*)
74 # Solaris doesn't work at all right now
80 echo "Your operating system $uname isn't supported"
81 echo "Feel free to help. :P"
86 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
87 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
88 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD -o x$uname = xGNU/kFreeBSD)
89 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
90 AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
92 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
93 BUILD_ARCH="$(uname -sr) ($(uname -m))"
99 dnl BUILD_CONFIG_OUTPUT option
102 AC_ARG_ENABLE([config_output],
103 AC_HELP_STRING([--disable-config-output], [disable if you do not want conky to output a default config (with -C) @<:@default=yes@:>@]),
104 [want_config_output="$enableval"], [want_config_output=yes])
106 AM_CONDITIONAL(BUILD_CONFIG_OUTPUT, test x$want_config_output = xyes)
107 if test x$want_config_output = xyes; then
108 AC_DEFINE(CONFIG_OUTPUT, 1, [Define if you want conky to output a default config (with -C)])
109 AC_CHECK_FUNCS(fopencookie)
110 AC_CHECK_FUNCS(funopen)
114 dnl OWN_WINDOW option
117 AC_ARG_ENABLE([own_window],
118 AC_HELP_STRING([--disable-own-window],
119 [disable if you do not want support for creating own window @<:@default=yes@:>@]),
120 [dah="$enableval"], [dah=yes])
122 if test $dah != "no"; then
123 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
130 AC_ARG_ENABLE([ncurses],
131 AC_HELP_STRING([--disable-ncurses], [disable if you do not want ncurses support in conky @<:@default=yes@:>@]),
132 [want_ncurses="$enableval"], [want_ncurses=yes])
134 AM_CONDITIONAL(BUILD_NCURSES, test x$want_ncurses = xyes)
135 if test x$want_ncurses = xyes; then
136 conky_LIBS="$conky_LIBS -lncurses"
137 AC_DEFINE(NCURSES, 1, [Define for ncurses support])
142 dnl Audacious Media Player
145 AC_ARG_ENABLE([audacious],
146 AC_HELP_STRING([--enable-audacious=[[yes|no|legacy]]],
147 [enable audacious player support @<:@default=no@:>@]),
148 [want_audacious="$enableval"], [want_audacious=no])
150 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes -o x$want_audacious = xlegacy)
151 if test x$want_audacious = xyes; then
152 PKG_CHECK_MODULES([Audacious], [audacious >= 1.4.0 dbus-glib-1 glib-2.0 gobject-2.0])
153 conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
154 conky_LIBS="$conky_LIBS $Audacious_LIBS"
155 save_CPPFLAGS="$CPPFLAGS"
156 CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
157 AC_CHECK_HEADERS([audacious/audctrl.h audacious/dbus.h glib.h glib-object.h],
158 [], AC_MSG_ERROR([required header(s) not found]))
159 CPPFLAGS="$save_CPPFLAGS"
160 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
161 else if test x$want_audacious = xlegacy; then
162 PKG_CHECK_MODULES([Audacious], [audacious < 1.4.0 glib-2.0])
163 conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
164 conky_LIBS="$conky_LIBS $Audacious_LIBS"
165 save_CPPFLAGS="$CPPFLAGS"
166 CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
167 AC_CHECK_HEADERS([audacious/beepctrl.h glib.h], [], AC_MSG_ERROR([required header(s) not found]))
168 CPPFLAGS="$save_CPPFLAGS"
169 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
170 AC_DEFINE(AUDACIOUS_LEGACY, 1, [Define for Audacious Legacy support])
179 AC_ARG_ENABLE([bmpx],
180 AC_HELP_STRING([--enable-bmpx], [enable if you want BMPx support @<:@default=no@:>@]),
181 [want_bmpx="$enableval"], [want_bmpx=no])
183 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
184 if test x$want_bmpx = xyes; then
185 PKG_CHECK_MODULES([BMPx], [bmp-2.0 >= 0.14.0])
186 conky_CFLAGS="$conky_CFLAGS $BMPx_CFLAGS"
187 conky_LIBS="$conky_LIBS $BMPx_LIBS"
188 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
193 dnl Support for IBM/Lenovo notebooks
197 AC_HELP_STRING([--enable-ibm], [enable if you want support for IBM/Lenovo notebooks @<:default=no@:>@]),
198 [want_ibm="$enableval"], [want_ibm=no])
200 AM_CONDITIONAL(BUILD_IBM, test x$want_ibm = xyes)
201 if test x$want_ibm = xyes; then
202 if test x"$uname" != xLinux; then
203 AC_MSG_NOTICE([support for IBM/Lenovo notebooks not supported on $uname... disabling])
204 want_ibm="not supported on $uname"
206 AC_DEFINE(IBM, 1, [Define if you want support for IBM/Lenovo notebooks (SMAPI)])
215 AC_ARG_ENABLE([hddtemp],
216 AC_HELP_STRING([--disable-hddtemp],
217 [disable if you do not want hddtemp support @<:@default=yes@:>@]),
218 [want_hddtemp="$enableval"], [want_hddtemp=yes])
220 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
221 if test x$want_hddtemp = xyes; then
222 if test x"$uname" != xLinux; then
223 AC_MSG_NOTICE([hddtemp not supported on $uname... disabling])
224 want_hddtemp="not supported on $uname"
226 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
235 AC_ARG_ENABLE([apcupsd],
236 AC_HELP_STRING([--disable-apcupsd],
237 [disable if you do not want apcupsd support @<:@default=yes@:>@]),
238 [want_apcupsd="$enableval"], [want_apcupsd=yes])
240 if test x$want_apcupsd = xyes; then
241 if test x"$uname" != xLinux; then
242 AC_MSG_NOTICE([apcupsd not supported on $uname... disabling])
243 want_apcupsd="not supported on $uname"
245 AC_DEFINE(APCUPSD, 1, [Define if you want apcupsd support])
248 AM_CONDITIONAL(BUILD_APCUPSD, test x$want_apcupsd = xyes)
255 AC_ARG_ENABLE([iostats],
256 AC_HELP_STRING([--enable-iostats],
257 [enable if you want support for per-task I/O statistics @<:@default=yes@:>@]),
258 [want_iostats="$enableval"], [want_iostats=yes])
260 if test x$want_iostats = xyes; then
261 if test x"$uname" != xLinux; then
262 AC_MSG_NOTICE([iostats not supported on $uname... disabling])
263 want_iostats="not supported on $uname"
265 AC_DEFINE(IOSTATS, 1, [Define if you want support for per-task I/O statistics])
274 AC_ARG_ENABLE([math],
275 AC_HELP_STRING([--disable-math], [disable if you do not want math support @<:@default=yes@:>@]),
276 [want_math="$enableval"], [want_math=yes])
278 AM_CONDITIONAL(BUILD_MATH, test x$want_math = xyes)
279 if test x$want_math = xyes; then
280 conky_LIBS="$conky_LIBS -lm"
281 AC_DEFINE(MATH, 1, [Define if you want math support])
289 AC_HELP_STRING([--disable-mpd], [disable if you do not want MPD support @<:@default=yes@:>@]),
290 [want_mpd="$enableval"], [want_mpd=yes])
292 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
293 if test x$want_mpd = xyes; then
294 AC_DEFINE(MPD, 1, [Define if you want MPD support])
302 AC_HELP_STRING([--disable-moc], [disable if you do not want MOC support @<:@default=yes@:>@]),
303 [want_moc="$enableval"], [want_moc=yes])
305 AM_CONDITIONAL(BUILD_MOC, test x$want_moc = xyes)
306 if test x$want_moc = xyes; then
307 AC_DEFINE(MOC, 1, [Define if you want MOC support])
314 AC_ARG_ENABLE([xmms2],
315 AC_HELP_STRING([--enable-xmms2], [enable if you want XMMS2 support @<:@default=no@:>@]),
316 [want_xmms2="$enableval"], [want_xmms2=no])
318 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
319 if test x$want_xmms2 = xyes; then
320 PKG_CHECK_MODULES([XMMS2], [xmms2-client] >= [0.6])
321 conky_CFLAGS="$conky_CFLAGS $XMMS2_CFLAGS"
322 conky_LIBS="$conky_LIBS $XMMS2_LIBS"
323 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
327 dnl libcurl, see below for more (this has to be above the other uses of want_curl)
330 AC_ARG_ENABLE([curl],
331 AC_HELP_STRING([--enable-curl], [enable if you want curl support @<:@default=no@:>@]),
332 [want_curl="$enableval"], [want_curl=no])
335 dnl EVE Skill Monitor
339 AC_HELP_STRING([--enable-eve], [Eve-Online skill monitor @<:@default=no@:>@]),
340 [want_eve="$enableval"], [want_eve=no])
342 AM_CONDITIONAL(BUILD_EVE, test x$want_eve = xyes)
343 if test x$want_eve = xyes; then
346 AC_DEFINE(EVE, 1, [Define if you want Eve-Online Skill monitor support])
347 AC_DEFINE(EVEURL_TRAINING, "http://api.eve-online.com/char/SkillInTraining.xml.aspx", [Eve training URL])
348 AC_DEFINE(EVEURL_SKILLTREE, "http://api.eve-online.com/eve/Skilltree.xml.aspx", [Eve skilltree URL])
349 AC_DEFINE(MY_ENCODING, "ISO-8859-1", [Textencoding to use])
350 AC_DEFINE(EVE_OUTPUT_FORMAT, "%s %d in %s", [Eve output format])
358 AC_HELP_STRING([--enable-rss], [enable if you want rss support @<:@default=no@:>@]),
359 [want_rss="$enableval"], [want_rss=no])
361 AM_CONDITIONAL(BUILD_RSS, test x$want_rss = xyes)
362 if test x$want_rss = xyes; then
366 AC_DEFINE(RSS, 1, [Define if you want Curl support])
373 AC_ARG_ENABLE([weather-metar],
374 AC_HELP_STRING([--enable-weather-metar], [enable if you want METAR weather support @<:@default=no@:>@]),
375 [want_metar="$enableval"], [want_metar=no])
377 AC_ARG_ENABLE([weather-xoap],
378 AC_HELP_STRING([--enable-weather-xoap], [enable if you want XOAP weather support (also enables METAR) @<:@default=no@:>@]),
379 [want_xoap="$enableval"], [want_xoap=no])
381 if test x$want_xoap = xyes; then
384 AM_CONDITIONAL(BUILD_WEATHER, test x$want_metar = xyes)
385 AM_CONDITIONAL(BUILD_XOAP, test x$want_xoap = xyes)
386 if test x$want_metar = xyes; then
387 if test x$want_xoap = xyes; then
389 AC_DEFINE(XOAP, 1, [Define if you want XOAP weather support])
390 AC_DEFINE(XOAP_FILE, "$HOME/.xoaprc", [User xoap keys file])
393 AC_DEFINE(WEATHER, 1, [Define if you want METAR weather support])
401 AC_HELP_STRING([--disable-x11], [disable if you do not want X11 support @<:@default=yes@:>@]),
402 [want_x11="$enableval"], [want_x11=yes])
404 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
405 if test "x$want_x11" = "xyes"; then
406 if $PKG_CONFIG --exists x11; then
407 PKG_CHECK_MODULES([X11], [x11])
408 conky_CFLAGS="$conky_CFLAGS $X11_CFLAGS"
409 conky_LIBS="$conky_LIBS $X11_LIBS"
411 dnl non-modular X11 installations
414 conky_CFLAGS="$conky_CFLAGS $X_CFLAGS"
415 conky_LIBS="$conky_LIBS $X_LIBS"
416 conky_LDFLAGS="$conky_LDFLAGS $conky_LIBS $X_PRE_LIBS"
417 if test "x$no_x" = "xyes"; then
418 AC_MSG_ERROR([Can't locate your X11 installation])
420 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
422 AC_DEFINE(X11, 1, [Define if you want to use X11])
429 AC_ARG_ENABLE([argb],
430 AC_HELP_STRING([--disable-argb], [disable if you do not want a argb visual @<:@default=yes@:>@]),
431 [want_argb="$enableval"], [want_argb=yes])
433 if test x$want_argb = xyes; then
434 if test "x$want_x11" != "xyes"; then
435 dnl silently disable if no x11
438 AC_DEFINE(USE_ARGB, 1, [Define if you want argb visual support])
446 AC_ARG_ENABLE([imlib2],
447 AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
448 [want_imlib2="$enableval"], [want_imlib2=no])
449 AC_ARG_ENABLE([lua-imlib2],
450 AC_HELP_STRING([--enable-lua-imlib2], [enable if you want Lua Imlib2 bindings for Conky @<:@default=no@:>@]),
451 [want_lua_imlib2="$enableval"], [want_lua_imlib2=no])
453 # if lua-imlib2 is enabled, we must force imlib2
454 if test x$want_lua_imlib2 = xyes; then
458 if test x$want_imlib2 = xyes; then
459 if test "x$want_x11" != "xyes"; then
460 dnl silently disable if no x11
463 PKG_CHECK_MODULES([Imlib2], [imlib2])
464 conky_CFLAGS="$conky_CFLAGS $Imlib2_CFLAGS"
465 conky_LIBS="$conky_LIBS $Imlib2_LIBS"
466 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
469 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
476 AC_HELP_STRING([--enable-lua], [enable if you want Lua scripting support @<:@default=yes@:>@]),
477 [want_lua="$enableval"], [want_lua=yes])
478 AC_ARG_ENABLE([lua-cairo],
479 AC_HELP_STRING([--enable-lua-cairo], [enable if you want Lua Cairo bindings for Conky @<:@default=no@:>@]),
480 [want_lua_cairo="$enableval"], [want_lua_cairo=no])
482 if test x$want_lua_cairo = xyes -o x$want_lua_imlib2 = xyes; then
487 AM_CONDITIONAL(BUILD_LUA, test x$want_lua = xyes)
488 if test x$want_lua = xyes; then
489 PKG_CHECK_MODULES(LUA, lua >= 5.1, [ ],[
490 PKG_CHECK_MODULES(LUA51, lua-5.1 >= 5.1, [ ],[
491 PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1)
494 conky_CFLAGS="$conky_CFLAGS $LUA_CFLAGS $LUA51_CFLAGS"
495 conky_LIBS="$conky_LIBS $LUA_LIBS $LUA51_LIBS"
497 if test x$need_tolua = xyes; then
498 AC_DEFINE(LUA_EXTRAS, 1, [Define if you want Lua extras])
499 if test "x$want_x11" != "xyes"; then
500 dnl silently disable if no x11
503 if test x$want_lua_cairo = xyes; then
504 PKG_CHECK_MODULES([cairo], cairo)
505 PKG_CHECK_MODULES([cairo_xlib], cairo-xlib)
506 AC_DEFINE(HAVE_LUA_CAIRO, 1, [Define if you want Lua Cairo bindings for Conky])
507 libcairo_CFLAGS="$libcairo_CFLAGS $cairo_CFLAGS $cairo_xlib_CFLAGS"
508 libcairo_LIBS="$libcairo_LIBS $cairo_LIBS $cairo_xlib_LIBS"
510 if test x$want_imlib2 = xyes; then
511 AC_DEFINE(HAVE_LUA_IMLIB2, 1, [Define if you want Lua Imlib2 bindings for Conky])
514 AC_CHECK_PROGS(toluapp, [tolua++ tolua++5.1 tolua++-5.1], no)
515 if test x$toluapp = xno; then
516 AC_MSG_ERROR([tolua++, tolua++5.1, or tolua++-5.1 is required for Lua extras.])
518 AC_SEARCH_LIBS(tolua_error,
519 [tolua++-5.1 tolua++ tolua++5.1],
521 AC_SUBST(tolua_LIBS, "${LIBS}")
522 AC_SUBST(tolua_CFLAGS, "${CFLAGS}")
524 AC_MSG_ERROR([tolua_error not found]),
525 [$LUA_LIBS $LUA51_LIBS])
527 conky_LIBS="$conky_LIBS $tolua_LIBS"
528 tolua_CFLAGS="$tolua_CFLAGS $LUA_CFLAGS $LUA51_CFLAGS"
529 tolua_LIBS="$tolua_LIBS $LUA_LIBS $LUA51_LIBS"
531 AC_DEFINE(HAVE_LUA, 1, [Define if you want Lua scripting support])
533 AM_CONDITIONAL(BUILD_LUA_CAIRO, test x$want_lua_cairo = xyes)
534 AM_CONDITIONAL(BUILD_LUA_IMLIB2, test x$want_lua_imlib2 = xyes)
537 dnl Wireless extensions
540 AC_ARG_ENABLE([wlan],
541 AC_HELP_STRING([--enable-wlan], [enable if you want wireless support @<:@default=no@:>@]),
542 [want_wlan="$enableval"], [want_wlan=no])
544 AM_CONDITIONAL(BUILD_WLAN, test x$want_wlan = xyes)
545 if test x$want_wlan = xyes; then
546 AC_CHECK_HEADERS([iwlib.h], [], AC_MSG_ERROR([iwlib.h header not found]))
547 AC_CHECK_LIB([iw], [iw_sockets_open], [conky_LIBS="$conky_LIBS -liw"], AC_MSG_ERROR([iw_sockets_open not found]))
548 AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support])
555 AC_ARG_ENABLE([portmon],
556 AC_HELP_STRING([--disable-portmon],
557 [disable if you do not want tcp (ip4) port monitoring @<:@default=yes@:>@]),
558 [want_portmon="$enableval"], [want_portmon=yes])
560 if test x"$want_portmon" = xyes; then
561 if test x"$uname" != xLinux; then
562 AC_MSG_NOTICE([port monitors not supported on $uname... disabling])
563 want_portmon="not supported on $uname"
565 AC_CHECK_FUNCS([getnameinfo], [], AC_MSG_ERROR([getnameinfo function not found]))
566 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
567 [PORT_MONITORS_MISSING=yes])
568 if test x"$PORT_MONITORS_MISSING" = xyes; then
569 AC_MSG_ERROR([missing a needed network header for port monitoring])
572 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
575 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x"$want_portmon" = xyes)
582 m4_pattern_allow([AM_ICONV])
584 if test "$am_cv_func_iconv" != yes; then
585 AC_MSG_WARN([Could not find libiconv])
587 conky_LIBS="$conky_LIBS $LIBICONV"
589 AM_CONDITIONAL(BUILD_ICONV, test "$am_cv_func_iconv" = yes)
592 dnl Xext Double-buffering Extension
595 AC_ARG_ENABLE([double_buffer],
596 AC_HELP_STRING([--disable-double-buffer],
597 [disable for no Xdbe double-buffering support @<:@default=yes@:>@]),
598 [want_double_buffer="$enableval"], [want_double_buffer=yes])
600 if test "x$want_double_buffer" = "xyes"; then
601 if test "x$want_x11" != "xyes"; then
602 dnl silently disable if no x11
603 want_double_buffer=no
605 if $PKG_CONFIG --exists xext; then
606 PKG_CHECK_MODULES([Xext],[xext])
607 conky_CFLAGS="$conky_CFLAGS $Xext_CFLAGS"
608 conky_LIBS="$conky_LIBS $Xext_LIBS"
610 dnl non-modular X11 installation
611 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [conky_LIBS="$conky_LIBS -lXext"],
612 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
614 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
620 dnl Xdamage Extension
623 AC_ARG_ENABLE([xdamage],
624 AC_HELP_STRING([--disable-xdamage],
625 [disable if you do not want Xdamage support @<:@default=yes@:>@]),
626 [want_xdamage="$enableval"], [want_xdamage=yes])
628 if test "x$want_xdamage" = "xyes"; then
629 if test "x$want_x11" != "xyes"; then
630 dnl silently disable if no x11
633 if $PKG_CONFIG --exists xdamage; then
634 PKG_CHECK_MODULES([XDamage],[xdamage])
635 conky_CFLAGS="$conky_CFLAGS $XDamage_CFLAGS"
636 conky_LIBS="$conky_LIBS $XDamage_LIBS"
638 dnl non-modular X11 installation
639 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [conky_LIBS="$conky_LIBS -lXdamage"],
640 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
642 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
652 AC_HELP_STRING([--disable-xft], [disable if you do not want to use Xft @<:@default=yes@:>@]),
653 [want_xft="$enableval"], [want_xft=yes])
655 if test x$want_xft = "xyes"; then
656 if test "x$want_x11" != "xyes"; then
657 dnl silently disable if no x11
660 PKG_CHECK_MODULES([Xft], [xft])
661 conky_CFLAGS="$conky_CFLAGS $Xft_CFLAGS"
662 conky_LIBS="$conky_LIBS $Xft_LIBS"
663 AC_DEFINE(XFT, 1, [Define for Xft support])
668 dnl NVIDIA libXNVCtrl support
671 AC_ARG_ENABLE([nvidia],
672 AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
673 [want_nvidia="$enableval"], [want_nvidia=no])
674 if test x$want_nvidia = xyes; then
675 if test "x$want_x11" != "xyes"; then
679 AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
680 dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
681 dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
682 dnl ## am I Stupid ??
683 dnl ## it won't find the lib for some reason!?
684 conky_LIBS="$conky_LIBS -lXNVCtrl"
685 AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
688 AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
694 if test x$WANT_GLIB = xyes; then
695 PKG_CHECK_MODULES([GLib2], [glib-2.0])
696 conky_CFLAGS="$conky_CFLAGS $GLib2_CFLAGS"
697 conky_LIBS="$conky_LIBS $GLib2_LIBS"
704 if test x$want_curl = xyes; then
705 PKG_CHECK_MODULES([libcurl], libcurl)
706 conky_CFLAGS="$conky_CFLAGS $libcurl_CFLAGS"
707 conky_LIBS="$conky_LIBS $libcurl_LIBS"
708 AC_DEFINE(HAVE_CURL, 1, [Define if you want Curl support])
710 AM_CONDITIONAL(BUILD_CURL, test x$want_curl = xyes)
716 if test x$want_libxml2 = xyes; then
717 PKG_CHECK_MODULES([libxml2], libxml-2.0)
718 conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS"
719 conky_LIBS="$conky_LIBS $libxml2_LIBS"
726 if test x$WANT_KVM = xyes; then
727 AC_CHECK_LIB(kvm, kvm_open,
728 conky_LIBS="$conky_LIBS -lkvm",
729 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
737 if test x$WANT_DEVSTAT = xyes; then
738 AC_CHECK_LIB(devstat, devstat_getversion,
739 conky_LIBS="$conky_LIBS -ldevstat",
740 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
745 dnl OSSLIB for NetBSD/OpenBSD
748 if test x$WANT_OSSLIB = xyes; then
749 AC_CHECK_LIB(ossaudio, _oss_ioctl,
750 conky_LIBS="$conky_LIBS -lossaudio",
751 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
758 AC_ARG_ENABLE([alsa],
759 AC_HELP_STRING([--disable-alsa], [disable if you do not
760 want ALSA support @<:@default=yes@:>@]),
761 [want_alsa="$enableval"], [want_alsa=yes])
763 if test x$want_alsa = xyes; then
764 AC_CHECK_HEADER(alsa/asoundlib.h,, want_alsa=no)
766 if test x$want_alsa = xyes; then
767 AC_CHECK_LIB(asound, snd_pcm_open,conky_LIBS="$conky_LIBS -lasound", want_alsa=no)
769 if test x$want_alsa = xyes; then
770 AC_DEFINE(MIXER_IS_ALSA, 1, [Define if the mixers use ALSA])
776 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h alsa/asoundlib.h dirent.h mcheck.h \
777 sys/statfs.h sys/param.h pthread.h semaphore.h assert.h errno.h time.h])
778 AC_CHECK_HEADERS([sys/mount.h], [], [],
779 [#ifdef HAVE_SYS_PARAM_H
780 #include <sys/param.h>
783 # check if we have inotify support
784 AC_CHECK_HEADERS([sys/inotify.h])
790 AC_DEFINE(DEFAULTNETDEV, "eth0", [Default networkdevice])
791 AC_DEFINE(CONFIG_FILE, "$HOME/.conkyrc", [Configfile of the user])
792 AC_DEFINE(MAX_SPECIALS_DEFAULT, 512, [Default maximum number of special things, e.g. fonts, offsets, aligns, etc.])
793 AC_DEFINE(MAX_USER_TEXT_DEFAULT, 16384, [Default maximum size of config TEXT buffer, i.e. below TEXT line.])
794 AC_DEFINE(DEFAULT_TEXT_BUFFER_SIZE, 256, [Default size used for temporary, static text buffers])
795 AC_DEFINE(MAX_NET_INTERFACES, 16, [Maximum number of network devices])
801 AC_CHECK_FUNCS([calloc malloc free popen sysinfo getloadavg memrchr strndup gethostbyname_r])
802 AC_SEARCH_LIBS(clock_gettime, [rt], conky_LIBS="$conky_LIBS $LIBS"
803 [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])],
804 [AC_CHECK_FUNCS([gettimeofday], [], [AC_MSG_ERROR([gettimeofday() not available!])])], [])
810 AC_CHECK_MEMBER([struct statfs.f_fstypename],
811 [AC_DEFINE(HAVE_STRUCT_STATFS_F_FSTYPENAME, 1, [Define if struct statfs has the f_fstypename member])],
813 [#include <sys/statfs.h>])
819 AC_CHECK_HEADER(zlib.h,
821 [AC_MSG_ERROR([zlib is missing; please install the headers first])])
825 dnl Check for OpenMP support
827 dnl removed for now due to problems with GCC's OpenMP implementation
829 dnl AC_ARG_ENABLE([openmp],
830 dnl AC_HELP_STRING([--enable-openmp], [enable if you want OpenMP support @<:@default=no@:>@]),
831 dnl [want_openmp="$enableval"], [want_openmp=no])
833 dnl if test x$want_openmp = xyes; then
835 dnl gcc_version=`$CC -dumpversion`
836 dnl gcc_major=`echo $gcc_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
837 dnl gcc_minor=`echo $gcc_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
838 dnl dnl check that the gcc version is >=4.3, if we're using gcc
839 dnl if test ! "x$GCC" = "xyes" -o $gcc_major -ge 4 -a $gcc_minor -ge 3; then
840 dnl AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])
841 dnl conky_CFLAGS="$conky_CFLAGS $OPENMP_CFLAGS"
852 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
853 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
854 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
855 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
856 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
858 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
865 if test x$WANT_KSTAT = xyes; then
867 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
869 if test x$dah = xyes; then
870 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
871 conky_LDFLAGS="$conky_LDFLAGS -lkstat"
875 AC_DEFUN([AM_LANGINFO_CODESET],
877 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
878 [AC_TRY_LINK([#include <langinfo.h>],
879 [char* cs = nl_langinfo(CODESET);],
880 am_cv_langinfo_codeset=yes,
881 am_cv_langinfo_codeset=no)
883 if test $am_cv_langinfo_codeset = yes; then
884 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
885 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
890 dnl ************************
891 dnl * Linker optimizations *
892 dnl ************************
893 AC_MSG_CHECKING([if $LD accepts -O1])
894 case `$LD -O1 -v 2>&1 </dev/null` in
896 conky_LDFLAGS="$conky_LDFLAGS -Wl,-O1"
904 dnl Solve multiple definitions (only necessary when gnulib is used)
905 dnl conky_LDFLAGS="$conky_LDFLAGS -Xlinker -zmuldefs"
911 conky_CFLAGS="$conky_CFLAGS -Wall -W"
917 AC_ARG_ENABLE([debug],
918 AC_HELP_STRING([--enable-debug], [compile with debug symbols @<:@default=no@:>@]),
919 [want_debug="$enableval"], [want_debug=no])
921 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
922 conky_CFLAGS="$conky_CFLAGS -g3 -O0"
923 AC_DEFINE([DEBUG], 1, [Define for debugging])
930 AC_ARG_ENABLE([testing],
931 AC_HELP_STRING([--enable-testing], [use strict compiler flags for testing @<:@default=no@:>@]),
932 [want_testing="$enableval"], [want_testing=no])
934 if test "x$want_testing" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
935 if test "x$want_debug" = "xyes"; then
936 conky_CFLAGS="$conky_CFLAGS -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
937 AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
939 conky_CFLAGS="$conky_CFLAGS -O0 -g3 -Wextra -Wunused -Wdeclaration-after-statement -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wold-style-definition -Winline -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -std=c99 -pedantic -Werror"
940 AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
948 AC_ARG_ENABLE([profiling],
949 AC_HELP_STRING([--enable-profiling], [specify compiler flags for use with gprof and gcov @<:@default=no@:>@]),
950 [want_profiling="$enableval"], [want_profiling=no])
952 if test "x$want_profiling" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
953 if test "x$want_debug" = "xyes"; then
954 conky_CFLAGS="$conky_CFLAGS -pg -fprofile-arcs -ftest-coverage"
956 conky_CFLAGS="$conky_CFLAGS -g3 -pg -fprofile-arcs -ftest-coverage"
958 AC_DEFINE([PROFILING], [], [Define for profiling (gprof and gcov) support])
961 AC_SUBST(conky_CFLAGS)
972 $PACKAGE $VERSION configured successfully:
974 Installing into: $prefix
975 System config dir: $sysconfdir
976 C compiler flags: $conky_CFLAGS
977 Libraries: $conky_LIBS
978 Linker flags: $conky_LDFLAGS
981 X11 support: $want_x11
982 XDamage support: $want_xdamage
983 XDBE support: $want_double_buffer
984 Xft support: $want_xft
985 ARGB support $want_argb
988 Audacious: $want_audacious
995 dnl OpenMP: $want_openmp
997 hddtemp: $want_hddtemp
998 portmon: $want_portmon
1004 wireless: $want_wlan
1006 nvidia: $want_nvidia
1007 eve-online: $want_eve
1008 config-output: $want_config_output
1009 Imlib2: $want_imlib2
1010 ALSA mixer: $want_alsa
1011 apcupsd: $want_apcupsd
1012 I/O stats: $want_iostats
1014 * Lua ($want_lua) bindings:
1015 Cairo: $want_lua_cairo
1016 Imlib2: $want_lua_imlib2