--- configure.ac	2012-11-12 07:47:14 +0000
+++ configure.ac	2013-10-23 19:17:05 +0000
@@ -62,6 +62,16 @@
 AC_SUBST(GETTEXT_PACKAGE)
 AM_GLIB_GNU_GETTEXT
 
+# --------------------------------------------------------------------
+# Check for gio-unix
+#
+
+if test "$os_unix" = "yes"; then
+	GDK_GIO_PACKAGE=gio-2.0 gio-unix-2.0
+else
+	GDK_GIO_PACKAGE=gio-2.0
+fi
+
 # -----------------------------------------------------------------------------
 # GLib and GTK+ stuff
 
@@ -70,7 +80,7 @@
 	gmodule-no-export-2.0
 	gthread-2.0
 	gobject-2.0
-	gio-2.0 gio-unix-2.0)
+	$GDK_GIO_PACKAGE)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
@@ -90,7 +100,20 @@
 #
 
 AC_CHECK_FUNCS(timegm, AC_DEFINE(HAVE_TIMEGM,1,[Have timegm]))
-AC_CHECK_FUNCS(mlock)
+AC_CHECK_FUNCS(gmtime_r, AC_DEFINE(HAVE_GMTIME_R,1,[Have gmtime_r]))
+AC_CHECK_FUNCS(strptime, AC_DEFINE(HAVE_STRPTIME,1,[Have strptime]))
+AC_CHECK_FUNCS(memrchr, AC_DEFINE(HAVE_MEMRCHR,1,[Have memrchr]))
+AC_CHECK_FUNCS(mlock, AC_DEFINE(HAVE_MLOCK,1,[Have mlock]))
+
+# --------------------------------------------------------------------
+# Checks for headers
+#
+
+AC_CHECK_HEADERS(err.h, AC_DEFINE(HAVE_ERR_H,1,[Have err.h]))
+AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H,1,[Have pwd.h]))
+AC_CHECK_HEADERS(syslog.h, AC_DEFINE(HAVE_SYSLOG_H,1,[Have syslog.h]))
+AC_CHECK_HEADERS(sys/mman.h, AC_DEFINE(HAVE_SYS_MMAN_H,1,[Have mman.h]))
+AC_CHECK_HEADERS(sys/wait.h, AC_DEFINE(HAVE_SYS_WAIT_H,1,[Have wait.h]))
 
 # --------------------------------------------------------------------
 # p11-kit
