$OpenBSD: patch-configure,v 1.8 2011/03/12 21:07:09 jakemsr Exp $
--- configure.orig	Fri Feb 25 16:45:04 2011
+++ configure	Fri Feb 25 22:17:05 2011
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
 cat <<EOF
@@ -712,26 +712,14 @@ if [ "$avs" = "auto" ] ; then
     fi
 fi
 
-if [ "$pic" = "yes" ] ; then
-    CFLAGS="$CFLAGS -fPIC"
-    ASFLAGS="$ASFLAGS -DPIC"
-    # resolve textrels in the x86 asm
-    cc_check stdio.h -Wl,-Bsymbolic && LDFLAGS="$LDFLAGS -Wl,-Bsymbolic"
-fi
-
-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
-    CFLAGS="$CFLAGS -s -fomit-frame-pointer"
-    LDFLAGS="$LDFLAGS -s"
-fi
-
 if [ "$debug" = "yes" ]; then
     CFLAGS="-O1 -g $CFLAGS"
 elif [ $ARCH = ARM ]; then
     # arm-gcc-4.2 produces incorrect output with -ffast-math
     # and it doesn't save any speed anyway on 4.4, so disable it
-    CFLAGS="-O3 -fno-fast-math $CFLAGS"
+    CFLAGS="-fno-fast-math $CFLAGS"
 else
-    CFLAGS="-O3 -ffast-math $CFLAGS"
+    CFLAGS="-ffast-math $CFLAGS"
 fi
 
 if cc_check '' -fno-tree-vectorize ; then
@@ -803,7 +791,6 @@ DEVNULL=$DEVNULL
 EOF
 
 if [ "$shared" = "yes" ]; then
-    API=$(grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' ')
     if [ "$SYS" = "MINGW" ]; then
         echo "SONAME=libx264-$API.dll" >> config.mak
         echo 'IMPLIBNAME=libx264.dll.a' >> config.mak
@@ -819,14 +806,13 @@ if [ "$shared" = "yes" ]; then
     else
         echo "SOSUFFIX=so" >> config.mak
         echo "SONAME=libx264.so.$API" >> config.mak
-        echo 'SOFLAGS=-Wl,-soname,$(SONAME)' >> config.mak
     fi
     echo 'default: $(SONAME)' >> config.mak
 fi
 
 ./version.sh >> config.h
 
-pclibs="-L$libdir -lx264 $libpthread"
+pclibs="-L$libdir -lx264 -lm $libpthread"
 
 cat > x264.pc << EOF
 prefix=$prefix
