1 AC_INIT([Conky],[1.4.5],[brenden1@users.sourceforge.net])
3 AM_INIT_AUTOMAKE(conky, 1.4.5)
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 dnl --commented out until brenden finishes it --
178 dnl AC_ARG_ENABLE([imlib2],
179 dnl AC_HELP_STRING([--enable-imlib2], [enable if you want Imlib2 support [[default=no]]]),
180 dnl [want_imlib2="$enableval"], [want_imlib2=no])
182 dnl AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
183 dnl if test x$want_imlib2 = xyes; then
184 dnl PKG_CHECK_MODULES([Imlib2], [imlib2])
185 dnl CFLAGS="$CFLAGS $Imlib2_CFLAGS"
186 dnl LIBS="$LIBS $Imlib2_LIBS"
187 dnl AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
194 AC_ARG_ENABLE([portmon],
195 AC_HELP_STRING([--enable-portmon], [enable if you want tcp (ip4) port monitoring [[default=yes]]]),
196 [want_portmon="$enableval"], [want_portmon=yes])
198 AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
199 if test x$want_portmon = xyes; then
200 AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [],
201 [PORT_MONITORS_MISSING=yes])
202 if test "x$PORT_MONITORS_MISSING" = xyes; then
203 AC_MSG_ERROR([missing a needed network header for port monitoring])
205 AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
214 if test "$am_cv_func_iconv" != yes; then
215 AC_MSG_WARN([Could not find libiconv])
217 LIBS="$LIBS $LIBICONV"
224 AC_ARG_ENABLE([debug],
225 AC_HELP_STRING([--enable-debug], [compile with debug symbols [[default=no]]]),
226 [want_debug="$enableval"], [want_debug=no])
228 if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
237 AC_HELP_STRING([--enable-x11], [enable if you want X11 support [[default=yes]]]),
238 [want_x11="$enableval"], [want_x11=yes])
240 AM_CONDITIONAL(BUILD_X11, test x$want_x11 = xyes)
241 if test "x$want_x11" = "xyes"; then
242 if $PKG_CONFIG --exists x11; then
243 PKG_CHECK_MODULES([X11], [x11])
244 CFLAGS="$CFLAGS $X11_CFLAGS"
245 LIBS="$LIBS $X11_LIBS"
247 dnl non-modular X11 installations
250 CFLAGS="$CFLAGS $X_CFLAGS"
252 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
253 if test "x$no_x" = "xyes"; then
254 AC_MSG_ERROR([Can't locate your X11 installation])
256 AC_CHECK_LIB([X11], [XOpenDisplay], [], AC_MSG_ERROR([Could not find XOpenDisplay in -lX11]))
258 AC_DEFINE(X11, 1, [Define if you want to use X11])
263 dnl Xext Double-buffering Extension
266 AC_ARG_ENABLE([double_buffer],
267 AC_HELP_STRING([--enable-double-buffer], [enable for flicker-free operation [[default=yes]]]),
268 [want_double_buffer="$enableval"], [want_double_buffer=yes])
270 if test "x$want_double_buffer" = "xyes"; then
271 if test "x$want_x11" != "xyes"; then
272 AC_MSG_ERROR([--enable-x11 is required for double-buffering])
274 if $PKG_CONFIG --exists xext; then
275 PKG_CHECK_MODULES([XEXT],[xext])
276 CFLAGS="$CFLAGS $XEXT_CFLAGS"
277 LIBS="$LIBS $XEXT_LIBS"
279 dnl non-modular X11 installation
280 AC_CHECK_LIB([Xext], [XdbeQueryExtension], [LIBS="$LIBS -lXext"],
281 AC_MSG_ERROR([Could not find XdbeQueryExtension in -lXext]))
283 AC_DEFINE(HAVE_XDBE, 1, [Define for X11 double-buffering])
288 dnl Xdamage Extension
291 AC_ARG_ENABLE([xdamage],
292 AC_HELP_STRING([--enable-xdamage], [enable if you want Xdamage support [[default=yes]]]),
293 [want_xdamage="$enableval"], [want_xdamage=yes])
295 if test "x$want_xdamage" = "xyes"; then
296 if test "x$want_x11" != "xyes"; then
297 AC_MSG_ERROR([--enable-x11 is required for xdamage])
299 if $PKG_CONFIG --exists xdamage; then
300 PKG_CHECK_MODULES([XDAMAGE],[xdamage])
301 CFLAGS="$CFLAGS $XDAMAGE_CFLAGS"
302 LIBS="$LIBS $XDAMAGE_LIBS"
304 dnl non-modular X11 installation
305 AC_CHECK_LIB([Xdamage], [XDamageQueryExtension], [LIBS="$LIBS -lXdamage"],
306 AC_MSG_ERROR([Could not find XDamageQueryExtension in -lXdamage]))
308 AC_DEFINE(HAVE_XDAMAGE, 1, [Define for X11 Xdamage extension])
317 AC_HELP_STRING([--enable-xft], [enable if you want to use Xft [[default=yes]]]),
318 [want_xft="$enableval"], [want_xft=yes])
320 if test x$want_xft = "xyes"; then
321 if test "x$want_x11" != "xyes"; then
322 AC_MSG_ERROR([--enable-x11 is required for xft])
324 PKG_CHECK_MODULES(XFT, [xft])
325 CFLAGS="$CFLAGS $XFT_CFLAGS"
326 LIBS="$LIBS $XFT_LIBS"
327 AC_DEFINE(XFT, 1, [Define for Xft support])
335 if test x$WANT_KVM = xyes; then
336 AC_CHECK_LIB(kvm, kvm_open,
338 AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
346 if test x$WANT_DEVSTAT = xyes; then
347 AC_CHECK_LIB(devstat, devstat_getversion,
348 LIBS="$LIBS -ldevstat",
349 AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
354 dnl OSSLIB for NetBSD/OpenBSD
357 if test x$WANT_OSSLIB = xyes; then
358 AC_CHECK_LIB(ossaudio, _oss_ioctl,
359 LIBS="$LIBS -lossaudio",
360 AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
368 AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h \
369 sys/statfs.h sys/param.h pthread.h assert.h errno.h time.h])
370 AC_CHECK_HEADERS([sys/mount.h], [], [],
371 [#ifdef HAVE_SYS_PARAM_H
372 #include <sys/param.h>
379 AC_CHECK_FUNCS([calloc malloc free popen])
380 AC_SEARCH_LIBS(clock_gettime, [rt], [], AC_MSG_ERROR([clock_gettime() not found]))
387 AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
388 AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
389 AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
390 if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
391 AM_CONDITIONAL(HAVE_DOCSTUFF, false)
393 AM_CONDITIONAL(HAVE_DOCSTUFF, true)
400 if test x$WANT_SYSINFO = xyes; then
402 AC_MSG_CHECKING(for sysinfo)
404 [#include <sys/types.h>
405 #include <sys/sysinfo.h>],
406 [struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
407 [AC_MSG_RESULT(yes); dah=yes],
408 [AC_MSG_RESULT(not usable); dah=no])
410 if test x$dah = xyes; then
411 AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
419 if test x$WANT_KSTAT = xyes; then
421 AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
423 if test x$dah = xyes; then
424 AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
425 LDFLAGS="$LDFLAGS -lkstat"
429 AC_DEFUN([AM_LANGINFO_CODESET],
431 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
432 [AC_TRY_LINK([#include <langinfo.h>],
433 [char* cs = nl_langinfo(CODESET);],
434 am_cv_langinfo_codeset=yes,
435 am_cv_langinfo_codeset=no)
437 if test $am_cv_langinfo_codeset = yes; then
438 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
439 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
447 AC_MSG_CHECKING(for getloadavg)
449 [#include <stdlib.h>],
450 [double v[3]; getloadavg(v, 3);],
452 AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
460 CFLAGS="$CFLAGS -Wall -W"
472 $PACKAGE $VERSION configured successfully:
474 Installing into: $prefix
475 C compiler flags: $CFLAGS
476 Linker flags: $LDFLAGS
480 x11 support: $want_x11
481 xdamage support: $want_xdamage
482 xdbe support: $want_double_buffer
483 xft support: $want_xft
486 audacious: $want_audacious
492 hddtemp: $want_hddtemp
493 portmon: $want_portmon