$OpenBSD: patch-configure,v 1.15 2013/06/19 13:24:18 ajacoutot Exp $

https://bugs.webkit.org/show_bug.cgi?id=117796

- Chunk 1, 2 & 6 : https://bugs.webkit.org/show_bug.cgi?id=109932
Only webkit2 requires c++11 features atm, so let's relax the check until we have webkit2

- Chunk 3 : GNOME Bug 627126 - gsettings schema files don't get installed on FreeBSD
glib commit 136e705e8383ff8848e425ac01278102d7badc52

- Chunk 7 : Don't force the use of -O2, the ports infrastructure
takes care of that

--- configure.orig	Tue Jun 11 12:47:07 2013
+++ configure	Tue Jun 18 15:42:59 2013
@@ -4729,7 +4729,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \
+#if !(defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 2) \
     && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0)
 #error Unsupported compiler
 #endif
@@ -4766,7 +4766,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if !(defined(__GNUG__) && defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 7) \
+#if !(defined(__GNUG__) && defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 2) \
     && !(defined(__clang__) && __clang_major__ >= 3 && __clang_minor__ >= 0)
 #error Unsupported compiler
 #endif
@@ -17503,26 +17503,14 @@ gsettings__enum_file = $(addsuffix .enums.xml,$(gsetti
 
 all-am: $(gsettings_SCHEMAS:.xml=.valid)
 uninstall-am: uninstall-gsettings-schemas
-install-data-am: install-gsettings-schemas
+install-data-am:
 
 .SECONDARY: $(gsettings_SCHEMAS)
 
-gsettings__base_list = \
-  sed "$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g" | \
-  sed "$$!N;$$!N;$$!N;$$!N;s/\n/ /g"
-
-install-gsettings-schemas: $(gsettings_SCHEMAS:.xml=.valid) $(gsettings__enum_file)
+install-gsettings-schemas: $(gsettings_SCHEMAS) $(gsettings__enum_file)
 	@$(NORMAL_INSTALL)
 	test -z "$(gsettingsschemadir)" || $(MKDIR_P) "$(DESTDIR)$(gsettingsschemadir)"
-	@list='\''$(gsettings__enum_file) $(gsettings_SCHEMAS)'\''; test -n "$(gsettingsschemadir)" || list=; \
-	for p in $$list; do \
-	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
-	  echo "$$d$$p"; \
-	done | $(gsettings__base_list) | \
-	while read files; do \
-	  echo " $(INSTALL_DATA) $$files '\''$(DESTDIR)$(gsettingsschemadir)'\''"; \
-	  $(INSTALL_DATA) $$files "$(DESTDIR)$(gsettingsschemadir)" || exit $$?; \
-	done
+	$(INSTALL_DATA) $^ "$(DESTDIR)$(gsettingsschemadir)"
 	test -n "$(GSETTINGS_DISABLE_SCHEMAS_COMPILE)$(DESTDIR)" || $(GLIB_COMPILE_SCHEMAS) $(gsettingsschemadir)
 
 uninstall-gsettings-schemas:
@@ -19456,12 +19444,12 @@ if test -n "$HARFBUZZ_ICU_CFLAGS"; then
     pkg_cv_HARFBUZZ_ICU_CFLAGS="$HARFBUZZ_ICU_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz-icu >= \$0.9.7\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "harfbuzz-icu >= $0.9.7") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz-icu >= \0.9.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "harfbuzz-icu >= 0.9.7") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_HARFBUZZ_ICU_CFLAGS=`$PKG_CONFIG --cflags "harfbuzz-icu >= $0.9.7" 2>/dev/null`
+  pkg_cv_HARFBUZZ_ICU_CFLAGS=`$PKG_CONFIG --cflags "harfbuzz-icu >= 0.9.7" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -19473,12 +19461,12 @@ if test -n "$HARFBUZZ_ICU_LIBS"; then
     pkg_cv_HARFBUZZ_ICU_LIBS="$HARFBUZZ_ICU_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz-icu >= \$0.9.7\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "harfbuzz-icu >= $0.9.7") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"harfbuzz-icu >= \0.9.7\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "harfbuzz-icu >= 0.9.7") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_HARFBUZZ_ICU_LIBS=`$PKG_CONFIG --libs "harfbuzz-icu >= $0.9.7" 2>/dev/null`
+  pkg_cv_HARFBUZZ_ICU_LIBS=`$PKG_CONFIG --libs "harfbuzz-icu >= 0.9.7" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -19499,14 +19487,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        HARFBUZZ_ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "harfbuzz-icu >= $0.9.7" 2>&1`
+	        HARFBUZZ_ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "harfbuzz-icu >= 0.9.7" 2>&1`
         else
-	        HARFBUZZ_ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "harfbuzz-icu >= $0.9.7" 2>&1`
+	        HARFBUZZ_ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "harfbuzz-icu >= 0.9.7" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$HARFBUZZ_ICU_PKG_ERRORS" >&5
 
-	as_fn_error $? "Package requirements (harfbuzz-icu >= $0.9.7) were not met:
+	as_fn_error $? "Package requirements (harfbuzz-icu >= 0.9.7) were not met:
 
 $HARFBUZZ_ICU_PKG_ERRORS
 
@@ -19538,8 +19526,8 @@ else
 $as_echo "yes" >&6; }
 
 fi
-    FREETYPE_CFLAGS+=" $HARFBUZZ_ICU_CFLAGS"
-    FREETYPE_LIBS+=" $HARFBUZZ_ICU_LIBS"
+    FREETYPE_CFLAGS="$FREETYPE_CFLAGS $HARFBUZZ_ICU_CFLAGS"
+    FREETYPE_LIBS="$FREETYPE_LIBS $HARFBUZZ_ICU_LIBS"
 fi
 
 
@@ -20341,18 +20329,18 @@ fi
 
 if test "$with_acceleration_backend" = "opengl"; then
     if test "$enable_gles2" = "yes"; then
-        acceleration_backend_description+= "(gles2"
+        acceleration_backend_description= "(gles2"
         OPENGL_LIBS="-lGLESv2"
     else
-        acceleration_backend_description+="(gl"
+        acceleration_backend_description="(gl"
         OPENGL_LIBS="-lGL"
     fi
     if test "$enable_egl" = "yes"; then
-        acceleration_backend_description+=", egl"
-        OPENGL_LIBS+=" -lEGL"
+        acceleration_backend_description="$acceleration_backend_description, egl"
+        OPENGL_LIBS="$OPENGL_LIBS -lEGL"
     fi
     if test "$enable_glx" = "yes"; then
-        acceleration_backend_description+=", glx"
+        acceleration_backend_description="$acceleration_backend_description, glx"
     fi
 
     # Check whether dlopen() is in the core libc like on FreeBSD, or in a separate
@@ -20405,8 +20393,8 @@ fi
 
 
 
-    OPENGL_LIBS+=" $DLOPEN_LIBS"
-    acceleration_backend_description+=")"
+    OPENGL_LIBS="$OPENGL_LIBS $DLOPEN_LIBS"
+    acceleration_backend_description="$acceleration_backend_description)"
 fi
 
 
@@ -21160,7 +21148,7 @@ fi
 # Use C99 as the language standard for C code.
 CFLAGS="$CFLAGS -std=c99"
 # Do not warn about C++11 incompatibilities.
-CXXFLAGS="$CXXFLAGS -Wno-c++11-compat"
+# CXXFLAGS="$CXXFLAGS -Wno-c++11-compat"
 
 # Clang requires suppression of unused arguments warning.
 if test "$CC" = "clang"; then
@@ -21188,8 +21176,8 @@ fi
 
 # Add the appropriate 'O' level for optimized builds.
 if test "$enable_optimizations" = "yes"; then
-    CXXFLAGS="$CXXFLAGS -O2"
-    CFLAGS="$CFLAGS -O2"
+    CXXFLAGS="$CXXFLAGS"
+    CFLAGS="$CFLAGS"
 else
     CXXFLAGS="$CXXFLAGS -O0"
     CFLAGS="$CFLAGS -O0"
