$OpenBSD: patch-configure,v 1.20 2016/05/09 06:09:09 ajacoutot Exp $
--- configure.orig	Sun May  8 16:45:04 2016
+++ configure	Sun May  8 21:29:24 2016
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
 cat <<EOF
@@ -1164,10 +1164,6 @@ if [ "$pic" = "yes" ] ; then
     [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
 fi
 
-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
-    CFLAGS="$CFLAGS -fomit-frame-pointer"
-fi
-
 if [ "$strip" = "yes" ]; then
     LDFLAGS="$LDFLAGS -s"
 fi
@@ -1175,8 +1171,12 @@ fi
 if [ "$debug" = "yes" ]; then
     CFLAGS="-O1 -g $CFLAGS"
     RCFLAGS="$RCFLAGS -DDEBUG"
+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="-fno-fast-math $CFLAGS"
 else
-    CFLAGS="-O3 -ffast-math $CFLAGS"
+    CFLAGS="-ffast-math $CFLAGS"
 fi
 
 if cc_check '' -fno-tree-vectorize ; then
@@ -1203,10 +1203,6 @@ if cc_check '' -Wshadow ; then
     CFLAGS="-Wshadow $CFLAGS"
 fi
 
-if cc_check '' -Wmaybe-uninitialized ; then
-    CFLAGS="-Wno-maybe-uninitialized $CFLAGS"
-fi
-
 if [ $compiler = ICC -o $compiler = ICL ] ; then
     if cc_check 'extras/intel_dispatcher.h' '' 'x264_intel_dispatcher_override();' ; then
         define HAVE_INTEL_DISPATCHER
@@ -1383,7 +1379,6 @@ if [ "$cli" = "yes" ]; then
 fi
 
 if [ "$shared" = "yes" ]; then
-    API=$(grep '#define X264_BUILD' < ${SRCPATH}/x264.h | cut -f 3 -d ' ')
     if [ "$SYS" = "WINDOWS" -o "$SYS" = "CYGWIN" ]; then
         echo "SONAME=libx264-$API.dll" >> config.mak
         if [ $compiler_style = MS ]; then
@@ -1411,7 +1406,7 @@ if [ "$shared" = "yes" ]; then
     else
         echo "SOSUFFIX=so" >> config.mak
         echo "SONAME=libx264.so.$API" >> config.mak
-        echo "SOFLAGS=-shared -Wl,-soname,\$(SONAME) $SOFLAGS" >> config.mak
+        echo "SOFLAGS=-shared $SOFLAGS" >> config.mak
     fi
     echo 'default: lib-shared' >> config.mak
     echo 'install: install-lib-shared' >> config.mak
