3 dnl major, minor and micro version macros.
4 m4_define([conky_version_major], [1])
5 m4_define([conky_version_minor], [4])
6 m4_define([conky_version_micro], [5])
8 dnl conky_version_tag() macro. change [svn] to [] for releases.
9 m4_define([conky_version_tag], [svn])
11 m4_define([conky_version_revision],[r@REVISION@])
12 m4_define([conky_version],
13 [conky_version_major().conky_version_minor().conky_version_micro()ifelse(
14 conky_version_tag(), [svn],
15 [-conky_version_tag()-conky_version_revision()],
16 [-conky_version_tag()])])
18 AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net])
20 AM_INIT_AUTOMAKE(conky, conky_version())
21 AM_CONFIG_HEADER(src/config.h)
26 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
27 dnl libtool must be deleted with make distclean to see this fix.
28 if test x"$CFLAGS" = x""; then
34 PKG_PROG_PKG_CONFIG([0.17.2])
64 # Solaris doesn't work at all right now
70 echo "Your operating system $uname isn't supported"
71 echo "Feel free to help. :P"
76 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
77 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
78 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
79 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
80 # AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
82 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
83 BUILD_ARCH="$(uname -sr) ($(uname -m))"
92 AC_ARG_ENABLE([own_window],
93 AC_HELP_STRING([--enable-own-window], [enable if you want support for creating own window [[default=yes]]]),
94 [dah="$enableval"], [dah=yes])
96 if test $dah != "no"; then
97 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
101 dnl PROC_UPTIME option
104 AC_ARG_ENABLE([proc_uptime],
105 AC_HELP_STRING([--enable-proc-uptime], [enable using /proc/uptime for uptime [[default=yes]]]),
106 [dah="$enableval"], [dah=yes])
108 if test $dah = "yes"; then
109 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
114 dnl Audacious Media Player
117 AC_ARG_ENABLE([audacious],
118 AC_HELP_STRING([--enable-audacious], [enable audacious player support [[default=no]]]),
119 [want_audacious="$enableval"], [want_audacious=no])
121 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
122 if test x$want_audacious = xyes; then
123 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1])
124 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
125 LIBS="$LIBS $AUDACIOUS_LIBS"
126 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
134 AC_ARG_ENABLE([bmpx],
135 AC_HELP_STRING([--enable-bmpx], [enable if you want BMPx support [[default=no]]]),
136 [want_bmpx="$enableval"], [want_bmpx=no])
138 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
139 if test x$want_bmpx = xyes; then
140 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
141 CFLAGS="$CFLAGS $BMPX_CFLAGS"
142 LIBS="$LIBS $BMPX_LIBS"
143 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
151 AC_ARG_ENABLE([hddtemp],
152 AC_HELP_STRING([--enable-hddtemp], [enable if you want hddtemp support [[default=yes]]]),
153 [want_hddtemp="$enableval"], [want_hddtemp=yes])
155 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
156 if test x$want_hddtemp = xyes; then
157 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
165 AC_HELP_STRING([--enable-mpd], [enable if you want MPD support [[default=yes]]]),
166 [want_mpd="$enableval"], [want_mpd=yes])
168 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
169 if test x$want_mpd = xyes; then
170 AC_DEFINE(MPD, 1, [Define if you want MPD support])
177 AC_ARG_ENABLE([xmms2],
178 AC_HELP_STRING([--enable-xmms2], [enable if you want XMMS2 support [[default=no]]]),
179 [want_xmms2="$enableval"], [want_xmms2=no])
181 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
182 if test x$want_xmms2 = xyes; then
183 PKG_CHECK_MODULES([XMMS2], [xmms2-client])
184 CFLAGS="$CFLAGS $XMMS2_CFLAGS"
185 LIBS="$LIBS $XMMS2_LIBS"
186 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
194 dnl --commented out until brenden finishes it --
195 dnl AC_ARG_ENABLE([imlib2],
196 dnl AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
197 dnl [want_imlib2="$enableval"], [want_imlib2=no])
199 dnl AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
200 dnl if test x$want_imlib2 = xyes; then
201 dnl PKG_CHECK_MODULES([Imlib2], [imlib2])
202 dnl CFLAGS="$CFLAGS $Imlib2_CFLAGS"
203 dnl LIBS="$LIBS $Imlib2_LIBS"
204 dnl AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
211 AC_ARG_ENABLE([portmon],
212 AC_HELP_STRING([--enable-portmon], [enable if you want tcp (ip4) port monitoring [[default=yes]]]),
213 [want_portmon="$enableval"], [want_portmon=yes])
215 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
216 if test x$want_portmon = xyes; then
217 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
218 [PORT_MONITORS_MISSING=yes])
219 if test "x$PORT_MONITORS_MISSING" = xyes; then
220 AC_MSG_ERROR([missing a needed network header for port monitoring])
222 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
231 if test "$am_cv_func_iconv" != yes; then
232 AC_MSG_WARN([Could not find libiconv])
234 LIBS="$LIBS $LIBICONV"
241 AC_ARG_ENABLE([debug],
242 AC_HELP_STRING([--enable-debug], [compile with debug symbols [[default=no]]]),
243 [want_debug="$enableval"], [want_debug=no])
245 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
254 AC_HELP_STRING([--enable-x11], [enable if you want X11 support [[default=yes]]]),
255 [want_x11="$enableval"], [want_x11=yes])
257 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
258 if test "x$want_x11" = "xyes"; then
259 if $PKG_CONFIG --exists x11; then
260 PKG_CHECK_MODULES([X11], [x11])
261 CFLAGS="$CFLAGS $X11_CFLAGS"
262 LIBS="$LIBS $X11_LIBS"
264 dnl non-modular X11 installations
267 CFLAGS="$CFLAGS $X_CFLAGS"
269 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
270 if test "x$no_x" = "xyes"; then
271 AC_MSG_ERROR([Can't locate your X11 installation])
273 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
275 AC_DEFINE(X11, 1, [Define if you want to use X11])
280 dnl Xext Double-buffering Extension
283 AC_ARG_ENABLE([double_buffer],
284 AC_HELP_STRING([--enable-double-buffer], [enable for flicker-free operation [[default=yes]]]),
285 [want_double_buffer="$enableval"], [want_double_buffer=yes])
287 if test "x$want_double_buffer" = "xyes"; then
288 if test "x$want_x11" != "xyes"; then
289 AC_MSG_ERROR([--enable-x11 is required for double-buffering])
291 if $PKG_CONFIG --exists xext; then
292 PKG_CHECK_MODULES([XEXT],[xext])
293 CFLAGS="$CFLAGS $XEXT_CFLAGS"
294 LIBS="$LIBS $XEXT_LIBS"
296 dnl non-modular X11 installation
297 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [LIBS="$LIBS -lXext"],
298 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
300 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
305 dnl Xdamage Extension
308 AC_ARG_ENABLE([xdamage],
309 AC_HELP_STRING([--enable-xdamage], [enable if you want Xdamage support [[default=yes]]]),
310 [want_xdamage="$enableval"], [want_xdamage=yes])
312 if test "x$want_xdamage" = "xyes"; then
313 if test "x$want_x11" != "xyes"; then
314 AC_MSG_ERROR([--enable-x11 is required for xdamage])
316 if $PKG_CONFIG --exists xdamage; then
317 PKG_CHECK_MODULES([XDAMAGE],[xdamage])
318 CFLAGS="$CFLAGS $XDAMAGE_CFLAGS"
319 LIBS="$LIBS $XDAMAGE_LIBS"
321 dnl non-modular X11 installation
322 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [LIBS="$LIBS -lXdamage"],
323 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
325 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
334 AC_HELP_STRING([--enable-xft], [enable if you want to use Xft [[default=yes]]]),
335 [want_xft="$enableval"], [want_xft=yes])
337 if test x$want_xft = "xyes"; then
338 if test "x$want_x11" != "xyes"; then
339 AC_MSG_ERROR([--enable-x11 is required for xft])
341 PKG_CHECK_MODULES(XFT, [xft])
342 CFLAGS="$CFLAGS $XFT_CFLAGS"
343 LIBS="$LIBS $XFT_LIBS"
344 AC_DEFINE(XFT, 1, [Define for Xft support])
352 if test x$WANT_KVM = xyes; then
353 AC_CHECK_LIB(kvm, kvm_open,
355 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
363 if test x$WANT_DEVSTAT = xyes; then
364 AC_CHECK_LIB(devstat, devstat_getversion,
365 LIBS="$LIBS -ldevstat",
366 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
371 dnl OSSLIB for NetBSD/OpenBSD
374 if test x$WANT_OSSLIB = xyes; then
375 AC_CHECK_LIB(ossaudio, _oss_ioctl,
376 LIBS="$LIBS -lossaudio",
377 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
385 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h \
386 sys/statfs.h sys/param.h pthread.h assert.h errno.h time.h])
387 AC_CHECK_HEADERS([sys/mount.h], [], [],
388 [#ifdef HAVE_SYS_PARAM_H
389 #include <sys/param.h>
396 AC_CHECK_FUNCS([calloc malloc free popen])
397 AC_SEARCH_LIBS(clock_gettime, [rt], [], AC_MSG_ERROR([clock_gettime() not found]))
404 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
405 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
406 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
407 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
408 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
410 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
417 if test x$WANT_SYSINFO = xyes; then
419 AC_MSG_CHECKING(for sysinfo)
421 [#include <sys/types.h>
422 #include <sys/sysinfo.h>],
423 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
424 [AC_MSG_RESULT(yes); dah=yes],
425 [AC_MSG_RESULT(not usable); dah=no])
427 if test x$dah = xyes; then
428 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
436 if test x$WANT_KSTAT = xyes; then
438 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
440 if test x$dah = xyes; then
441 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
442 LDFLAGS="$LDFLAGS -lkstat"
446 AC_DEFUN([AM_LANGINFO_CODESET],
448 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
449 [AC_TRY_LINK([#include <langinfo.h>],
450 [char* cs = nl_langinfo(CODESET);],
451 am_cv_langinfo_codeset=yes,
452 am_cv_langinfo_codeset=no)
454 if test $am_cv_langinfo_codeset = yes; then
455 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
456 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
464 AC_MSG_CHECKING(for getloadavg)
466 [#include <stdlib.h>],
467 [double v[3]; getloadavg(v, 3);],
469 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
477 CFLAGS="$CFLAGS -Wall -W"
489 $PACKAGE $VERSION configured successfully:
491 Installing into: $prefix
492 C compiler flags: $CFLAGS
493 Linker flags: $LDFLAGS
497 x11 support: $want_x11
498 xdamage support: $want_xdamage
499 xdbe support: $want_double_buffer
500 xft support: $want_xft
503 audacious: $want_audacious
509 hddtemp: $want_hddtemp
510 portmon: $want_portmon