2006-09-30 16:31:06 +00:00
AC_INIT([Conky],[1.4.3],[brenden1@users.sourceforge.net])
2005-07-20 00:30:40 +00:00
2006-09-30 16:31:06 +00:00
AM_INIT_AUTOMAKE(conky, 1.4.3)
2005-08-21 22:10:54 +00:00
AM_CONFIG_HEADER(src/config.h)
2006-05-30 01:23:06 +00:00
dnl
2006-09-27 18:43:21 +00:00
dnl C Compiler
2006-05-30 01:23:06 +00:00
dnl
2006-09-30 19:21:58 +00:00
dnl prevent libtool setting LTCFLAGS to default of -g -O2 when CFLAGS unset.
dnl libtool must be deleted with make distclean to see this fix.
if test x"$CFLAGS" = x""; then
AC_SUBST(CFLAGS, [ ])
fi
2006-05-30 01:23:06 +00:00
AC_PROG_CC
2005-08-22 23:32:35 +00:00
AC_PROG_LIBTOOL
2006-01-11 17:03:45 +00:00
PKG_PROG_PKG_CONFIG([0.17.2])
2005-08-22 23:32:35 +00:00
2005-07-20 00:30:40 +00:00
2005-08-21 23:09:36 +00:00
AC_CONFIG_FILES(
Makefile
doc/Makefile
src/Makefile
2006-08-12 06:10:18 +00:00
src/build.h
2005-08-21 23:09:36 +00:00
)
2005-07-20 00:30:40 +00:00
uname=`uname`
case $uname in
Linux*)
WANT_SYSINFO=yes
;;
FreeBSD*)
WANT_KVM=yes
2005-08-27 11:56:22 +00:00
WANT_DEVSTAT=yes
2005-07-20 00:30:40 +00:00
;;
2005-08-31 05:20:10 +00:00
# NetBSD*)
# WANT_KVM=yes
# WANT_OSSLIB=yes
# ;;
2005-07-20 00:30:40 +00:00
2006-03-24 13:49:25 +00:00
# OpenBSD*)
# WANT_KVM=yes
# WANT_OSSLIB=yes
# ;;
2005-08-31 05:20:10 +00:00
# Solaris doesn't work at all right now
2005-07-20 00:30:40 +00:00
# SunOS*)
# WANT_KSTAT=yes
# ;;
*)
echo "Your operating system $uname isn't supported"
echo "Feel free to help. :P"
exit 1
;;
esac
AM_CONDITIONAL(BUILD_LINUX, test x$uname = xLinux)
2006-08-12 06:10:18 +00:00
#AM_CONDITIONAL(BUILD_SOLARIS, test x$uname = xSunOS)
2005-07-20 00:30:40 +00:00
AM_CONDITIONAL(BUILD_FREEBSD, test x$uname = xFreeBSD)
2006-08-12 06:10:18 +00:00
#AM_CONDITIONAL(BUILD_NETBSD, test x$uname = xNetBSD)
2006-03-24 13:49:25 +00:00
# AM_CONDITIONAL(BUILD_OPENBSD, test x$uname = xOpenBSD)
2005-07-20 00:30:40 +00:00
2006-08-12 06:10:18 +00:00
BUILD_DATE=$(LANG=en_US LC_ALL=en_US LOCALE=en_US date)
BUILD_ARCH="$(uname -sr) ($(uname -m))"
AC_SUBST(BUILD_DATE)
AC_SUBST(BUILD_ARCH)
2005-07-20 00:30:40 +00:00
dnl
dnl XFT option
dnl
2005-12-21 01:49:03 +00:00
want_xft=yes
2005-07-20 00:30:40 +00:00
AC_ARG_ENABLE(xft,
2006-01-02 18:45:51 +00:00
[ --enable-xft enable if you want to use Xft [[default=yes]]],
2005-07-20 00:30:40 +00:00
[want_xft="$enableval"])
dnl
dnl OWN_WINDOW option
dnl
dah=yes
AC_ARG_ENABLE(own_window,
2005-11-02 04:21:46 +00:00
[ --enable-own-window enable if you want support for creating own window [[default=yes]]],
2005-07-20 00:30:40 +00:00
[dah="$enableval"])
if test $dah != "no"; then
AC_DEFINE(OWN_WINDOW, 1, [Define if you want support for window creating])
fi
dnl
dnl PROC_UPTIME option
dnl
2005-12-21 01:49:03 +00:00
dah=yes
2005-07-20 00:30:40 +00:00
AC_ARG_ENABLE(proc_uptime,
2006-01-02 18:45:51 +00:00
[ --enable-proc-uptime enable using /proc/uptime for uptime [[default=yes]]],
2005-07-20 00:30:40 +00:00
[dah="$enableval"])
if test $dah = "yes"; then
AC_DEFINE(PROC_UPTIME, 1, [Define if you want to use /proc/uptime for uptime])
fi
2006-01-11 17:03:45 +00:00
dnl
dnl Audacious Media Player
dnl
2006-01-11 22:13:13 +00:00
want_audacious=auto
2006-01-11 17:03:45 +00:00
AC_ARG_ENABLE(audacious,
2006-01-11 22:13:13 +00:00
[ --enable-audacious enable audacious player support [[default=auto]]],
2006-01-11 17:03:45 +00:00
[want_audacious="$enableval"])
2006-01-11 22:13:13 +00:00
case x$want_audacious in
xauto)
want_audacious=yes
2006-11-03 20:54:52 +00:00
PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1], [], [want_audacious=no])
2006-01-11 22:13:13 +00:00
if test x$want_audacious = xyes; then
2006-11-03 20:54:52 +00:00
CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
LIBS="$LIBS $AUDACIOUS_LIBS"
AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
2006-01-11 22:13:13 +00:00
fi
;;
xyes)
2006-11-03 20:54:52 +00:00
PKG_CHECK_MODULES([AUDACIOUS], [audacious >= 0.1], [],
[AC_MSG_ERROR([Can't find Audacious development files.])])
2006-01-11 22:13:13 +00:00
CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
LIBS="$LIBS $AUDACIOUS_LIBS"
AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
;;
xno)
;;
*)
echo "Error: invalid audacious parameter specified: $want_audacious"
exit -1
;;
esac
2006-01-11 17:03:45 +00:00
AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
dnl
dnl InfoPipe (Version 1.3)
dnl
2006-11-03 20:54:52 +00:00
want_infopipe=no
2006-01-11 17:03:45 +00:00
AC_ARG_ENABLE(infopipe,
2006-11-03 20:54:52 +00:00
[ --enable-infopipe enable xmms/bmp infopipe support [[default=no]]],
2006-01-11 17:03:45 +00:00
[want_infopipe="$enableval"])
2006-01-11 22:13:13 +00:00
case x$want_infopipe in
xyes)
AC_DEFINE(INFOPIPE, 1, [Define for InfoPipe support])
;;
xno)
;;
*)
echo "Error: invalid infopipe parameter specified: $want_infopipe"
exit -1
;;
esac
2006-01-11 17:03:45 +00:00
AM_CONDITIONAL(BUILD_INFOPIPE, test x$want_infopipe = xyes)
2006-01-07 07:01:22 +00:00
2005-12-30 09:44:40 +00:00
dnl
dnl BMPx
dnl
want_bmpx=no
AC_ARG_ENABLE(bmpx,
2006-01-02 03:39:51 +00:00
[ --enable-bmpx enable if you want BMPx support [[default=no]]],
2005-12-30 09:44:40 +00:00
[want_bmpx="$enableval"])
AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
if test x$want_bmpx = xyes; then
2006-05-12 12:41:18 +00:00
PKG_CHECK_MODULES([BMPX], [bmp-2.0 >= 0.14.0])
CFLAGS="$CFLAGS $BMPX_CFLAGS"
LIBS="$LIBS $BMPX_LIBS"
2005-12-30 09:44:40 +00:00
AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
fi
2005-07-20 00:30:40 +00:00
dnl
dnl Seti@Home
dnl
2005-12-21 01:49:03 +00:00
want_seti=yes
2005-07-20 00:30:40 +00:00
AC_ARG_ENABLE(seti,
2006-01-02 18:45:51 +00:00
[ --enable-seti enable if you want SETI at Home stats [[default=yes]]],
2005-07-20 00:30:40 +00:00
[want_seti="$enableval"])
2005-09-02 14:17:31 +00:00
AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
if test x$want_seti = xyes; then
2005-07-20 00:30:40 +00:00
AC_DEFINE(SETI, 1, [Define if you want SETI at Home stats])
fi
2006-08-10 16:56:13 +00:00
dnl
dnl Hddtemp
dnl
want_hddtemp=yes
AC_ARG_ENABLE(hddtemp,
[ --enable-hddtemp enable if you want hddtemp support [[default=yes]]],
[want_hddtemp="$enableval"])
AM_CONDITIONAL(BUILD_HDDTEMP, test x$want_hddtemp = xyes)
if test x$want_hddtemp = xyes; then
AC_DEFINE(HDDTEMP, 1, [Define if you want hddtemp support])
fi
2005-07-20 00:30:40 +00:00
dnl
dnl MPD
dnl
2005-12-21 01:49:03 +00:00
want_mpd=yes
2005-07-20 00:30:40 +00:00
AC_ARG_ENABLE(mpd,
2006-01-02 18:45:51 +00:00
[ --enable-mpd enable if you want MPD support [[default=yes]]],
2005-07-20 00:30:40 +00:00
[want_mpd="$enableval"])
2005-09-02 14:17:31 +00:00
AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
if test x$want_mpd = xyes; then
2005-07-20 00:30:40 +00:00
AC_DEFINE(MPD, 1, [Define if you want MPD support])
fi
2006-03-25 21:21:07 +00:00
dnl
dnl XMMS2
dnl
want_xmms2=no
AC_ARG_ENABLE(xmms2,
2006-08-10 16:56:13 +00:00
[ --enable-xmms2 enable if you want XMMS2 support [[default=no]]],
2006-03-25 21:21:07 +00:00
[want_xmms2="$enableval"])
AM_CONDITIONAL(BUILD_XMMS2, test x$want_xmms2 = xyes)
if test x$want_xmms2 = xyes; then
CFLAGS="$CFLAGS `pkg-config --cflags xmms2-client`"
LIBS="$LIBS `pkg-config --libs xmms2-client`"
AC_DEFINE(XMMS2, 1, [Define if you want XMMS2 support])
fi
2006-05-25 07:00:12 +00:00
dnl
dnl IMLIB2
dnl
want_imlib2=no
AC_ARG_ENABLE(imlib2,
2006-08-10 16:56:13 +00:00
[ --enable-imlib2 enable if you want Imlib2 support [[default=no]]],
2006-05-25 07:00:12 +00:00
[want_imlib2="$enableval"])
AM_CONDITIONAL(BUILD_IMLIB2, test x$want_imlib2 = xyes)
if test x$want_imlib2 = xyes; then
PKG_CHECK_MODULES([Imlib2], [imlib2])
CFLAGS="$CFLAGS $Imlib2_CFLAGS"
LIBS="$LIBS $Imlib2_LIBS"
AC_DEFINE(IMLIB2, 1, [Define if you want Imlib2 support])
fi
2005-10-31 05:17:06 +00:00
dnl
dnl PORT_MONITORS
dnl
2005-12-21 01:49:03 +00:00
want_portmon=yes
2005-10-31 05:17:06 +00:00
AC_ARG_ENABLE(portmon,
2006-01-02 18:45:51 +00:00
[ --enable-portmon enable if you want tcp (ip4) port monitoring [[default=yes]]],
2005-10-31 05:17:06 +00:00
[want_portmon="$enableval"])
AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
if test x$want_portmon = xyes; then
AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
if test "x$PORT_MONITORS_MISSING" = xyes; then
AC_MSG_ERROR([missing a needed network header for port monitoring])
fi
AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
fi
2005-07-20 00:30:40 +00:00
dnl
dnl Cairo
dnl
dnl
dnl MLDonkey
dnl
want_mldonkey=no
AC_ARG_ENABLE(mldonkey,
2005-11-02 04:21:46 +00:00
[ --enable-mldonkey enable if you want MLDonkey support [[default=no]]],
2005-07-20 00:30:40 +00:00
[want_mldonkey="$enableval"])
2005-09-02 14:17:31 +00:00
AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
if test x$want_mldonkey = xyes; then
2005-07-20 00:30:40 +00:00
AC_DEFINE(MLDONKEY, 1, [Define if you want MLDonkey support])
fi
2006-05-13 19:51:26 +00:00
dnl
dnl ICONV
dnl
2006-05-13 20:14:26 +00:00
AM_ICONV
if test "$am_cv_func_iconv" != yes; then
AC_MSG_WARN([Could not find libiconv])
2006-05-22 17:32:44 +00:00
else
LIBS="$LIBS $LIBICONV"
2006-05-13 19:51:26 +00:00
fi
2006-09-30 16:31:06 +00:00
dnl
dnl debug
dnl
want_debug=no
AC_ARG_ENABLE(debug,
[ --enable-debug compile with debug symbols [[default=no]]],
[want_debug="$enableval"])
if test "x$want_debug" = "xyes" -a $ac_cv_c_compiler_gnu != no; then
CFLAGS="$CFLAGS -g3"
fi
2006-05-13 19:51:26 +00:00
2005-07-20 00:30:40 +00:00
dnl
dnl X
dnl
2006-10-05 19:18:34 +00:00
want_double_buffer=yes
2005-08-22 23:32:35 +00:00
AC_ARG_ENABLE(double_buffer,
2005-11-02 04:21:46 +00:00
[ --enable-double-buffer enable if you want to support flicker-free operation [[default=yes]]],
2006-10-05 19:18:34 +00:00
[want_double_buffer="$enableval"])
2005-08-22 23:32:35 +00:00
2006-08-01 21:24:15 +00:00
want_xdamage=yes
AC_ARG_ENABLE(xdamage,
[ --enable-xdamage enable if you want Xdamage support [[default=yes]]],
[want_xdamage="$enableval"])
2005-08-08 01:18:52 +00:00
want_x11=yes
AC_ARG_ENABLE(x11,
2005-11-02 04:21:46 +00:00
[ --enable-x11 enable if you want X11 support [[default=yes]]],
2005-08-22 23:32:35 +00:00
[want_x11="$enableval"])
2005-08-08 01:18:52 +00:00
2005-08-30 12:27:48 +00:00
if test "x$want_x11" = "xyes"; then
2005-08-22 23:32:35 +00:00
AC_PATH_X
AC_PATH_XTRA
CFLAGS="$CFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS $X11_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
2006-10-05 19:18:34 +00:00
if test "x$no_x" = xyes; then
2005-08-22 23:32:35 +00:00
AC_MSG_ERROR([something went wrong when checking for X11, you're probably missing headers or it's not installed, either re-run configure with --disable-x11, or fix this])
fi
2006-10-05 19:18:34 +00:00
AC_CHECK_LIB(
[X11], [XOpenDisplay],[],
AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
)
2005-08-22 23:32:35 +00:00
AC_DEFINE(X11, 1, [Define if you want to use X11])
AC_DEFINE(HAVE_X11, 1, [Define if you have X11])
2005-08-30 08:44:07 +00:00
AM_CONDITIONAL(BUILD_X11, true)
2006-10-05 19:18:34 +00:00
if test "x$want_double_buffer" != xno; then
2005-08-22 23:32:35 +00:00
AC_DEFINE(DOUBLE_BUFFER, 1, [Define if you want support for the DBE extension])
AC_CHECK_LIB(Xext, XdbeQueryExtension, [AC_DEFINE([HAVE_XDBE], 1, [Xdbe]) LIBS="$LIBS -lXext"],
[AC_MSG_ERROR([something went wrong when checking for Xdbe (double buffer extension)])])
fi
2006-08-01 21:24:15 +00:00
if test "x$want_xdamage" = "xyes"; then
AC_DEFINE(XDAMAGE, 1, [Define if you want support for the Xdamage extension])
AC_CHECK_LIB(Xdamage, XDamageQueryExtension,
[AC_DEFINE([HAVE_XDAMAGE], 1, [Xdamage]) LIBS="$LIBS -lXdamage"],
[AC_MSG_ERROR([something went wrong when checking for Xdamage])])
fi
2005-08-30 08:44:07 +00:00
else
AM_CONDITIONAL(BUILD_X11, false)
2005-07-20 00:30:40 +00:00
fi
dnl
dnl Xft
dnl
2005-08-22 23:32:35 +00:00
if test x$want_xft && test x$want_x11; then
2006-09-27 18:27:27 +00:00
PKG_CHECK_MODULES(XFT, [xft],
[
AC_DEFINE(XFT, 1, [Define if you are using Xft])
CFLAGS="$CFLAGS $XFT_CFLAGS"
AC_SUBST(XFT_LIBS)
],
[want_xft=no])
2005-07-20 00:30:40 +00:00
fi
dnl
dnl KVM
dnl
if test x$WANT_KVM = xyes; then
AC_CHECK_LIB(kvm, kvm_open,
LIBS="$LIBS -lkvm",
AC_MSG_ERROR([Could not find kvm_open in -lkvm.])
)
fi
2005-08-27 11:56:22 +00:00
dnl
dnl devstat
dnl
if test x$WANT_DEVSTAT = xyes; then
AC_CHECK_LIB(devstat, devstat_getversion,
LIBS="$LIBS -ldevstat",
AC_MSG_ERROR([Cound not find devstat_getversion in -ldevstat.])
)
fi
2005-07-20 00:30:40 +00:00
dnl
2006-03-24 13:49:25 +00:00
dnl OSSLIB for NetBSD/OpenBSD
2005-07-20 00:30:40 +00:00
dnl
if test x$WANT_OSSLIB = xyes; then
AC_CHECK_LIB(ossaudio, _oss_ioctl,
LIBS="$LIBS -lossaudio",
AC_MSG_ERROR([Could not find oss_ioctl in -lossaudio.])
)
fi
dnl
dnl Some random headers
dnl
2005-08-30 12:27:48 +00:00
AC_CHECK_HEADERS([signal.h unistd.h sys/utsname.h sys/stat.h linux/soundcard.h dirent.h mcheck.h])
AC_CHECK_HEADERS([sys/statfs.h sys/param.h])
AC_CHECK_HEADERS([sys/mount.h], [], [],
[#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
])
2005-07-20 00:30:40 +00:00
dnl
2005-08-22 01:05:39 +00:00
dnl Check doc stuff
2005-07-20 00:30:40 +00:00
dnl
2005-08-24 20:47:29 +00:00
AC_CHECK_PROGS(db2x_xsltproc_cmd, db2x_xsltproc)
AC_CHECK_PROGS(db2x_manxml_cmd, db2x_manxml)
AC_CHECK_PROGS(xsltproc_cmd, xsltproc)
if test x$db2x_xsltproc_cmd = "x" -o x$xsltproc_cmd = "x"; then
AM_CONDITIONAL(HAVE_DOCSTUFF, false)
else
AM_CONDITIONAL(HAVE_DOCSTUFF, true)
fi
2005-08-22 01:05:39 +00:00
2005-07-20 00:30:40 +00:00
dnl
dnl Check sysinfo()
dnl
if test x$WANT_SYSINFO = xyes; then
dah=no
AC_MSG_CHECKING(for sysinfo)
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/sysinfo.h>],
[struct sysinfo s; sysinfo(&s); (void) s.uptime; ],
[AC_MSG_RESULT(yes); dah=yes],
[AC_MSG_RESULT(not usable); dah=no])
if test x$dah = xyes; then
AC_DEFINE(HAVE_SYSINFO, 1, [Define if you have sysinfo (Linux)])
fi
fi
dnl
dnl kstat in Solaris
dnl
if test x$WANT_KSTAT = xyes; then
dah=no
AC_CHECK_LIB([kstat], [kstat_open], [dah=yes], [])
if test x$dah = xyes; then
AC_DEFINE(HAVE_KSTAT, 1, [Define if you have kstat (Solaris)])
LDFLAGS="$LDFLAGS -lkstat"
fi
fi
2005-07-24 23:08:51 +00:00
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
])
2005-07-20 00:30:40 +00:00
dnl
dnl Check getloadavg
dnl
AC_MSG_CHECKING(for getloadavg)
AC_TRY_COMPILE(
[#include <stdlib.h>],
[double v[3]; getloadavg(v, 3);],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_GETLOADAVG, 1, [Define if you have getloadavg])],
[AC_MSG_RESULT(no)])
dnl
dnl Check popen
dnl
AC_CHECK_FUNCS(popen)
dnl
dnl Da.
dnl
CFLAGS="$CFLAGS -Wall -W"
AC_SUBST(CFLAGS)
AC_SUBST(X11_LIBS)
2005-08-21 23:09:36 +00:00
AC_OUTPUT
2006-08-12 05:19:40 +00:00
dnl
dnl Print summary
dnl
cat << EOF
$PACKAGE $VERSION configured successfully:
2006-08-12 06:15:52 +00:00
Installing into: $prefix
2006-09-30 16:31:06 +00:00
C compiler flags: $CFLAGS
Linker flags: $LDFLAGS
Libraries: $LIBS
2006-08-12 06:15:52 +00:00
2006-08-12 05:19:40 +00:00
* x11:
x11 support: $want_x11
xft support: $want_xft
xdamage extension: $want_xdamage
* music detection:
audacious: $want_audacious
infopipe: $want_infopipe
bmpx: $want_bmpx
xmms2: $want_xmms2
mpd: $want_mpd
* general:
portmon: $want_portmon
mldonkey: $want_mldonkey
hddtemp: $want_hddtemp
EOF