2 # Process this file with autoconf to produce a configure script.
4 AC_INIT([tint2], [0.10-svn], [http://code.google.com/p/tint2/issues])
8 AC_CONFIG_MACRO_DIR([m4])
9 AC_CONFIG_SRCDIR([src/tint.c])
10 AC_CONFIG_HEADERS([config.h])
13 AC_ARG_ENABLE([battery],
14 [AS_HELP_STRING([--disable-battery], [Disable battery status plugin])],
15 [case "${enableval}" in
18 *) AC_MSG_ERROR([bad value ${enableval} for --disable-battery]) ;;
19 esac], [battery=true])
20 AM_CONDITIONAL([ENABLE_BATTERY], [test x$battery = xtrue])
23 AC_ARG_ENABLE([examples],
24 [AS_HELP_STRING([--enable-examples], [Install additional tin2rc examples])],
25 [case "${enableval}" in
28 *) AC_MSG_ERROR([bad value ${enableval} for --enable-examples]) ;;
29 esac],[examples=false])
30 AM_CONDITIONAL([INSTALL_EXAMPLES], [test x$examples = xtrue])
33 AC_ARG_ENABLE([tint2conf],
34 [AS_HELP_STRING([--disable-tint2conf], [Disable tint2conf build, a GTK+2 theme switcher for tint2])],
35 [case "${enableval}" in
36 yes) tint2conf=true ;;
37 no) tint2conf=false ;;
38 *) AC_MSG_ERROR([bad value ${enableval} for --disable-tint2conf]) ;;
39 esac],[tint2conf=true])
40 AM_CONDITIONAL([ENABLE_TINT2CONF], [test x$tint2conf = xtrue])
43 # Checks for programs.
48 # Checks for libraries.
49 PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo])
50 AC_SUBST(PANGOCAIRO_CFLAGS)
51 AC_SUBST(PANGOCAIRO_LIBS)
53 PKG_CHECK_MODULES([PANGO], [pango])
54 AC_SUBST(PANGO_CFLAGS)
57 PKG_CHECK_MODULES([CAIRO], [cairo])
58 AC_SUBST(CAIRO_CFLAGS)
61 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
62 AC_SUBST(GLIB2_CFLAGS)
65 PKG_CHECK_MODULES([GOBJECT2], [gobject-2.0])
66 AC_SUBST(GOBJECT2_CFLAGS)
67 AC_SUBST(GOBJECT2_LIBS)
69 PKG_CHECK_MODULES([X11], [x11 xcomposite xdamage xinerama xrender xrandr])
73 PKG_CHECK_MODULES([IMLIB2], [imlib2])
74 AC_SUBST(IMLIB2_CFLAGS)
77 # Reset LIBS since AC_CHECK_LIB adds -lmylib on success
79 # Ensure that Imlib2 has been built with X support.
80 AC_CHECK_LIB([Imlib2], [imlib_context_set_display], [],
81 AC_MSG_ERROR([Imlib2 must be built with X support]))
83 AC_CHECK_LIB([rt], [clock_gettime])
86 # Checks for header files.
88 AC_CHECK_HEADERS([fcntl.h locale.h stdint.h stdlib.h string.h sys/time.h unistd.h])
90 # Checks for typedefs, structures, and compiler characteristics.
97 # Checks for library functions.
101 AC_CHECK_FUNCS([clock_gettime gettimeofday memset select setenv setlocale strcasecmp strchr strdup strstr])
103 # tint2conf (experimental)
104 if test "x$tint2conf" = xtrue;
106 # We want just link against stuff we really need so thats why I don't use PKG_CHECK_MODULES.
107 # gtk/glib is a bit horrible because we have to add -I directives for various features (like cairo, pango etc.)
108 # even if we don't need them.
109 # Sorry if that might be confusing %-)
111 AC_CHECK_FUNCS([strndup strrchr])
112 PKG_CHECK_MODULES([TINT2CONF], [x11 xrender imlib2 gobject-2.0 glib-2.0 gthread-2.0 gtk+-x11-2.0])
113 AC_SUBST(TINT2CONF_CFLAGS)
114 AC_SUBST(TINT2CONF_LIBS)
117 AC_PATH_PROG([__PYTHON], [python])
118 if test -z "${__PYTHON}";
120 AC_MSG_ERROR([tint2conf requires python to be installed])
123 PKG_CHECK_EXISTS([pygtk-2.0],,[AC_MSG_ERROR([tint2conf requires >=pygtk-2.0])])
129 AM_LDFLAGS="-Wl,--as-needed"
133 DISTCLEANFILES="Makefile.in"
134 AC_SUBST(DISTCLEANFILES)
136 AC_CONFIG_FILES([Makefile
140 src/tint2conf/Makefile