--- configure.in.orig	2008-08-18 07:32:19.000000000 -0500
+++ configure.in	2011-09-07 16:36:38.000000000 -0500
@@ -65,6 +65,13 @@
 
 pf_argv_set=""
 case "$host_os" in
+*freebsd*)
+		LIBS="-L/usr/local/lib"
+		CPPFLAGS="$CPPFLAGS -I/usr/local/include"
+		INIT_EXT=""
+		REBOOT_OPTIONS="-d"
+		POWEROFF_OPTIONS="-p"
+		;;
 *bsd*)		LIBS="-L/usr/local/lib"
 		CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 		INIT_EXT=".sh"
@@ -224,7 +231,7 @@
 oldincludedir=`var "$oldincludedir" "$exec_prefix/include"`
 infodir=`var "$infodir" "$prefix/info"`
 mandir=`var "$mandir" "$exec_prefix/man"`
-docdir=${datadir}/doc/${HB_PKG}-${VERSION}
+docdir=${datadir}/doc/heartbeat
 libdir=`var "$libdir" "$exec_prefix/lib"`
 libexecdir=`var "$libexecdir" "$exec_prefix/libexec"`
 noarchlibdir=`var "$noarchlibdir" "$prefix/lib"`
@@ -237,6 +244,7 @@
 dnl Always tries to set the compiler to ANSI C via options (AM)
 dnl Can force other with environment variable "CC".
 AC_PROG_CC
+AM_PROG_CC_C_O
 AC_PROG_CC_STDC
 
 dnl ************************************************************************
@@ -495,18 +503,6 @@
 AC_LIBLTDL_CONVENIENCE          dnl make libltdl a convenience lib
 AC_PROG_LIBTOOL
 
-dnl Replacing AC_PROG_LIBTOOL with AC_CHECK_PROG because LIBTOOL
-dnl was NOT being expanded all the time thus causing things to fail.
-AC_CHECK_PROGS(LIBTOOL, glibtool libtool libtool15 libtool13)
-AC_MSG_CHECKING(for glibtool or libtool*)
-if test x"${LIBTOOL}" = x""; then
-      FatalMissingThing "libtool" "You need libtool to build heartbeat." \
-		"You can get the source from ftp://www.gnu.org/pub/gnu/" \
-      		"or you can locate it via http://www.gnu.org/software/libtool"
-else
-      AC_MSG_RESULT($LIBTOOL has been found.)
-fi
-
 AC_CHECK_PROGS(MAKE, gmake make)
 AC_MSG_CHECKING(for gmake or make)
 if test x"${MAKE}" = x""; then
@@ -1718,6 +1714,7 @@
 AC_CHECK_SIZEOF(int)
 AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(clock_t, [], [#include <sys/times.h>])
 
 AC_ARG_ENABLE([all],
 [  --enable-all Activate ALL features
@@ -2381,7 +2378,7 @@
 
 
 AC_MSG_CHECKING(if clock_t is long enough)
-if test $ac_cv_sizeof_long -ge 8; then
+if test $ac_cv_sizeof_clock_t -ge 8; then
   AC_MSG_RESULT(yes)
   AC_DEFINE(CLOCK_T_IS_LONG_ENOUGH, 1, [Set if CLOCK_T is adequate by itself for the "indefinite future" (>= 100 years)])
 else
@@ -2393,13 +2390,13 @@
 dnl	Note: reduce LIBS; in particular, ltdl can cause confusion.
 dnl	Possibly better:  move 'LIBS="$LIBS -lltdl"' from above to beyond here.
 dnl
-AC_MSG_CHECKING(for getpid() consistency in multi-process/threads program)
-ac_save_LIBS=$LIBS
-LIBS="-lpthread"
-AC_TRY_RUN(`cat $srcdir/config/pidtest.c`, 
-AC_MSG_RESULT(ok), 
-[AC_MSG_RESULT(fail); AC_DEFINE(GETPID_INCONSISTENT, 1 , [pid inconsistent])],)
-LIBS=$ac_save_LIBS
+dnl AC_MSG_CHECKING(for getpid() consistency in multi-process/threads program)
+dnl ac_save_LIBS=$LIBS
+dnl LIBS="-lpthread"
+dnl AC_TRY_RUN(`cat $srcdir/config/pidtest.c`, 
+dnl AC_MSG_RESULT(ok), 
+dnl [AC_MSG_RESULT(fail); AC_DEFINE(GETPID_INCONSISTENT, 1 , [pid inconsistent])],)
+dnl LIBS=$ac_save_LIBS
 
 dnl check byte order
 AC_MSG_CHECKING(for byteorder)