1 dnl major, minor and micro version macros.
2 m4_define([conky_version_major], [1])
3 m4_define([conky_version_minor], [7])
4 m4_define([conky_version_micro], [2])
5 m4_define([conky_version_tag], [pre]) dnl [] for releases
6 m4_define([conky_version_revision],[_pre@REVISION@])
7 m4_define([conky_version],
8 [conky_version_major().conky_version_minor().conky_version_micro()ifelse(
9 conky_version_tag(), [pre],
10 [conky_version_revision()],
11 [ifelse(conky_version_tag(), [], [], [conky_version_tag()])])])
13 AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net])
15 AM_INIT_AUTOMAKE(conky, conky_version())
16 AM_CONFIG_HEADER(src/config.h)
17 AC_CONFIG_MACRO_DIR([m4])
19 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
20 dnl libtool must be deleted with make distclean to see this fix.
21 if test x"$CFLAGS" = x""; then
25 AC_DEFINE([_GNU_SOURCE], [], [Define for GNU source and extensions])
37 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no)
38 if test x"$HAVE_PKGCONFIG" = x"no"; then
39 AC_MSG_ERROR([pkg-config is required!])
41 PKG_PROG_PKG_CONFIG([0.19])
58 FreeBSD*|GNU/kFreeBSD*)
72 # Solaris doesn't work at all right now
78 echo "Your operating system $uname isn't supported"
79 echo "Feel free to help. :P"
84 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
85 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
86 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD -o x$uname = xGNU/kFreeBSD)
87 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
88 AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
90 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
91 BUILD_ARCH="$(uname -sr) ($(uname -m))"
97 dnl BUILD_CONFIG_OUTPUT option
100 AC_ARG_ENABLE([config_output],
101 AC_HELP_STRING([--disable-config-output], [disable if you do not want conky to output a default config (with -C) @<:@default=yes@:>@]),
102 [want_config_output="$enableval"], [want_config_output=yes])
104 AM_CONDITIONAL(BUILD_CONFIG_OUTPUT, test x$want_config_output = xyes)
105 if test x$want_config_output = xyes; then
106 AC_DEFINE(CONFIG_OUTPUT, 1, [Define if you want conky to output a default config (with -C)])
107 AC_CHECK_FUNCS(fopencookie)
108 AC_CHECK_FUNCS(funopen)
112 dnl OWN_WINDOW option
115 AC_ARG_ENABLE([own_window],
116 AC_HELP_STRING([--disable-own-window],
117 [disable if you do not want support for creating own window @<:@default=yes@:>@]),
118 [dah="$enableval"], [dah=yes])
120 if test $dah != "no"; then
121 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
126 dnl Audacious Media Player
129 AC_ARG_ENABLE([audacious],
130 AC_HELP_STRING([--enable-audacious=[[yes|no|legacy]]],
131 [enable audacious player support @<:@default=no@:>@]),
132 [want_audacious="$enableval"], [want_audacious=no])
134 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes -o x$want_audacious = xlegacy)
135 if test x$want_audacious = xyes; then
136 PKG_CHECK_MODULES([Audacious], [audacious >= 1.4.0 dbus-glib-1 glib-2.0 gobject-2.0])
137 conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
138 conky_LIBS="$conky_LIBS $Audacious_LIBS"
139 save_CPPFLAGS="$CPPFLAGS"
140 CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
141 AC_CHECK_HEADERS([audacious/audctrl.h audacious/dbus.h glib.h glib-object.h],
142 [], AC_MSG_ERROR([required header(s) not found]))
143 CPPFLAGS="$save_CPPFLAGS"
144 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
145 else if test x$want_audacious = xlegacy; then
146 PKG_CHECK_MODULES([Audacious], [audacious < 1.4.0 glib-2.0])
147 conky_CFLAGS="$conky_CFLAGS $Audacious_CFLAGS"
148 conky_LIBS="$conky_LIBS $Audacious_LIBS"
149 save_CPPFLAGS="$CPPFLAGS"
150 CPPFLAGS="$Audacious_CFLAGS -I`pkg-config --variable=audacious_include_dir audacious`/audacious"
151 AC_CHECK_HEADERS([audacious/beepctrl.h glib.h], [], AC_MSG_ERROR([required header(s) not found]))
152 CPPFLAGS="$save_CPPFLAGS"
153 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
154 AC_DEFINE(AUDACIOUS_LEGACY, 1, [Define for Audacious Legacy support])
163 AC_ARG_ENABLE([bmpx],
164 AC_HELP_STRING([--enable-bmpx], [enable if you want BMPx support @<:@default=no@:>@]),
165 [want_bmpx="$enableval"], [want_bmpx=no])
167 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
168 if test x$want_bmpx = xyes; then
169 PKG_CHECK_MODULES([BMPx], [bmp-2.0 >= 0.14.0])
170 conky_CFLAGS="$conky_CFLAGS $BMPx_CFLAGS"
171 conky_LIBS="$conky_LIBS $BMPx_LIBS"
172 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
177 dnl Support for IBM/Lenovo notebooks
181 AC_HELP_STRING([--enable-ibm], [enable if you want support for IBM/Lenovo notebooks @<:default=no@:>@]),
182 [want_ibm="$enableval"], [want_ibm=no])
184 AM_CONDITIONAL(BUILD_IBM, test x$want_ibm = xyes)
185 if test x$want_ibm = xyes; then
186 if test x"$uname" != xLinux; then
187 AC_MSG_NOTICE([support for IBM/Lenovo notebooks not supported on $uname... disabling])
190 AC_DEFINE(IBM, 1, [Define if you want support for IBM/Lenovo notebooks (SMAPI)])
199 AC_ARG_ENABLE([hddtemp],
200 AC_HELP_STRING([--disable-hddtemp],
201 [disable if you do not want hddtemp support @<:@default=yes@:>@]),
202 [want_hddtemp="$enableval"], [want_hddtemp=yes])
204 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
205 if test x$want_hddtemp = xyes; then
206 if test x"$uname" != xLinux; then
207 AC_MSG_NOTICE([hddtemp not supported on $uname... disabling])
210 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
219 AC_ARG_ENABLE([apcupsd],
220 AC_HELP_STRING([--disable-apcupsd],
221 [disable if you do not want apcupsd support @<:@default=yes@:>@]),
222 [want_apcupsd="$enableval"], [want_apcupsd=yes])
224 if test x$want_apcupsd = xyes; then
225 if test x"$uname" != xLinux; then
226 AC_MSG_NOTICE([apcupsd not supported on $uname... disabling])
229 AC_DEFINE(APCUPSD, 1, [Define if you want apcupsd support])
232 AM_CONDITIONAL(BUILD_APCUPSD, test x$want_apcupsd = xyes)
239 AC_ARG_ENABLE([iostats],
240 AC_HELP_STRING([--enable-iostats],
241 [enable if you want support for per-task I/O statistics @<:@default=no@:>@]),
242 [want_iostats="$enableval"], [want_iostats=no])
244 if test x$want_iostats = xyes; then
245 if test x"$uname" != xLinux; then
246 AC_MSG_NOTICE([iostats not supported on $uname... disabling])
249 AC_DEFINE(IOSTATS, 1, [Define if you want support for per-task I/O statistics])
258 AC_ARG_ENABLE([math],
259 AC_HELP_STRING([--disable-math], [disable if you do not want math support @<:@default=yes@:>@]),
260 [want_math="$enableval"], [want_math=yes])
262 AM_CONDITIONAL(BUILD_MATH, test x$want_math = xyes)
263 if test x$want_math = xyes; then
264 conky_LIBS="$conky_LIBS -lm"
265 AC_DEFINE(MATH, 1, [Define if you want math support])
273 AC_HELP_STRING([--disable-mpd], [disable if you do not want MPD support @<:@default=yes@:>@]),
274 [want_mpd="$enableval"], [want_mpd=yes])
276 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
277 if test x$want_mpd = xyes; then
278 AC_DEFINE(MPD, 1, [Define if you want MPD support])
286 AC_HELP_STRING([--disable-moc], [disable if you do not want MOC support @<:@default=yes@:>@]),
287 [want_moc="$enableval"], [want_moc=yes])
289 AM_CONDITIONAL(BUILD_MOC, test x$want_moc = xyes)
290 if test x$want_moc = xyes; then
291 AC_DEFINE(MOC, 1, [Define if you want MOC support])
298 AC_ARG_ENABLE([xmms2],
299 AC_HELP_STRING([--enable-xmms2], [enable if you want XMMS2 support @<:@default=no@:>@]),
300 [want_xmms2="$enableval"], [want_xmms2=no])
302 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
303 if test x$want_xmms2 = xyes; then
304 PKG_CHECK_MODULES([XMMS2], [xmms2-client])
305 conky_CFLAGS="$conky_CFLAGS $XMMS2_CFLAGS"
306 conky_LIBS="$conky_LIBS $XMMS2_LIBS"
307 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
311 dnl EVE Skill Monitor
315 AC_HELP_STRING([--enable-eve], [Eve-Online skill monitor @<:@default=no@:>@]),
316 [want_eve="$enableval"], [want_eve=no])
318 AM_CONDITIONAL(BUILD_EVE, test x$want_eve = xyes)
319 if test x$want_eve = xyes; then
320 PKG_CHECK_MODULES([libxml2], libxml-2.0)
321 PKG_CHECK_MODULES([libcurl], libcurl)
322 conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
323 conky_LIBS="$conky_LIBS $libxml2_LIBS $libcurl_LIBS"
324 AC_DEFINE(EVE, 1, [Define if you want Eve-Online Skill monitor support])
325 AC_DEFINE(EVEURL_TRAINING, "http://api.eve-online.com/char/SkillInTraining.xml.aspx", [Eve training URL])
326 AC_DEFINE(EVEURL_SKILLTREE, "http://api.eve-online.com/eve/Skilltree.xml.aspx", [Eve skilltree URL])
327 AC_DEFINE(MY_ENCODING, "ISO-8859-1", [Textencoding to use])
328 AC_DEFINE(EVE_OUTPUT_FORMAT, "%s %d in %s", [Eve output format])
336 AC_HELP_STRING([--enable-rss], [enable if you want rss support @<:@default=no@:>@]),
337 [want_rss="$enableval"], [want_rss=no])
339 AM_CONDITIONAL(BUILD_RSS, test x$want_rss = xyes)
340 if test x$want_rss = xyes; then
342 PKG_CHECK_MODULES([libxml2], libxml-2.0)
343 PKG_CHECK_MODULES([libcurl], libcurl)
344 conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS $libcurl_CFLAGS"
345 conky_LIBS="$conky_LIBS $libxml2_LIBS $libcurl_LIBS"
346 AC_DEFINE(RSS, 1, [Define if you want rss support])
353 AC_ARG_ENABLE([weather],
354 AC_HELP_STRING([--enable-weather], [enable if you want weather support @<:@default=no@:>@]),
355 [want_weather="$enableval"], [want_weather=no])
357 AC_ARG_ENABLE([xoap],
358 AC_HELP_STRING([--enable-xoap], [enable if you want weather xoap support @<:@default=no@:>@]),
359 [want_xoap="$enableval"], [want_xoap=no])
361 AM_CONDITIONAL(BUILD_WEATHER, test x$want_weather = xyes)
362 if test x$want_weather = xyes; then
363 AM_CONDITIONAL(BUILD_XOAP, test x$want_xoap = xyes)
364 if test x$want_xoap = xyes; then
365 PKG_CHECK_MODULES([libxml2], libxml-2.0)
366 conky_CFLAGS="$conky_CFLAGS $libxml2_CFLAGS"
367 conky_LIBS="$conky_LIBS $libxml2_LIBS"
368 AC_DEFINE(XOAP, 1, [Define if you want weather xoap support])
369 AC_DEFINE(XOAP_FILE, "$HOME/.xoaprc", [User xoap keys file])
371 PKG_CHECK_MODULES([libcurl], libcurl)
372 conky_CFLAGS="$conky_CFLAGS $libcurl_CFLAGS"
373 conky_LIBS="$conky_LIBS $libcurl_LIBS"
374 AC_DEFINE(WEATHER, 1, [Define if you want weather support])
382 AC_HELP_STRING([--disable-x11], [disable if you do not want X11 support @<:@default=yes@:>@]),
383 [want_x11="$enableval"], [want_x11=yes])
385 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
386 if test "x$want_x11" = "xyes"; then
387 if $PKG_CONFIG --exists x11; then
388 PKG_CHECK_MODULES([X11], [x11])
389 conky_CFLAGS="$conky_CFLAGS $X11_CFLAGS"
390 conky_LIBS="$conky_LIBS $X11_LIBS"
392 dnl non-modular X11 installations
395 conky_CFLAGS="$conky_CFLAGS $X_CFLAGS"
396 conky_LIBS="$conky_LIBS $X_LIBS"
397 conky_LDFLAGS="$conky_LDFLAGS $conky_LIBS $X_PRE_LIBS"
398 if test "x$no_x" = "xyes"; then
399 AC_MSG_ERROR([Can't locate your X11 installation])
401 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
403 AC_DEFINE(X11, 1, [Define if you want to use X11])
410 AC_ARG_ENABLE([imlib2],
411 AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support (also enables Lua Imlib2 support if lua-extras enabled) [[default=no]]]),
412 [want_imlib2="$enableval"], [want_imlib2=no])
413 if test x$want_imlib2 = xyes; then
414 if test "x$want_x11" != "xyes"; then
415 dnl silently disable if no x11
418 PKG_CHECK_MODULES([Imlib2], [imlib2])
419 conky_CFLAGS="$conky_CFLAGS $Imlib2_CFLAGS"
420 conky_LIBS="$conky_LIBS $Imlib2_LIBS"
421 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
424 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
431 AC_HELP_STRING([--enable-lua], [enable if you want Lua scripting support @<:@default=yes@:>@]),
432 [want_lua="$enableval"], [want_lua=yes])
433 AC_ARG_ENABLE([lua-extras],
434 AC_HELP_STRING([--enable-lua-extras], [enable if you want to install Lua extras (including bindings) @<:@default=no@:>@]),
435 [want_lua_extras="$enableval"], [want_lua_extras=no])
436 AC_ARG_ENABLE([lua-cairo],
437 AC_HELP_STRING([--enable-lua-cairo], [enable if you want Lua Cairo bindings for Conky (requires lua-extras enabled) @<:@default=no@:>@]),
438 [want_lua_cairo="$enableval"], [want_lua_cairo=no])
441 AM_CONDITIONAL(BUILD_LUA, test x$want_lua = xyes)
442 if test x$want_lua = xyes; then
443 PKG_CHECK_MODULES(LUA, lua >= 5.1, [ ],[
444 PKG_CHECK_MODULES(LUA51, lua-5.1 >= 5.1, [ ],[
445 PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1)
448 conky_CFLAGS="$conky_CFLAGS $LUA_CFLAGS $LUA51_CFLAGS"
449 conky_LIBS="$conky_LIBS $LUA_LIBS $LUA51_LIBS"
451 want_lua_imlib2="$want_imlib2"
452 if test x$want_lua_extras != xyes; then
456 AC_CHECK_PROG(HAVE_TOLUAPP, tolua++, yes, no)
457 if test "x$want_x11" != "xyes"; then
458 dnl silently disable if no x11
461 if test x$want_lua_cairo = xyes; then
462 PKG_CHECK_MODULES([cairo], cairo)
463 PKG_CHECK_MODULES([cairo_xlib], cairo-xlib)
464 if test x"$HAVE_TOLUAPP" = x"no"; then
465 AC_MSG_ERROR([tolua++ is required for Lua Cairo support.])
467 AC_CHECK_PROGS(toluapp, tolua++)
468 AC_DEFINE(HAVE_LUA_CAIRO, 1, [Define if you want Lua Cairo bindings for Conky])
470 libcairo_CFLAGS="$libcairo_CFLAGS $cairo_CFLAGS $cairo_xlib_CFLAGS"
471 libcairo_LIBS="$libcairo_LIBS $cairo_LIBS $cairo_xlib_LIBS"
473 if test x$want_imlib2 = xyes; then
474 if test x"$HAVE_TOLUAPP" = x"no"; then
475 AC_MSG_ERROR([tolua++ is required for Lua Imlib2 support.])
478 AC_CHECK_PROGS(toluapp, tolua++)
479 AC_DEFINE(HAVE_LUA_IMLIB2, 1, [Define if you want Lua Imlib2 bindings for Conky])
484 AC_DEFINE(HAVE_LUA, 1, [Define if you want Lua scripting support])
486 AM_CONDITIONAL(BUILD_LUA_CAIRO, test x$want_lua_cairo = xyes)
487 AM_CONDITIONAL(BUILD_LUA_IMLIB2, test x$want_lua_imlib2 = xyes)
490 dnl Wireless extensions
493 AC_ARG_ENABLE([wlan],
494 AC_HELP_STRING([--enable-wlan], [enable if you want wireless support @<:@default=no@:>@]),
495 [want_wlan="$enableval"], [want_wlan=no])
497 AM_CONDITIONAL(BUILD_WLAN, test x$want_wlan = xyes)
498 if test x$want_wlan = xyes; then
499 AC_CHECK_HEADERS([iwlib.h], [], AC_MSG_ERROR([iwlib.h header not found]))
500 AC_CHECK_LIB([iw], [iw_sockets_open], [conky_LIBS="$conky_LIBS -liw"], AC_MSG_ERROR([iw_sockets_open not found]))
501 AC_DEFINE(HAVE_IWLIB, 1, [Define if you want wireless support])
508 AC_ARG_ENABLE([portmon],
509 AC_HELP_STRING([--disable-portmon],
510 [disable if you do not want tcp (ip4) port monitoring @<:@default=yes@:>@]),
511 [want_portmon="$enableval"], [want_portmon=yes])
513 if test x"$want_portmon" = xyes; then
514 if test x"$uname" != xLinux; then
515 AC_MSG_NOTICE([port monitors not supported on $uname... disabling])
518 AC_CHECK_FUNCS([getnameinfo], [], AC_MSG_ERROR([getnameinfo function not found]))
519 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
520 [PORT_MONITORS_MISSING=yes])
521 if test x"$PORT_MONITORS_MISSING" = xyes; then
522 AC_MSG_ERROR([missing a needed network header for port monitoring])
525 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
528 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x"$want_portmon" = xyes)
536 if test "$am_cv_func_iconv" != yes; then
537 AC_MSG_WARN([Could not find libiconv])
539 conky_LIBS="$conky_LIBS $LIBICONV"
543 dnl Xext Double-buffering Extension
546 AC_ARG_ENABLE([double_buffer],
547 AC_HELP_STRING([--disable-double-buffer],
548 [disable for no Xdbe double-buffering support @<:@default=yes@:>@]),
549 [want_double_buffer="$enableval"], [want_double_buffer=yes])
551 if test "x$want_double_buffer" = "xyes"; then
552 if test "x$want_x11" != "xyes"; then
553 dnl silently disable if no x11
554 want_double_buffer=no
556 if $PKG_CONFIG --exists xext; then
557 PKG_CHECK_MODULES([Xext],[xext])
558 conky_CFLAGS="$conky_CFLAGS $Xext_CFLAGS"
559 conky_LIBS="$conky_LIBS $Xext_LIBS"
561 dnl non-modular X11 installation
562 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [conky_LIBS="$conky_LIBS -lXext"],
563 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
565 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
571 dnl Xdamage Extension
574 AC_ARG_ENABLE([xdamage],
575 AC_HELP_STRING([--disable-xdamage],
576 [disable if you do not want Xdamage support @<:@default=yes@:>@]),
577 [want_xdamage="$enableval"], [want_xdamage=yes])
579 if test "x$want_xdamage" = "xyes"; then
580 if test "x$want_x11" != "xyes"; then
581 dnl silently disable if no x11
584 if $PKG_CONFIG --exists xdamage; then
585 PKG_CHECK_MODULES([XDamage],[xdamage])
586 conky_CFLAGS="$conky_CFLAGS $XDamage_CFLAGS"
587 conky_LIBS="$conky_LIBS $XDamage_LIBS"
589 dnl non-modular X11 installation
590 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [conky_LIBS="$conky_LIBS -lXdamage"],
591 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
593 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
603 AC_HELP_STRING([--disable-xft], [disable if you do not want to use Xft @<:@default=yes@:>@]),
604 [want_xft="$enableval"], [want_xft=yes])
606 if test x$want_xft = "xyes"; then
607 if test "x$want_x11" != "xyes"; then
608 dnl silently disable if no x11
611 PKG_CHECK_MODULES([Xft], [xft])
612 conky_CFLAGS="$conky_CFLAGS $Xft_CFLAGS"
613 conky_LIBS="$conky_LIBS $Xft_LIBS"
614 AC_DEFINE(XFT, 1, [Define for Xft support])
619 dnl NVIDIA libXNVCtrl support
622 AC_ARG_ENABLE([nvidia],
623 AC_HELP_STRING([--enable-nvidia], [enable if you want nvidia support @<:@default=no@:>@]),
624 [want_nvidia="$enableval"], [want_nvidia=no])
625 if test x$want_nvidia = xyes; then
626 if test "x$want_x11" != "xyes"; then
630 AC_CHECK_HEADERS([NVCtrl/NVCtrl.h], [], AC_MSG_ERROR([NVCtrl/NVCtrl.h header not found]))
631 dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLQueryVersion], [] ,[AC_MSG_ERROR([grrr])] )
632 dnl AC_CHECK_LIB([XNVCtrl], [XNVCTRLCheckTargetData], [], [AC_MSG_ERROR([grr])])
633 dnl ## am I Stupid ??
634 dnl ## it won't find the lib for some reason!?
635 conky_LIBS="$conky_LIBS -lXNVCtrl"
636 AC_DEFINE(NVIDIA, 1, [Define if you want nvidia support])
639 AM_CONDITIONAL(BUILD_NVIDIA, test x$want_nvidia = xyes)
645 if test x$WANT_GLIB = xyes; then
646 PKG_CHECK_MODULES([GLib2], [glib-2.0])
647 conky_CFLAGS="$conky_CFLAGS $GLib2_CFLAGS"
648 conky_LIBS="$conky_LIBS $GLib2_LIBS"
655 if test x$WANT_KVM = xyes; then
656 AC_CHECK_LIB(kvm, kvm_open,
657 conky_LIBS="$conky_LIBS -lkvm",
658 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
666 if test x$WANT_DEVSTAT = xyes; then
667 AC_CHECK_LIB(devstat, devstat_getversion,
668 conky_LIBS="$conky_LIBS -ldevstat",
669 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
674 dnl OSSLIB for NetBSD/OpenBSD
677 if test x$WANT_OSSLIB = xyes; then
678 AC_CHECK_LIB(ossaudio, _oss_ioctl,
679 conky_LIBS="$conky_LIBS -lossaudio",
680 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
687 AC_ARG_ENABLE([alsa],
688 AC_HELP_STRING([--disable-alsa], [disable if you do not
689 want ALSA support @<:@default=yes@:>@]),
690 [want_alsa="$enableval"], [want_alsa=yes])
692 if test x$want_alsa = xyes; then
693 AC_CHECK_HEADER(alsa/asoundlib.h,, want_alsa=no)
695 if test x$want_alsa = xyes; then
696 AC_CHECK_LIB(asound, snd_pcm_open,conky_LIBS="$conky_LIBS -lasound", want_alsa=no)
698 if test x$want_alsa = xyes; then
699 AC_DEFINE(MIXER_IS_ALSA, 1, [Define if the mixers use ALSA])
705 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h alsa/asoundlib.h dirent.h mcheck.h \
706 sys/statfs.h sys/param.h pthread.h assert.h errno.h time.h])
707 AC_CHECK_HEADERS([sys/mount.h], [], [],
708 [#ifdef HAVE_SYS_PARAM_H
709 #include <sys/param.h>
712 # check if we have inotify support
713 AC_CHECK_HEADERS([sys/inotify.h])
719 AC_DEFINE(DEFAULTNETDEV, "eth0", [Default networkdevice])
720 AC_DEFINE(CONFIG_FILE, "$HOME/.conkyrc", [Configfile of the user])
721 AC_DEFINE(MAX_SPECIALS_DEFAULT, 512, [Default maximum number of special things, e.g. fonts, offsets, aligns, etc.])
722 AC_DEFINE(MAX_USER_TEXT_DEFAULT, 16384, [Default maximum size of config TEXT buffer, i.e. below TEXT line.])
723 AC_DEFINE(DEFAULT_TEXT_BUFFER_SIZE, 256, [Default size used for temporary, static text buffers])
729 AC_CHECK_FUNCS([calloc malloc free popen sysinfo getloadavg memrchr strndup gethostbyname_r])
730 AC_SEARCH_LIBS(clock_gettime, [rt], conky_LIBS="$conky_LIBS -lrt"
731 [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])],
732 [AC_CHECK_FUNCS([gettimeofday], [], [AC_MSG_ERROR([gettimeofday() not available!])])], [])
738 AC_CHECK_MEMBER([struct statfs.f_fstypename],
739 [AC_DEFINE(HAVE_STRUCT_STATFS_F_FSTYPENAME, 1, [Define if struct statfs has the f_fstypename member])],
741 [#include <sys/statfs.h>])
747 AC_CHECK_HEADER(zlib.h,
749 [AC_MSG_ERROR([zlib is missing; please install the headers first])])
753 dnl Check for OpenMP support
756 AC_ARG_ENABLE([openmp],
757 AC_HELP_STRING([--enable-openmp], [enable if you want OpenMP support @<:@default=no@:>@]),
758 [want_openmp="$enableval"], [want_openmp=no])
760 if test x$want_openmp = xyes; then
762 gcc_version=`$CC -dumpversion`
763 gcc_major=`echo $gcc_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
764 gcc_minor=`echo $gcc_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
765 dnl check that the gcc version is >=4.3, if we're using gcc
766 if test ! "x$GCC" = "xyes" -o $gcc_major -ge 4 -a $gcc_minor -ge 3; then
767 AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])
768 conky_CFLAGS="$conky_CFLAGS $OPENMP_CFLAGS"
780 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
781 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
782 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
783 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
784 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
786 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
793 if test x$WANT_KSTAT = xyes; then
795 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
797 if test x$dah = xyes; then
798 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
799 conky_LDFLAGS="$conky_LDFLAGS -lkstat"
803 AC_DEFUN([AM_LANGINFO_CODESET],
805 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
806 [AC_TRY_LINK([#include <langinfo.h>],
807 [char* cs = nl_langinfo(CODESET);],
808 am_cv_langinfo_codeset=yes,
809 am_cv_langinfo_codeset=no)
811 if test $am_cv_langinfo_codeset = yes; then
812 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
813 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
818 dnl ************************
819 dnl * Linker optimizations *
820 dnl ************************
821 AC_MSG_CHECKING([if $LD accepts -O1])
822 case `$LD -O1 -v 2>&1 </dev/null` in
824 conky_LDFLAGS="$conky_LDFLAGS -Wl,-O1"
832 dnl Solve multiple definitions (only necessary when gnulib is used)
833 dnl conky_LDFLAGS="$conky_LDFLAGS -Xlinker -zmuldefs"
839 conky_CFLAGS="$conky_CFLAGS -Wall -W"
845 AC_ARG_ENABLE([debug],
846 AC_HELP_STRING([--enable-debug], [compile with debug symbols @<:@default=no@:>@]),
847 [want_debug="$enableval"], [want_debug=no])
849 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
850 conky_CFLAGS="$conky_CFLAGS -g3"
851 AC_DEFINE([DEBUG], 1, [Define for debugging])
858 AC_ARG_ENABLE([testing],
859 AC_HELP_STRING([--enable-testing], [use strict compiler flags for testing @<:@default=no@:>@]),
860 [want_testing="$enableval"], [want_testing=no])
862 if test "x$want_testing" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
863 if test "x$want_debug" = "xyes"; then
864 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"
865 AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
867 conky_CFLAGS="$conky_CFLAGS -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"
868 AC_DEFINE([TESTING], [], [Define for testing (enables strict compiler flags)])
872 AC_SUBST(conky_CFLAGS)
883 $PACKAGE $VERSION configured successfully:
885 Installing into: $prefix
886 System config dir: $sysconfdir
887 C compiler flags: $conky_CFLAGS
888 Libraries: $conky_LIBS
889 Linker flags: $conky_LDFLAGS
892 X11 support: $want_x11
893 XDamage support: $want_xdamage
894 XDBE support: $want_double_buffer
895 Xft support: $want_xft
898 Audacious: $want_audacious
907 hddtemp: $want_hddtemp
908 portmon: $want_portmon
910 Weather (METAR): $want_weather
914 eve-online: $want_eve
915 config-output: $want_config_output
917 ALSA mixer: $want_alsa
918 apcupsd: $want_apcupsd
919 I/O stats: $want_iostats
921 * Lua ($want_lua) bindings:
922 Cairo: $want_lua_cairo
923 Imlib2: $want_lua_imlib2