$OpenBSD: patch-configure_ac,v 1.21 2018/02/10 15:29:24 ajacoutot Exp $
Index: configure.ac
--- configure.ac.orig
+++ configure.ac
@@ -871,9 +871,7 @@ AC_ARG_ENABLE([optimizations],
               [AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable])],
               [], [test x"$enable_debug" != x"no" && enable_optimizations="no"])
 AM_CONDITIONAL([DISABLE_OPTIMIZATIONS], [test x"$enable_optimizations" = x"no"])
-if test x"$enable_optimizations" = x"no"; then
-    DEFAULT_OCFLAGS="O0_CFLAGS"
-else
+if test x"$enable_optimizations" = x"yes"; then
     dnl For multi-pass compilation: never when cross-compiling
     if test x"$cross_compiling" != x"yes"; then
         if test x"$GCC" = x"yes"; then
@@ -894,7 +892,7 @@ AC_SUBST(O0_CFLAGS)
 AC_SUBST(PASS1_CFLAGS)
 AC_SUBST(PASS2_CFLAGS)
 
-test x"$DEFAULT_OCFLAGS" = x"" && DEFAULT_OCFLAGS="O3_CFLAGS"
+test x"$DEFAULT_OCFLAGS" = x"" && DEFAULT_OCFLAGS=""
 
 dnl -ffast-math fails in broken build environments due to missing stuff like _foo_pow_finite ().
 dnl We dont want to kill that feature generally either because stuff like faad will benefit a
@@ -1125,9 +1123,9 @@ t q
 b
 :q
 q"
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`"
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed 1q`"
 AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.$acl_cv_shlibext}", [The soname of libX11, needed for dlopen()])
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"*  "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"*  2>/dev/null | sed -e \"${soname_script}\"`"
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"*  "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"*  2>/dev/null | sed 1q`"
 AC_DEFINE_UNQUOTED([LIBXV_SO],  "${x_lib_location:-libXv.$acl_cv_shlibext}",  [The soname of libXv, needed for dlopen()])
 
 dnl Does X11 need XLockDisplay () to prevent deadlocks?
