+AC_SUBST([DATADIR])
+AC_DEFINE_UNQUOTED([YOINK_DATADIR], ["$DATADIR"],
+ [Define to path of game asset directory.])
+
+
+CONFIGFILES="\$HOME/.yoinkrc:/etc/yoinkrc"
+
+AC_DEFINE_UNQUOTED([YOINK_CONFIGFILES], ["$CONFIGFILES"],
+ [Define to colon-delimited configuration file paths.])
+
+
+#
+# Checks for typedefs, structures, and compiler characteristics.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AC_C_STRINGIZE
+AC_C_INLINE
+
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+
+#
+# Checks for system functions.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_STRTOD
+AC_CHECK_FUNCS([nanosleep strchr strcspn strrchr strstr])
+
+
+#
+# Checks for header files.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AC_HEADER_STDBOOL
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stddef.h stdint.h stdlib.h string.h unistd.h])
+
+BOOST_SMART_PTR
+BOOST_STRING_ALGO
+BOOST_BIND
+BOOST_FUNCTION
+
+AM_PATH_SDL([1.2.10],
+ [CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"])
+
+AC_CHECK_HEADERS([GL/gl.h GL/glu.h],,
+ [missing="$missing OpenGL"])
+
+AC_CHECK_HEADERS([AL/al.h AL/alut.h],,
+ [missing="$missing OpenAL"])
+
+AC_CHECK_HEADERS([SDL/SDL_image.h],,
+ [missing="$missing SDL_image"])
+
+AC_CHECK_HEADERS([SDL/SDL_sound.h],,
+ [missing="$missing SDL_sound"])
+
+if test "x$missing" != x
+then
+ echo "** Required header files from these libraries are missing:"
+ for header in $missing
+ do
+ echo "** $header"
+ done
+ AC_MSG_ERROR([please install missing dependencies])
+fi
+
+
+#
+# Checks for libraries.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+AC_SEARCH_LIBS([IMG_Load], [SDL_image],,
+ [missing="$missing SDL_image"])
+
+AC_SEARCH_LIBS([Sound_Init], [SDL_sound],,
+ [missing="$missing SDL_sound"])
+
+if test x$WIN32 == xyes
+then
+# autoconf library search macro doesn't find opengl32 on windows because it uses
+# different name hashing, but it links fine; assume it's there
+ LIBS="$LIBS -lglu32 -lopengl32"
+else
+ AC_SEARCH_LIBS([gluPerspective], [GLU MesaGLU],,
+ [missing="$missing GLU"])
+
+ AC_SEARCH_LIBS([glBegin], [GL MesaGL],,
+ [missing="$missing OpenGL"])
+fi
+
+AC_SEARCH_LIBS([alGenBuffers], [openal openal32],,
+ [missing="$missing OpenAL"])
+
+AC_SEARCH_LIBS([alutInit], [alut],,
+ [missing="$missing ALUT"])
+
+AC_SEARCH_LIBS([clock_gettime], [rt],
+ [AC_DEFINE([HAVE_CLOCK_GETTIME], 1,
+ [Define to 1 if you have the 'clock_gettime' function.])])
+
+if test "x$missing" != x
+then
+ echo "** One or more required libraries are missing:"
+ for library in $missing
+ do
+ echo "** $library"
+ done
+ AC_MSG_ERROR([please install missing dependencies])
+fi
+
+
+#
+# Find the data files to install.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+DATA_FILES=$(echo $(cd data; \
+ find . -name "*.json" \
+ -o -name "*.ogg" \
+ -o -name "*.png" \
+ -o -name "*.xm" \
+ -o -name "yoinkrc"))
+AC_SUBST([DATA_FILES])
+
+
+#
+# Create the build files.
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+