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 if $PKG_CONFIG --exists x11; then
242 PKG_CHECK_MODULES([X11], [x11])
243 CFLAGS="$CFLAGS $X11_CFLAGS"
244 LIBS="$LIBS $X11_LIBS"
246 dnl non-modular X11 installations
249 CFLAGS="$CFLAGS $X_CFLAGS"
251 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
252 if test "x$no_x" = "xyes"; then
253 AC_MSG_ERROR([Can't locate your X11 installation])
255 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
257 AC_DEFINE(X11, 1, [Define if you want to use X11])
262 dnl Xext Double-buffering Extension
265 AC_ARG_ENABLE([double_buffer],
266 AC_HELP_STRING([--enable-double-buffer], [enable for flicker-free operation [[default=yes]]]),
267 [want_double_buffer="$enableval"], [want_double_buffer=yes])
269 if test "x$want_double_buffer" = "xyes"; then
270 if test "x$want_x11" != "xyes"; then
271 AC_MSG_ERROR([--enable-x11 is required for double-buffering])
273 if $PKG_CONFIG --exists xext; then
274 PKG_CHECK_MODULES([XEXT],[xext])
275 CFLAGS="$CFLAGS $XEXT_CFLAGS"
276 LIBS="$LIBS $XEXT_LIBS"
278 dnl non-modular X11 installation
279 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [LIBS="$LIBS -lXext"],
280 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
282 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
287 dnl Xdamage Extension
290 AC_ARG_ENABLE([xdamage],
291 AC_HELP_STRING([--enable-xdamage], [enable if you want Xdamage support [[default=yes]]]),
292 [want_xdamage="$enableval"], [want_xdamage=yes])
294 if test "x$want_xdamage" = "xyes"; then
295 if test "x$want_x11" != "xyes"; then
296 AC_MSG_ERROR([--enable-x11 is required for xdamage])
298 if $PKG_CONFIG --exists xdamage; then
299 PKG_CHECK_MODULES([XDAMAGE],[xdamage])
300 CFLAGS="$CFLAGS $XDAMAGE_CFLAGS"
301 LIBS="$LIBS $XDAMAGE_LIBS"
303 dnl non-modular X11 installation
304 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [LIBS="$LIBS -lXdamage"],
305 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
307 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
316 AC_HELP_STRING([--enable-xft], [enable if you want to use Xft [[default=yes]]]),
317 [want_xft="$enableval"], [want_xft=yes])
319 if test x$want_xft = "xyes"; then
320 if test "x$want_x11" != "xyes"; then
321 AC_MSG_ERROR([--enable-x11 is required for xft])
323 PKG_CHECK_MODULES(XFT, [xft])
324 CFLAGS="$CFLAGS $XFT_CFLAGS"
325 LIBS="$LIBS $XFT_LIBS"
326 AC_DEFINE(XFT, 1, [Define for Xft support])
334 if test x$WANT_KVM = xyes; then
335 AC_CHECK_LIB(kvm, kvm_open,
337 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
345 if test x$WANT_DEVSTAT = xyes; then
346 AC_CHECK_LIB(devstat, devstat_getversion,
347 LIBS="$LIBS -ldevstat",
348 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
353 dnl OSSLIB for NetBSD/OpenBSD
356 if test x$WANT_OSSLIB = xyes; then
357 AC_CHECK_LIB(ossaudio, _oss_ioctl,
358 LIBS="$LIBS -lossaudio",
359 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
364 dnl Some random headers
368 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
369 AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
370 AC_CHECK_HEADERS([sys/mount.h], [], [],
371 [#ifdef HAVE_SYS_PARAM_H
372 #include <sys/param.h>
380 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
381 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
382 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
383 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
384 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
386 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
393 if test x$WANT_SYSINFO = xyes; then
395 AC_MSG_CHECKING(for sysinfo)
397 [#include <sys/types.h>
398 #include <sys/sysinfo.h>],
399 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
400 [AC_MSG_RESULT(yes); dah=yes],
401 [AC_MSG_RESULT(not usable); dah=no])
403 if test x$dah = xyes; then
404 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
412 if test x$WANT_KSTAT = xyes; then
414 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
416 if test x$dah = xyes; then
417 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
418 LDFLAGS="$LDFLAGS -lkstat"
422 AC_DEFUN([AM_LANGINFO_CODESET],
424 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
425 [AC_TRY_LINK([#include <langinfo.h>],
426 [char* cs = nl_langinfo(CODESET);],
427 am_cv_langinfo_codeset=yes,
428 am_cv_langinfo_codeset=no)
430 if test $am_cv_langinfo_codeset = yes; then
431 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
432 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
440 AC_MSG_CHECKING(for getloadavg)
442 [#include <stdlib.h>],
443 [double v[3]; getloadavg(v, 3);],
445 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
452 AC_CHECK_FUNCS(popen)
458 CFLAGS="$CFLAGS -Wall -W"
470 $PACKAGE $VERSION configured successfully:
472 Installing into: $prefix
473 C compiler flags: $CFLAGS
474 Linker flags: $LDFLAGS
478 x11 support: $want_x11
479 xdamage support: $want_xdamage
480 xdbe support: $want_double_buffer
481 xft support: $want_xft
484 audacious: $want_audacious
490 hddtemp: $want_hddtemp
491 portmon: $want_portmon