+# Get _GNU_SOURCE and friends
+AC_USE_SYSTEM_EXTENSIONS
+
+# Initialize libtool
+LT_INIT
+
+# Require xorg-macros minimum of 1.8 for AM_SILENT_RULES
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+XORG_MEMORY_CHECK_FLAGS
+
+# Check for compiler features
+AC_C_INLINE
+AC_C_TYPEOF
+
+# Check for programs
+AC_PROG_LEX
+AC_PROG_YACC
+AC_PATH_PROG([YACC_INST], $YACC)
+if test ! -f "src/xkbcomp/parser.c"; then
+ if test -z "$YACC_INST"; then
+ AC_MSG_ERROR([yacc not found - unable to compile src/xkbcomp/parser.y])
+ fi
+fi
+
+# Checks for library functions.
+AC_CHECK_FUNCS([strcasecmp strncasecmp])
+if test "x$ac_cv_func_strcasecmp" = xno || \
+ test "x$ac_cv_func_strncasecmp" = xno; then
+ AC_MSG_ERROR([C library does not support strcasecmp/strncasecmp])
+fi