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))"
75 AC_ARG_ENABLE([own_window],
76 AC_HELP_STRING([--enable-own-window], [enable if you want support for creating own window [[default=yes]]]),
77 [dah="$enableval"], [dah=yes])
79 if test $dah != "no"; then
80 AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
84 dnl PROC_UPTIME option
87 AC_ARG_ENABLE([proc_uptime],
88 AC_HELP_STRING([--enable-proc-uptime], [enable using /proc/uptime for uptime [[default=yes]]]),
89 [dah="$enableval"], [dah=yes])
91 if test $dah = "yes"; then
92 AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
97 dnl Audacious Media Player
100 AC_ARG_ENABLE([audacious],
101 AC_HELP_STRING([--enable-audacious], [enable audacious player support [[default=no]]]),
102 [want_audacious="$enableval"], [want_audacious=no])
104 AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
105 if test x$want_audacious = xyes; then
106 PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1])
107 CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
108 LIBS="$LIBS $AUDACIOUS_LIBS"
109 AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
117 AC_ARG_ENABLE([bmpx],
118 AC_HELP_STRING([--enable-bmpx], [enable if you want BMPx support [[default=no]]]),
119 [want_bmpx="$enableval"], [want_bmpx=no])
121 AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
122 if test x$want_bmpx = xyes; then
123 PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
124 CFLAGS="$CFLAGS $BMPX_CFLAGS"
125 LIBS="$LIBS $BMPX_LIBS"
126 AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
134 AC_ARG_ENABLE([hddtemp],
135 AC_HELP_STRING([--enable-hddtemp], [enable if you want hddtemp support [[default=yes]]]),
136 [want_hddtemp="$enableval"], [want_hddtemp=yes])
138 AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
139 if test x$want_hddtemp = xyes; then
140 AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
148 AC_HELP_STRING([--enable-mpd], [enable if you want MPD support [[default=yes]]]),
149 [want_mpd="$enableval"], [want_mpd=yes])
151 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
152 if test x$want_mpd = xyes; then
153 AC_DEFINE(MPD, 1, [Define if you want MPD support])
160 AC_ARG_ENABLE([xmms2],
161 AC_HELP_STRING([--enable-xmms2], [enable if you want XMMS2 support [[default=no]]]),
162 [want_xmms2="$enableval"], [want_xmms2=no])
164 AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
165 if test x$want_xmms2 = xyes; then
166 PKG_CHECK_MODULES([XMMS2], [xmms2-client])
167 CFLAGS="$CFLAGS $XMMS2_CFLAGS"
168 LIBS="$LIBS $XMMS2_LIBS"
169 AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
177 AC_ARG_ENABLE([imlib2],
178 AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
179 [want_imlib2="$enableval"], [want_imlib2=no])
181 AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
182 if test x$want_imlib2 = xyes; then
183 PKG_CHECK_MODULES([Imlib2], [imlib2])
184 CFLAGS="$CFLAGS $Imlib2_CFLAGS"
185 LIBS="$LIBS $Imlib2_LIBS"
186 AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
193 AC_ARG_ENABLE([portmon],
194 AC_HELP_STRING([--enable-portmon], [enable if you want tcp (ip4) port monitoring [[default=yes]]]),
195 [want_portmon="$enableval"], [want_portmon=yes])
197 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
198 if test x$want_portmon = xyes; then
199 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
200 [PORT_MONITORS_MISSING=yes])
201 if test "x$PORT_MONITORS_MISSING" = xyes; then
202 AC_MSG_ERROR([missing a needed network header for port monitoring])
204 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
213 if test "$am_cv_func_iconv" != yes; then
214 AC_MSG_WARN([Could not find libiconv])
216 LIBS="$LIBS $LIBICONV"
223 AC_ARG_ENABLE([debug],
224 AC_HELP_STRING([--enable-debug], [compile with debug symbols [[default=no]]]),
225 [want_debug="$enableval"], [want_debug=no])
227 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
236 AC_HELP_STRING([--enable-x11], [enable if you want X11 support [[default=yes]]]),
237 [want_x11="$enableval"], [want_x11=yes])
239 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
240 if test "x$want_x11" = "xyes"; then
241 PKG_CHECK_MODULES([X11], [x11])
242 CFLAGS="$CFLAGS $X11_CFLAGS"
243 LIBS="$LIBS $X11_LIBS"
244 AC_DEFINE(X11, 1, [Define if you want to use X11])
249 dnl Xext Double-buffering Extension
252 AC_ARG_ENABLE([double_buffer],
253 AC_HELP_STRING([--enable-double-buffer], [enable for flicker-free operation [[default=yes]]]),
254 [want_double_buffer="$enableval"], [want_double_buffer=yes])
256 if test "x$want_double_buffer" = "xyes"; then
257 if test "x$want_x11" != "xyes"; then
258 AC_MSG_ERROR([--enable-x11 is required for double-buffering])
260 PKG_CHECK_MODULES([XEXT],[xext])
261 CFLAGS="$CFLAGS $XEXT_CFLAGS"
262 LIBS="$LIBS $XEXT_LIBS"
263 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
268 dnl Xdamage Extension
271 AC_ARG_ENABLE([xdamage],
272 AC_HELP_STRING([--enable-xdamage], [enable if you want Xdamage support [[default=yes]]]),
273 [want_xdamage="$enableval"], [want_xdamage=yes])
275 if test "x$want_xdamage" = "xyes"; then
276 if test "x$want_x11" != "xyes"; then
277 AC_MSG_ERROR([--enable-x11 is required for xdamage])
279 PKG_CHECK_MODULES([XDAMAGE],[xdamage])
280 CFLAGS="$CFLAGS $XDAMAGE_CFLAGS"
281 LIBS="$LIBS $XDAMAGE_LIBS"
282 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
291 AC_HELP_STRING([--enable-xft], [enable if you want to use Xft [[default=yes]]]),
292 [want_xft="$enableval"], [want_xft=yes])
294 if test x$want_xft = "xyes"; then
295 if test "x$want_x11" != "xyes"; then
296 AC_MSG_ERROR([--enable-x11 is required for xft])
298 PKG_CHECK_MODULES(XFT, [xft])
299 CFLAGS="$CFLAGS $XFT_CFLAGS"
300 LIBS="$LIBS $XFT_LIBS"
301 AC_DEFINE(XFT, 1, [Define for Xft support])
309 if test x$WANT_KVM = xyes; then
310 AC_CHECK_LIB(kvm, kvm_open,
312 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
320 if test x$WANT_DEVSTAT = xyes; then
321 AC_CHECK_LIB(devstat, devstat_getversion,
322 LIBS="$LIBS -ldevstat",
323 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
328 dnl OSSLIB for NetBSD/OpenBSD
331 if test x$WANT_OSSLIB = xyes; then
332 AC_CHECK_LIB(ossaudio, _oss_ioctl,
333 LIBS="$LIBS -lossaudio",
334 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
339 dnl Some random headers
343 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
344 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
345 AC_CHECK_HEADERS([sys/mount.h], [], [],
346 [#ifdef HAVE_SYS_PARAM_H
347 #include <sys/param.h>
355 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
356 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
357 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
358 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
359 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
361 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
368 if test x$WANT_SYSINFO = xyes; then
370 AC_MSG_CHECKING(for sysinfo)
372 [#include <sys/types.h>
373 #include <sys/sysinfo.h>],
374 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
375 [AC_MSG_RESULT(yes); dah=yes],
376 [AC_MSG_RESULT(not usable); dah=no])
378 if test x$dah = xyes; then
379 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
387 if test x$WANT_KSTAT = xyes; then
389 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
391 if test x$dah = xyes; then
392 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
393 LDFLAGS="$LDFLAGS -lkstat"
397 AC_DEFUN([AM_LANGINFO_CODESET],
399 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
400 [AC_TRY_LINK([#include <langinfo.h>],
401 [char* cs = nl_langinfo(CODESET);],
402 am_cv_langinfo_codeset=yes,
403 am_cv_langinfo_codeset=no)
405 if test $am_cv_langinfo_codeset = yes; then
406 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
407 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
415 AC_MSG_CHECKING(for getloadavg)
417 [#include <stdlib.h>],
418 [double v[3]; getloadavg(v, 3);],
420 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
427 AC_CHECK_FUNCS(popen)
433 CFLAGS="$CFLAGS -Wall -W"
445 $PACKAGE $VERSION configured successfully:
447 Installing into: $prefix
448 C compiler flags: $CFLAGS
449 Linker flags: $LDFLAGS
453 x11 support: $want_x11
454 xdamage support: $want_xdamage
455 xdbe support: $want_double_buffer
456 xft support: $want_xft
459 audacious: $want_audacious
465 hddtemp: $want_hddtemp
466 portmon: $want_portmon