-AC_CHECK_FUNCS([gettimeofday memset select setlocale strcasecmp strchr strdup])
-
-AC_ARG_ENABLE([examples],
- [AS_HELP_STRING([--enable-examples], [Install additional $(PACKAGE_NAME)rc examples])],
- [case "${enableval}" in
- yes) examples=true ;;
- no) examples=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-examples]) ;;
- esac],[examples=false])
-AM_CONDITIONAL([INSTALL_EXAMPLES], [test x$examples = xtrue])
-
-AC_ARG_ENABLE([doc],
- [AS_HELP_STRING([--enable-doc], [Install additional documentation])],
- [case "${enableval}" in
- yes) doc=true ;;
- no) doc=false ;;
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-doc]) ;;
- esac],[doc=false])
-AM_CONDITIONAL([INSTALL_DOC], [test x$doc = xtrue])
-
-AC_CONFIG_FILES([
- Makefile
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([alarm gettimeofday memset select setlocale strcasecmp strchr strdup])
+
+# tint2conf (experimental)
+if test "x$tint2conf" = xtrue;
+then
+ # We want just link against stuff we really need so thats why I don't use PKG_CHECK_MODULES.
+ # gtk/glib is a bit horrible because we have to add -I directives for various features (like cairo, pango etc.)
+ # even if we don't need them.
+ # Sorry if that might be confusing %-)
+
+ AC_CHECK_FUNCS([strndup strrchr strstr])
+ # Save LIBS value and clear the variable, AC_CHECK_LIB will append all libs to LIBS on success.
+ LIBS_SAVED=$LIBS
+ LIBS=
+
+ AC_CHECK_LIB([pthread], [pthread_create], [],
+ [AC_MSG_ERROR([libpthread is missing, usually provided by glibc])])
+ AC_CHECK_LIB([glib-2.0], [g_free], [],
+ [AC_MSG_ERROR([glib-2.x is missing])])
+ AC_CHECK_LIB([gobject-2.0], [g_signal_connect_data], [],
+ [AC_MSG_ERROR([libgobject-2.0 is missing, usually provided by glib-2.x])])
+ AC_CHECK_LIB([gtk-x11-2.0], [gtk_main], [],
+ [AC_MSG_ERROR([gtk+-2.x is missing or not built with X support])])
+ AC_CHECK_LIB([gthread-2.0], [g_thread_init], [],
+ [AC_MSG_ERROR([libgthread-2.0 is missing, usually provided by glib-2.x])])
+
+ TINT2CONF_LIBS="${LIBS} ${PTHREAD_LIB} ${GLIB2_LIB} ${GOBJECT2_LIB} ${IMLIB2_LIBS}"
+ LIBS=$LIBS_SAVED
+
+ TINT2CONF_CFLAGS="$(${PKG_CONFIG} --cflags gtk+-x11-2.0 glib-2.0 gobject-2.0 gthread-2.0) ${IMLIB2_CFLAGS}"
+ AC_SUBST(TINT2CONF_CFLAGS)
+ AC_SUBST(TINT2CONF_LIBS)
+
+ # Python stuff
+ AC_PATH_PROG([__PYTHON], [python])
+ if test -z "${__PYTHON}";
+ then
+ AC_MSG_ERROR([tint2conf requires python to be installed])
+ fi
+
+ PKG_CHECK_EXISTS([pygtk-2.0],,[AC_MSG_ERROR([tint2conf requires >=pygtk-2.0])])
+fi
+#
+
+#
+AM_CFLAGS="-Wall"
+AM_LDFLAGS="-Wl,--as-needed"
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_LDFLAGS)
+
+DISTCLEANFILES="Makefile.in"
+AC_SUBST(DISTCLEANFILES)
+
+AC_CONFIG_FILES([Makefile