$OpenBSD: patch-configure,v 1.34 2013/01/25 09:46:22 brad Exp $
--- configure.orig	Tue Sep 18 22:44:40 2012
+++ configure	Thu Jan 24 16:11:00 2013
@@ -1185,6 +1185,7 @@ HAVE_LIST="
     GetProcessTimes
     getrusage
     gnu_as
+    gsm_h
     ibm_asm
     inet_aton
     inline_asm
@@ -1205,7 +1206,6 @@ HAVE_LIST="
     machine_ioctl_bt848_h
     machine_ioctl_meteor_h
     makeinfo
-    malloc_h
     MapViewOfFile
     memalign
     mkstemp
@@ -2618,6 +2618,7 @@ case $target_os in
         enable pic
         disable symver
         SHFLAGS='-shared'
+        SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)'
         oss_indev_extralibs="-lossaudio"
         oss_outdev_extralibs="-lossaudio"
         ;;
@@ -2800,7 +2801,7 @@ die_license_disabled version3 libvo_amrwbenc
 
 enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
 
-disabled optimizations || check_cflags -fomit-frame-pointer
+enabled x86_32 && check_cflags -fomit-frame-pointer
 
 enable_pic() {
     enable pic
@@ -3138,7 +3139,9 @@ enabled libdirac   && require_pkg_config dirac        
     "dirac_decoder_init dirac_encoder_init"
 enabled libfaac    && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
 enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
-enabled libgsm     && require  libgsm gsm/gsm.h gsm_create -lgsm
+enabled libgsm     && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
+                            check_lib "${gsm_hdr}" gsm_create -lgsm && break;
+                        done || die "ERROR: libgsm not found"; }
 enabled libmodplug && require  libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
 enabled libmp3lame && require  "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
 enabled libnut     && require  libnut libnut.h nut_demuxer_init -lnut
@@ -3291,7 +3294,6 @@ enabled extra_warnings && check_cflags -Winline
 # add some linker flags
 check_ldflags -Wl,--warn-common
 check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
-test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
 
 echo "X{};" > $TMPV
 if test_ldflags -Wl,--version-script,$TMPV; then
@@ -3714,6 +3716,7 @@ comment=$2
 version=$3
 libs=$4
 requires=$5
+linkflags=$6
 enabled ${name#lib} || return 0
 mkdir -p $name
 cat <<EOF > $name/$name.pc
@@ -3728,7 +3731,7 @@ Version: $version
 Requires: $(enabled shared || echo $requires)
 Requires.private: $(enabled shared && echo $requires)
 Conflicts:
-Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
+Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs) $linkflags
 Libs.private: $(enabled shared && echo $libs)
 Cflags: -I\${includedir}
 EOF
@@ -3748,11 +3751,11 @@ Cflags: -I\${includedir}
 EOF
 }
 
-pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
-pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
-pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
-pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"
+pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBavutil_EXTRALIBS" "$LIBavutil_REQUIRES" "$LIBavutil_LINKFLAGS"
+pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$LIBavcodec_EXTRALIBS" "$LIBavcodec_REQUIRES" "$LIBavcodec_LINKFLAGS"
+pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$LIBavformat_EXTRALIBS" "$LIBavformat_REQUIRES" "$LIBavformat_LINKFLAGS"
+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$LIBavdevice_EXTRALIBS" "$LIBavdevice_REQUIRES" "$LIBavdevice_LINKFLAGS"
+pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$LIBavfilter_EXTRALIBS" "$LIBavfilter_REQUIRES" "$LIBavfilter_LINKFLAGS"
+pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION" "$LIBpostproc_EXTRALIBS" "$LIBpostproc_REQUIRES" "$LIBpostproc_LINKFLAGS"
+pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBswscale_EXTRALIBS" "$LIBswscale_REQUIRES" "$LIBswscale_LINKFLAGS"
+pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPLE_VERSION" "$LIBswresample_EXTRALIBS" "$LIBswresample_REQUIRES" "$LIBswresample_LINKFLAGS"
