$NetBSD$

--- third_party/ffmpeg/patched-ffmpeg-mt/configure.orig	2011-05-24 08:02:43.000000000 +0000
+++ third_party/ffmpeg/patched-ffmpeg-mt/configure
@@ -2294,6 +2294,10 @@ case $target_os in
         nm_opts='-P -g'
         ;;
     netbsd)
+        if test "${subarch}" != "x86_32"; then
+            LIBOBJFLAGS='$(PIC)'
+            SHFLAGS='-shared'
+        fi
         oss_indev_extralibs="-lossaudio"
         oss_outdev_extralibs="-lossaudio"
         add_cppflags -D_XOPEN_SOURCE=600
@@ -2500,10 +2504,13 @@ check_cc <<EOF && enable attribute_may_a
 union { int x; } __attribute__((may_alias)) x;
 EOF
 
-check_cc <<EOF || die "endian test failed"
-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
+check_exec <<EOF || enable bigendian
+int main()
+{
+ long one = 1;
+ return !(*((char *)(&one)));
+}
 EOF
-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
 
 if enabled alpha; then
 
@@ -2893,6 +2900,7 @@ check_ldflags -Wl,--as-needed
 check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavcore -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
 check_ldflags -Wl,-Bsymbolic
 
+if false; then
 echo "X{};" > $TMPV
 if test_ldflags -Wl,--version-script,$TMPV; then
     append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
@@ -2905,6 +2913,7 @@ __asm__(".symver ff_foo,av_foo@VERSION")
 void ff_foo(void) {}
 EOF
 fi
+fi
 
 if enabled small; then
     add_cflags $size_cflags
