+AC_CHECK_HEADERS(ctype.h dirent.h errno.h fcntl.h grp.h locale.h pwd.h)
+AC_CHECK_HEADERS(signal.h string.h stdio.h stdlib.h unistd.h sys/stat.h)
+AC_CHECK_HEADERS(sys/select.h sys/socket.h sys/time.h sys/types.h sys/wait.h)
+
+AC_PATH_PROG([SED], [sed], [no])
+if test "$SED" = "no"; then
+ AC_MSG_ERROR([The program "sed" is not available. This program is required to build Openbox.])
+fi
+
+AC_PATH_PROG([DIRNAME], [dirname], [no])
+if test "$DIRNAME" = "no"; then
+ AC_MSG_ERROR([The program "dirname" is not available. This program is required to build Openbox.])
+fi
+
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.14.0])
+AC_SUBST(GLIB_CFLAGS)
+AC_SUBST(GLIB_LIBS)
+
+PKG_CHECK_MODULES(PANGO, [pango >= 1.8.0 pangoxft >= 1.8.0])
+AC_SUBST(PANGO_CFLAGS)
+AC_SUBST(PANGO_LIBS)
+
+PKG_CHECK_MODULES(XML, [libxml-2.0 >= 2.6.0])
+AC_SUBST(XML_CFLAGS)
+AC_SUBST(XML_LIBS)
+
+AC_ARG_ENABLE(startup-notification,
+ AC_HELP_STRING(
+ [--disable-startup-notification],
+ [disable the startup notification library. [default=enabled]]
+ ),
+ [enable_sn=$enableval],
+ [enable_sn=yes]
+)
+
+if test "$enable_sn" = yes; then
+PKG_CHECK_MODULES(LIBSN, [libstartup-notification-1.0 >= 0.8],
+ [
+ AC_DEFINE(USE_LIBSN, [1], [Use startup-notification])
+ AC_SUBST(LIBSN_CFLAGS)
+ AC_SUBST(LIBSN_LIBS)
+ sn_found=yes
+ ],
+ [
+ sn_found=no
+ ]
+)
+else
+ sn_found=no
+fi