$OpenBSD: patch-configure,v 1.21 2020/10/03 10:42:49 jsg Exp $
Index: configure
--- configure.orig
+++ configure
@@ -2325,22 +2325,6 @@ if test "$_release_build" = yes; then
 	append_var DEFINES "-DRELEASE_BUILD"
 fi
 
-# By default, we add -pedantic to the CXXFLAGS to catch some potentially
-# non-portable constructs, like use of GNU extensions.
-# However, some platforms use GNU extensions in system header files, so
-# for these we must not use -pedantic.
-case $_host_os in
-3ds | android | androidsdl | gamecube | psp | switch | wii)
-	;;
-*)
-	# ICC does not support pedantic, while GCC and clang do.
-	if test "$have_icc" = no ; then
-		# We *do* want the 'long long' extension.
-		append_var CXXFLAGS "-pedantic -Wno-long-long"
-	fi
-	;;
-esac
-
 # If possible, we want to use -Wglobal-constructors
 # However, not all compilers support that, so check whether the active one does.
 echocheck "whether C++ compiler accepts -Wglobal-constructors"
@@ -4281,16 +4265,14 @@ if test "$_vorbis" = auto ; then
 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
 EOF
 	if test "$_ogg" = yes ; then
-		cc_check $OGG_CFLAGS $OGG_LIBS $VORBIS_CFLAGS $VORBIS_LIBS \
-			-lvorbisfile -lvorbis -logg && _vorbis=yes
+		cc_check `pkg-config --cflags --libs ogg vorbis vorbisfile` && _vorbis=yes
 	else
-		cc_check $VORBIS_CFLAGS $VORBIS_LIBS \
-			-lvorbisfile -lvorbis && _vorbis=yes
+		cc_check `pkg-config --cflags --libs vorbis vorbisfile` && _vorbis=yes
 	fi
 fi
 if test "$_vorbis" = yes ; then
-	append_var LIBS "$VORBIS_LIBS -lvorbisfile -lvorbis"
-	append_var INCLUDES "$VORBIS_CFLAGS"
+	append_var LIBS "`pkg-config --libs vorbis vorbisfile`"
+	append_var LIBS "`pkg-config --cflags vorbis vorbisfile`"
 fi
 define_in_config_if_yes "$_vorbis" 'USE_VORBIS'
 echo "$_vorbis"
@@ -4373,16 +4355,14 @@ int main(void) {
 }
 EOF
 	if test "$_ogg" = yes ; then
-		cc_check $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
-			-lFLAC -logg && _flac=yes
+		cc_check `pkg-config --cflags --libs flac ogg` && _flac=yes
 	else
-		cc_check $FLAC_CFLAGS $FLAC_LIBS \
-			-lFLAC && _flac=yes
+		cc_check `pkg-config --cflags --libs flac` && _flac=yes
 	fi
 fi
 if test "$_flac" = yes ; then
-	append_var LIBS "$FLAC_LIBS -lFLAC"
-	append_var INCLUDES "$FLAC_CFLAGS"
+	append_var LIBS "`pkg-config --libs flac`"
+	append_var INCLUDES "`pkg-config --cflags flac`"
 fi
 define_in_config_if_yes "$_flac" 'USE_FLAC'
 echo "$_flac"
