--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ffmpeg-09-configure-gnuism-pod2man.diff Sun Aug 14 15:35:27 2011 +0000
@@ -0,0 +1,316 @@
+--- ffmpeg-0.8.2/configure.orig 2011-08-10 14:16:41.000000000 +0200
++++ ffmpeg-0.8.2/configure 2011-08-13 16:27:56.356242408 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # FFmpeg configure script
+ #
+@@ -307,17 +307,17 @@
+ }
+
+ c_escape(){
+- echo "$*" | sed 's/["\\]/\\\0/g'
++ echo "$*" | /usr/gnu/bin/sed 's/["\\]/\\\0/g'
+ }
+
+ sh_quote(){
+- v=$(echo "$1" | sed "s/'/'\\\\''/g")
++ v=$(echo "$1" | /usr/gnu/bin/sed "s/'/'\\\\''/g")
+ test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
+ echo "$v"
+ }
+
+ cleanws(){
+- echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
++ echo "$@" | /usr/gnu/bin/sed 's/^ *//;s/ */ /g;s/ *$//'
+ }
+
+ filter(){
+@@ -361,11 +361,11 @@
+ set_safe(){
+ var=$1
+ shift
+- eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*'
++ eval $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')='$*'
+ }
+
+ get_safe(){
+- eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g')
++ eval echo \$$(echo "$1" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+ }
+
+ pushvar(){
+@@ -405,13 +405,13 @@
+
+ enable_safe(){
+ for var; do
+- enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
++ enable $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+ done
+ }
+
+ disable_safe(){
+ for var; do
+- disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
++ disable $(echo "$var" | /usr/gnu/bin/sed 's/[^A-Za-z0-9_]/_/g')
+ done
+ }
+
+@@ -1519,7 +1519,7 @@
+ ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
+ ffserver_extralibs='$ldl'
+
+-doc_deps="texi2html"
++doc_deps="texi2html pod2man"
+
+ # tests
+
+@@ -1710,7 +1710,7 @@
+
+ # since the object filename is not given with the -MM flag, the compiler
+ # is only able to print the basename, and we must add the path ourselves
+-DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
++DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | /usr/gnu/bin/sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
+ DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
+
+ # find source path
+@@ -1720,7 +1720,7 @@
+ else
+ source_path=$(cd $(dirname "$0"); pwd)
+ enable source_path_used
+- echo "$source_path" | grep -q '[[:blank:]]' &&
++ echo "$source_path" | /usr/gnu/bin/grep -q '[[:blank:]]' &&
+ die "Out of tree builds are impossible with whitespace in source path."
+ test -e "$source_path/config.h" &&
+ die "Out of tree builds are impossible with config.h in source dir."
+@@ -1737,7 +1737,7 @@
+ thing=$1
+ pattern=$2
+ file=$source_path/$3
+- sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
++ /usr/gnu/bin/sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
+ }
+
+ ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
+@@ -1753,7 +1753,7 @@
+ FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
+
+ find_tests(){
+- map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | grep -v '[^-a-z0-9_]')
++ map "echo ${2}\${v}_test" $(ls "$source_path"/tests/ref/$1 | /usr/gnu/bin/grep -v '[^-a-z0-9_]')
+ }
+
+ ACODEC_TESTS=$(find_tests acodec)
+@@ -1781,7 +1781,7 @@
+ show_list() {
+ suffix=_$1
+ shift
+- echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
++ echo $* | /usr/gnu/bin/sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
+ exit 0
+ }
+
+@@ -1800,14 +1800,14 @@
+ map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
+ ;;
+ --enable-*=*|--disable-*=*)
+- eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
++ eval $(echo "${opt%%=*}" | /usr/gnu/bin/sed 's/--/action=/;s/-/ thing=/')
+ is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
+ eval list=\$$(toupper $thing)_LIST
+- name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
++ name=$(echo "${optval}" | /usr/gnu/bin/sed "s/,/_${thing}|/g")_${thing}
+ $action $(filter "$name" $list)
+ ;;
+ --enable-?*|--disable-?*)
+- eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
++ eval $(echo "$opt" | /usr/gnu/bin/sed 's/--/action=/;s/-/ option=/;s/-/_/g')
+ if is_in $option $COMPONENT_LIST; then
+ test $action = disable && action=unset
+ eval $action \$$(toupper ${option%s})_LIST
+@@ -1828,7 +1828,7 @@
+ *)
+ optname="${opt%%=*}"
+ optname="${optname#--}"
+- optname=$(echo "$optname" | sed 's/-/_/g')
++ optname=$(echo "$optname" | /usr/gnu/bin/sed 's/-/_/g')
+ if is_in $optname $CMDLINE_SET; then
+ eval $optname='$optval'
+ elif is_in $optname $CMDLINE_APPEND; then
+@@ -1934,7 +1934,7 @@
+ filter_cppflags=echo
+ filter_asflags=echo
+
+-if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
++if $cc -v 2>&1 | /usr/gnu/bin/grep -q '^gcc.*LLVM'; then
+ cc_type=llvm_gcc
+ cc_version=__VERSION__
+ gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
+@@ -1943,7 +1943,7 @@
+ AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+ speed_cflags='-O3'
+ size_cflags='-Os'
+-elif $cc -v 2>&1 | grep -qi ^gcc; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -qi ^gcc; then
+ cc_type=gcc
+ cc_version=__VERSION__
+ gcc_version=$($cc --version | head -n1)
+@@ -1951,13 +1951,13 @@
+ gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
+ gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
+ cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
+- if ! $cc -dumpversion | grep -q '^2\.'; then
++ if ! $cc -dumpversion | /usr/gnu/bin/grep -q '^2\.'; then
+ CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+ AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+ fi
+ speed_cflags='-O3'
+ size_cflags='-Os'
+-elif $cc --version 2>/dev/null | grep -q Intel; then
++elif $cc --version 2>/dev/null | /usr/gnu/bin/grep -q Intel; then
+ cc_type=icc
+ cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
+ cc_ident=$($cc --version | head -n1)
+@@ -1967,13 +1967,13 @@
+ speed_cflags='-O3'
+ size_cflags='-Os'
+ noopt_cflags='-O1'
+-elif $cc -v 2>&1 | grep -q xlc; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q xlc; then
+ cc_type=xlc
+ cc_version="AV_STRINGIFY(__IBMC__)"
+ cc_ident=$($cc -qversion 2>/dev/null | head -n1)
+ speed_cflags='-O5'
+ size_cflags='-O5 -qcompact'
+-elif $cc -V 2>/dev/null | grep -q Compaq; then
++elif $cc -V 2>/dev/null | /usr/gnu/bin/grep -q Compaq; then
+ cc_type=ccc
+ cc_version="AV_STRINGIFY(__DECC_VER)"
+ cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
+@@ -1982,7 +1982,7 @@
+ add_ldflags -Wl,-z,now # calls to libots crash without this
+ speed_cflags='-fast'
+ size_cflags='-O1'
+-elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
++elif $cc --vsn 2>/dev/null | /usr/gnu/bin/grep -q "ARM C/C++ Compiler"; then
+ test -d "$sysroot" || die "No valid sysroot specified."
+ cc_type=armcc
+ cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
+@@ -1993,7 +1993,7 @@
+ --configure_sysroot="$sysroot" \
+ --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
+ die "Error creating armcc configuration file."
+- $cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
++ $cc --vsn | /usr/gnu/bin/grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
+ cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
+ as_default="${cross_prefix}gcc"
+ CC_DEPFLAGS='-MMD'
+@@ -2001,7 +2001,7 @@
+ speed_cflags='-O3'
+ size_cflags='-Os'
+ filter_asflags="filter_out -W${armcc_opt}*"
+-elif $cc -version 2>/dev/null | grep -q TMS470; then
++elif $cc -version 2>/dev/null | /usr/gnu/bin/grep -q TMS470; then
+ cc_type=tms470
+ cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
+ cc_ident=$($cc -version | head -n1 | tr -s ' ')
+@@ -2041,20 +2041,20 @@
+ esac
+ done
+ }
+-elif $cc -v 2>&1 | grep -q clang; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q clang; then
+ cc_type=clang
+- $cc -dM -E $TMPC | grep -q __clang_version__ &&
++ $cc -dM -E $TMPC | /usr/gnu/bin/grep -q __clang_version__ &&
+ cc_version=__clang_version__ || cc_version=__VERSION__
+ cc_ident=$($cc --version | head -n1)
+ CC_DEPFLAGS='-MMD'
+ AS_DEPFLAGS='-MMD'
+ speed_cflags='-O3'
+ size_cflags='-Os'
+-elif $cc -V 2>&1 | grep -q Sun; then
++elif $cc -V 2>&1 | /usr/gnu/bin/grep -q Sun; then
+ cc_type=suncc
+ cc_version="AV_STRINGIFY(__SUNPRO_C)"
+ cc_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
+- DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
++ DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | /usr/gnu/bin/sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
+ DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
+ speed_cflags='-O5'
+ size_cflags='-O5 -xspace'
+@@ -2092,7 +2092,7 @@
+ esac
+ done
+ }
+-elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q 'PathScale\|Path64'; then
+ cc_type=pathscale
+ cc_version=__PATHSCALE__
+ cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
+@@ -2101,7 +2101,7 @@
+ speed_cflags='-O2'
+ size_cflags='-Os'
+ filter_cflags='filter_out -Wdisabled-optimization'
+-elif $cc -v 2>&1 | grep -q Open64; then
++elif $cc -v 2>&1 | /usr/gnu/bin/grep -q Open64; then
+ cc_type=open64
+ cc_version=__OPEN64__
+ cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
+@@ -2146,7 +2146,7 @@
+ gcc|llvm_gcc)
+ check_native(){
+ $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
+- sed -n "/$1=/{
++ /usr/gnu/bin/sed -n "/$1=/{
+ s/.*$1=\\([^ ]*\\).*/\\1/
+ p
+ q
+@@ -2291,7 +2291,7 @@
+ case $cpu in
+ armv*)
+ cpuflags="-march=$cpu"
+- subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
++ subarch=$(echo $cpu | /usr/gnu/bin/sed 's/[^a-z0-9]//g')
+ ;;
+ *)
+ cpuflags="-mcpu=$cpu"
+@@ -2605,7 +2605,7 @@
+ check_cc <<EOF || die "Symbol mangling check failed."
+ int ff_extern;
+ EOF
+-sym=$($nm $nm_opts $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
++sym=$($nm $nm_opts $TMPO | gawk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
+ extern_prefix=${sym%%ff_extern*}
+
+ check_cc <<EOF && enable inline_asm
+@@ -2630,7 +2630,7 @@
+ check_cc <<EOF || die "endian test failed"
+ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
+ EOF
+-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
++od -t x1 $TMPO | /usr/gnu/bin/grep -q '42 *49 *47 *45' && enable bigendian
+
+ if enabled alpha; then
+
+@@ -2963,7 +2963,9 @@
+ fi
+ enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
+
+-texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
++(texi2html -version > /dev/null 2>&1 || texi2html /dev/null > /dev/null 2>&1) && enable texi2html || disable texi2html
++/usr/perl5/bin/pod2man /dev/null >/dev/null 2>&1 && enable pod2man || disable pod2man
++
+
+ check_header linux/fb.h
+ check_header linux/videodev.h
+@@ -3386,7 +3388,7 @@
+ get_version(){
+ name=$1
+ file=$source_path/$2
+- eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
++ eval $(/usr/gnu/bin/grep "#define ${name}_VERSION_M" "$file" | gawk '{ print $2"="$3 }')
+ eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
+ lcname=$(tolower $name)
+ eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak