--- a
+++ b/configure.in
@@ -0,0 +1,59 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(src/plugin.c)
+
+AM_INIT_AUTOMAKE("xineplugin", 0.1)
+
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+AM_DISABLE_STATIC
+AM_PROG_LIBTOOL
+AC_SUBST(LIBTOOL_DEPS)
+
+dnl
+dnl Checks for X11
+dnl
+AC_PATH_XTRA
+if test x"$no_x" != x"yes"; then
+    AC_DEFINE(HAVE_X11)
+fi
+
+
+dnl
+dnl Check for xine-lib
+dnl
+AM_PATH_XINE(0.9.0,, AC_MSG_ERROR(*** You should install xine-lib first ***))
+
+
+dnl
+dnl threads: xine-config tell us what should be used, but
+dnl          xitk need to be linked to thread lib, so the follow AC_SUBST() 
+dnl          are only used in src/xitk/xine-toolkit/Makefile.am
+dnl
+case "$host" in
+  *-*-freebsd*)
+    THREAD_LIBS="-L/usr/local/lib -pthread"
+    THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
+    CFLAGS="$CFLAGS -L/usr/local/lib $THREAD_CFLAGS"
+    CPPFLAGS="$CPPFLAGS -I/usr/local/include -L/usr/local/lib"
+    ;;
+  *)
+    AC_CHECK_LIB(pthread, pthread_create,
+             THREAD_LIBS="-lpthread",
+             AC_MSG_ERROR(pthread needed))
+    ;;
+esac
+AC_SUBST(THREAD_LIBS)
+AC_SUBST(THREAD_CFLAGS)
+
+
+CFLAGS="$CFLAGS -DXP_UNIX -Wall"
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+demo/Makefile
+])