$OpenBSD: patch-configure_in,v 1.2 2004/06/24 19:27:00 sturm Exp $
--- configure.in.orig	2004-01-06 12:38:03.000000000 -0800
+++ configure.in	2004-05-20 20:07:20.000000000 -0700
@@ -64,6 +64,7 @@ case "x${target_cpu}" in
   ;;
 esac
 
+no_opt_cflags="$CFLAGS"
 
 AM_CONDITIONAL([SYSTEM_DARWIN], test x"$is_osx" = x"true")
  
@@ -141,13 +142,23 @@ AC_FUNC_STAT
 AC_FUNC_STRCOLL
 AC_TYPE_SIGNAL
 AC_CHECK_FUNCS([strtol memalign ftruncate gettimeofday memset strerror strncasecmp stat floor atexit getpagesize memmove mkfifo vsscanf strptime])
+AC_CHECK_LIB(m, lrint, AC_DEFINE(HAVE_LIBM_LRINT, 1, [Define if the lrint() function is in libm on your system]))
+
+case "$host_os" in
+  freebsd*|openbsd*|netbsd*|bsdi*|darwin*|rhapsody*)
+     AC_DEFINE([SYS_BSD], 1, [Define if your system is modern BSD])
+     ;;
+  *)
+     ;;
+esac
+
 
 dnl for libavcodec
 AC_CHECK_LIB(m, lrintf, AC_DEFINE([HAVE_LRINTF], 1, [define if you have the lrintf function]))
 
 dnl Replace `main' with a function in pthread libs:
  case "$host" in
-   *-*-freebsd*)
+   *-*-freebsd*|*-*-openbsd*)
     pthread_cflags="-D_REENTRANT -D_THREAD_SAFE"
     pthread_lib="-pthread"
     ;;
@@ -188,7 +199,7 @@ dnl       code, not whether the host can
 dnl       at run time with the exception of the SSE code.
 dnl
 dnl 
-have_asm_mmx=false
+dnl have_asm_mmx=false this is later checked with AC_CACHE_CHECK()
 have_asm_sse=false
 have_asm_3dnow=false
 have_asm_nasm=false
@@ -350,7 +361,7 @@ if test x$have_x86cpu = xtrue ; then
  AC_MSG_CHECKING(for CMOV support)
  if test "$enable_cmov_extension" != "no" ; then
  case "$host" in
- *-*-freebsd*)
+ *-*-freebsd*|*-*-openbsd*)
   cpu_features=`grep -l CMOV /var/run/dmesg.boot`
   if test X"$cpu_features" = X"/var/run/dmesg.boot" ; then
     have_cmov=true
@@ -479,6 +490,9 @@ if test x"$enable_warnings" = x"yes" -a 
     AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
 fi
 
+
+CFLAGS="$no_opt_cflags"
+
 AC_SUBST(CFLAGS)
 
 LTLIBOBJS=`echo "$AC_LIBOBJ" | sed 's,.o ,.lo ,g;s,.o$,.lo,'`
@@ -938,13 +952,17 @@ AM_CONDITIONAL(HAVE_GTK, test x"$have_gt
 dnl
 dnl LIBFAME support
 dnl
-
+AC_ARG_WITH(libfame,
+		AC_HELP_STRING([--with-libfame][use libfame (default is yes)]),
+		[], with_libfame=yes)
 have_libfame=no
+if test x$with_libfame = "x"yes ; then
 AM_PATH_LIBFAME(,
 [
 	AC_DEFINE([HAVE_LIBFAME], 1, [Have libfame support]) 
 	have_libfame=yes	
 ])
+fi
 AM_CONDITIONAL(HAVE_LIBFAME, test x"$have_libfame" = "xyes")
 
 dnl
