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 [svn] for versions with svn revision numbers, e.g. 1.4.5-svn-r00790
9 dnl [rc1] for release candidates, e.g. 1.4.5-rc1
10 dnl [] for releases, e.g. 1.4.5
11 m4_define([conky_version_tag], [svn])
13 m4_define([conky_version_revision],[r@REVISION@])
14 m4_define([conky_version],
15 [conky_version_major().conky_version_minor().conky_version_micro()ifelse(
16 conky_version_tag(), [svn],
17 [-conky_version_tag()-conky_version_revision()],
18 [ifelse(conky_version_tag(), [], [], [-conky_version_tag()])])])
20 AC_INIT([Conky], [conky_version()], [brenden1@users.sourceforge.net])
22 AM_INIT_AUTOMAKE(conky, conky_version())
23 AM_CONFIG_HEADER(src/config.h)
28 dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
29 dnl libtool must be deleted with make distclean to see this fix.
30 if test x"$CFLAGS" = x""; then
36 PKG_PROG_PKG_CONFIG([0.17.2])
66 # Solaris doesn't work at all right now
72 echo "Your operating system $uname isn't supported"
73 echo "Feel free to help. :P"
78 AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
79 #AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
80 AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
81 #AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
82 # AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
84 BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
85 BUILD_ARCH="$(uname -sr) ($(uname -m))"
94 AC_ARG_ENABLE([own_window],
95 AC_HELP_STRING([--enable-own-window], [enable if you want support for creating own window [[default=yes]]]),
96 [dah="$enableval"], [dah=yes])
98 if test $dah != "no"; then
99 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
103 dnl PROC_UPTIME option
106 AC_ARG_ENABLE([proc_uptime],
107 AC_HELP_STRING([--enable-proc-uptime], [enable using /proc/uptime for uptime [[default=yes]]]),
108 [dah="$enableval"], [dah=yes])
110 if test $dah = "yes"; then
111 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
116 dnl Audacious Media Player
119 AC_ARG_ENABLE([audacious],
120 AC_HELP_STRING([--enable-audacious], [enable audacious player support [[default=no]]]),
121 [want_audacious="$enableval"], [want_audacious=no])
123 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
124 if test x$want_audacious = xyes; then
125 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1])
126 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
127 LIBS="$LIBS $AUDACIOUS_LIBS"
128 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
136 AC_ARG_ENABLE([bmpx],
137 AC_HELP_STRING([--enable-bmpx], [enable if you want BMPx support [[default=no]]]),
138 [want_bmpx="$enableval"], [want_bmpx=no])
140 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
141 if test x$want_bmpx = xyes; then
142 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
143 CFLAGS="$CFLAGS $BMPX_CFLAGS"
144 LIBS="$LIBS $BMPX_LIBS"
145 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
153 AC_ARG_ENABLE([hddtemp],
154 AC_HELP_STRING([--enable-hddtemp], [enable if you want hddtemp support [[default=yes]]]),
155 [want_hddtemp="$enableval"], [want_hddtemp=yes])
157 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
158 if test x$want_hddtemp = xyes; then
159 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
167 AC_HELP_STRING([--enable-mpd], [enable if you want MPD support [[default=yes]]]),
168 [want_mpd="$enableval"], [want_mpd=yes])
170 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
171 if test x$want_mpd = xyes; then
172 AC_DEFINE(MPD, 1, [Define if you want MPD support])
179 AC_ARG_ENABLE([xmms2],
180 AC_HELP_STRING([--enable-xmms2], [enable if you want XMMS2 support [[default=no]]]),
181 [want_xmms2="$enableval"], [want_xmms2=no])
183 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
184 if test x$want_xmms2 = xyes; then
185 PKG_CHECK_MODULES([XMMS2], [xmms2-client])
186 CFLAGS="$CFLAGS $XMMS2_CFLAGS"
187 LIBS="$LIBS $XMMS2_LIBS"
188 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
196 dnl --commented out until brenden finishes it --
197 dnl AC_ARG_ENABLE([imlib2],
198 dnl AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
199 dnl [want_imlib2="$enableval"], [want_imlib2=no])
201 dnl AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
202 dnl if test x$want_imlib2 = xyes; then
203 dnl PKG_CHECK_MODULES([Imlib2], [imlib2])
204 dnl CFLAGS="$CFLAGS $Imlib2_CFLAGS"
205 dnl LIBS="$LIBS $Imlib2_LIBS"
206 dnl AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
213 AC_ARG_ENABLE([portmon],
214 AC_HELP_STRING([--enable-portmon], [enable if you want tcp (ip4) port monitoring [[default=yes]]]),
215 [want_portmon="$enableval"], [want_portmon=yes])
217 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
218 if test x$want_portmon = xyes; then
219 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
220 [PORT_MONITORS_MISSING=yes])
221 if test "x$PORT_MONITORS_MISSING" = xyes; then
222 AC_MSG_ERROR([missing a needed network header for port monitoring])
224 PKG_CHECK_MODULES([GLIB], [glib-2.0])
225 CFLAGS="$CFLAGS $GLIB_CFLAGS"
226 LIBS="$LIBS $GLIB_LIBS"
227 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
236 if test "$am_cv_func_iconv" != yes; then
237 AC_MSG_WARN([Could not find libiconv])
239 LIBS="$LIBS $LIBICONV"
246 AC_ARG_ENABLE([debug],
247 AC_HELP_STRING([--enable-debug], [compile with debug symbols [[default=no]]]),
248 [want_debug="$enableval"], [want_debug=no])
250 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
259 AC_HELP_STRING([--enable-x11], [enable if you want X11 support [[default=yes]]]),
260 [want_x11="$enableval"], [want_x11=yes])
262 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
263 if test "x$want_x11" = "xyes"; then
264 if $PKG_CONFIG --exists x11; then
265 PKG_CHECK_MODULES([X11], [x11])
266 CFLAGS="$CFLAGS $X11_CFLAGS"
267 LIBS="$LIBS $X11_LIBS"
269 dnl non-modular X11 installations
272 CFLAGS="$CFLAGS $X_CFLAGS"
274 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
275 if test "x$no_x" = "xyes"; then
276 AC_MSG_ERROR([Can't locate your X11 installation])
278 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
280 AC_DEFINE(X11, 1, [Define if you want to use X11])
285 dnl Xext Double-buffering Extension
288 AC_ARG_ENABLE([double_buffer],
289 AC_HELP_STRING([--enable-double-buffer], [enable for flicker-free operation [[default=yes]]]),
290 [want_double_buffer="$enableval"], [want_double_buffer=yes])
292 if test "x$want_double_buffer" = "xyes"; then
293 if test "x$want_x11" != "xyes"; then
294 AC_MSG_ERROR([--enable-x11 is required for double-buffering])
296 if $PKG_CONFIG --exists xext; then
297 PKG_CHECK_MODULES([XEXT],[xext])
298 CFLAGS="$CFLAGS $XEXT_CFLAGS"
299 LIBS="$LIBS $XEXT_LIBS"
301 dnl non-modular X11 installation
302 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [LIBS="$LIBS -lXext"],
303 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
305 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
310 dnl Xdamage Extension
313 AC_ARG_ENABLE([xdamage],
314 AC_HELP_STRING([--enable-xdamage], [enable if you want Xdamage support [[default=yes]]]),
315 [want_xdamage="$enableval"], [want_xdamage=yes])
317 if test "x$want_xdamage" = "xyes"; then
318 if test "x$want_x11" != "xyes"; then
319 AC_MSG_ERROR([--enable-x11 is required for xdamage])
321 if $PKG_CONFIG --exists xdamage; then
322 PKG_CHECK_MODULES([XDAMAGE],[xdamage])
323 CFLAGS="$CFLAGS $XDAMAGE_CFLAGS"
324 LIBS="$LIBS $XDAMAGE_LIBS"
326 dnl non-modular X11 installation
327 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [LIBS="$LIBS -lXdamage"],
328 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
330 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
339 AC_HELP_STRING([--enable-xft], [enable if you want to use Xft [[default=yes]]]),
340 [want_xft="$enableval"], [want_xft=yes])
342 if test x$want_xft = "xyes"; then
343 if test "x$want_x11" != "xyes"; then
344 AC_MSG_ERROR([--enable-x11 is required for xft])
346 PKG_CHECK_MODULES(XFT, [xft])
347 CFLAGS="$CFLAGS $XFT_CFLAGS"
348 LIBS="$LIBS $XFT_LIBS"
349 AC_DEFINE(XFT, 1, [Define for Xft support])
357 if test x$WANT_KVM = xyes; then
358 AC_CHECK_LIB(kvm, kvm_open,
360 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
368 if test x$WANT_DEVSTAT = xyes; then
369 AC_CHECK_LIB(devstat, devstat_getversion,
370 LIBS="$LIBS -ldevstat",
371 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
376 dnl OSSLIB for NetBSD/OpenBSD
379 if test x$WANT_OSSLIB = xyes; then
380 AC_CHECK_LIB(ossaudio, _oss_ioctl,
381 LIBS="$LIBS -lossaudio",
382 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
390 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h \
391 sys/statfs.h sys/param.h pthread.h assert.h errno.h time.h])
392 AC_CHECK_HEADERS([sys/mount.h], [], [],
393 [#ifdef HAVE_SYS_PARAM_H
394 #include <sys/param.h>
401 AC_CHECK_FUNCS([calloc malloc free popen])
402 AC_SEARCH_LIBS(clock_gettime, [rt], [], AC_MSG_ERROR([clock_gettime() not found]))
409 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
410 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
411 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
412 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
413 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
415 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
422 if test x$WANT_SYSINFO = xyes; then
424 AC_MSG_CHECKING(for sysinfo)
426 [#include <sys/types.h>
427 #include <sys/sysinfo.h>],
428 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
429 [AC_MSG_RESULT(yes); dah=yes],
430 [AC_MSG_RESULT(not usable); dah=no])
432 if test x$dah = xyes; then
433 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
441 if test x$WANT_KSTAT = xyes; then
443 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
445 if test x$dah = xyes; then
446 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
447 LDFLAGS="$LDFLAGS -lkstat"
451 AC_DEFUN([AM_LANGINFO_CODESET],
453 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
454 [AC_TRY_LINK([#include <langinfo.h>],
455 [char* cs = nl_langinfo(CODESET);],
456 am_cv_langinfo_codeset=yes,
457 am_cv_langinfo_codeset=no)
459 if test $am_cv_langinfo_codeset = yes; then
460 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
461 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
469 AC_MSG_CHECKING(for getloadavg)
471 [#include <stdlib.h>],
472 [double v[3]; getloadavg(v, 3);],
474 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
482 CFLAGS="$CFLAGS -Wall -W"
494 $PACKAGE $VERSION configured successfully:
496 Installing into: $prefix
497 C compiler flags: $CFLAGS
498 Linker flags: $LDFLAGS
502 x11 support: $want_x11
503 xdamage support: $want_xdamage
504 xdbe support: $want_double_buffer
505 xft support: $want_xft
508 audacious: $want_audacious
514 hddtemp: $want_hddtemp
515 portmon: $want_portmon