Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Aug 2010 18:50:03 GMT
From:      Andreas Tobler <andreast@fgznet.ch>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/149913: [patch] make multimedia/mplayer work on powerpc
Message-ID:  <201008231850.o7NIo3PX046526@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/149913; it has been noted by GNATS.

From: Andreas Tobler <andreast@fgznet.ch>
To: bug-followup@FreeBSD.org, andreast@fgznet.ch
Cc:  
Subject: Re: ports/149913: [patch] make multimedia/mplayer work on powerpc
Date: Mon, 23 Aug 2010 20:44:56 +0200

 This is a multi-part message in MIME format.
 --------------030307080407020001020202
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Here the second file:
 
 
 --------------030307080407020001020202
 Content-Type: text/plain;
  name="patch-configure.txt"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="patch-configure.txt"
 
 --- configure.orig	2010-07-14 15:49:08.000000000 +0200
 +++ configure	2010-08-23 19:18:20.000000000 +0200
 @@ -555,7 +555,7 @@
  _iwmmxt=auto
  _mtrr=auto
  _altivec=auto
 -_install=install
 +_install=@${BSD_INSTALL_PROGRAM}
  _ranlib=ranlib
  _windres=windres
  _cc=cc
 @@ -1385,7 +1385,6 @@
  
    *)
      echo "Unknown parameter: $ac_option"
 -    exit 1
      ;;
  
    esac
 @@ -1494,8 +1493,8 @@
  _timer=timer-linux.c
  _getch=getch2.c
  if freebsd ; then
 -  extra_ldflags="$extra_ldflags -L/usr/local/lib"
 -  extra_cflags="$extra_cflags -I/usr/local/include"
 +  extra_ldflags="$extra_ldflags -L$_prefix/lib"
 +  extra_cflags="$extra_cflags -I$_prefix/include"
  fi
  
  if netbsd || dragonfly ; then
 @@ -1605,7 +1604,7 @@
    esac
    echores "$cc_version"
  else
 -  for _cc in "$_cc" gcc cc ; do
 +  for _cc in "$_cc" cc cc ; do
      cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
      if test "$cc_name_tmp" = "gcc"; then
        cc_name=$cc_name_tmp
 @@ -1803,7 +1802,7 @@
    if test "$_gcc3_ext" != ""; then
      # if we had to disable sse/sse2 because the active kernel does not
      # support this instruction set extension, we also have to tell
 -    # gcc3 to not generate sse/sse2 instructions for normal C code
 +    # cc to not generate sse/sse2 instructions for normal C code
      cflag_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
    fi
  
 @@ -1854,15 +1853,15 @@
          # AMD CPUs just from their signature. Instead, we check directly
          # whether it supports SSE.
          if test "$_sse" = yes; then
 -            # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
 +            # cc treats athlon-xp, athlon-4 and athlon-mp similarly.
              proc=athlon-xp
          else
 -            # Again, gcc treats athlon and athlon-tbird similarly.
 +            # Again, cc treats athlon and athlon-tbird similarly.
              proc=athlon
          fi
          ;;
      15) iproc=686
 -        # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
 +        # k8 cpu-type only supported in cc >= 3.4.0, but that will be
          # caught and remedied in the optimization tests below.
          proc=k8
          ;;
 @@ -1946,11 +1945,11 @@
    fi # test "$_runtime_cpudetection" = no
  
  
 -    # check that gcc supports our CPU, if not, fall back to earlier ones
 +    # check that cc supports our CPU, if not, fall back to earlier ones
      # LGB: check -mcpu and -march swithing step by step with enabling
      # to fall back till 386.
  
 -    # gcc >= 3.4.0  doesn't support -mcpu, we have to use -mtune instead
 +    # cc >= 3.4.0  doesn't support -mcpu, we have to use -mtune instead
  
      if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
          cpuopt=-mtune
 @@ -2075,7 +2074,7 @@
      def_fast_64bit='#define HAVE_FAST_64BIT 1'
      iproc='x86_64'
  
 -    # gcc >= 3.4.0  doesn't support -mcpu, we have to use -mtune instead
 +    # cc >= 3.4.0  doesn't support -mcpu, we have to use -mtune instead
      if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
          cpuopt=-mtune
      else
 @@ -2121,7 +2120,7 @@
        if test "$proc" = "k8"; then
          cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
        fi
 -      # This will fail if gcc version < 3.3, which is ok because earlier
 +      # This will fail if cc version < 3.3, which is ok because earlier
        # versions don't really support 64-bit on amd64.
        # Is this a valid assumption? -Corey
        if test "$proc" = "athlon-xp"; then
 @@ -2238,7 +2237,7 @@
          fi
          ;;
        NetBSD)
 -        # only gcc 3.4 works reliably with AltiVec code under NetBSD
 +        # only cc 3.4 works reliably with AltiVec code under NetBSD
          case $cc_version in
              2*|3.0*|3.1*|3.2*|3.3*)
                  ;;
 @@ -2275,7 +2274,7 @@
              POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
              *) ;;
          esac
 -        # gcc 3.1(.1) and up supports 7400 and 7450
 +        # cc 3.1(.1) and up supports 7400 and 7450
          if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
              case "$proc" in
                  7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
 @@ -2283,7 +2282,7 @@
                  *) ;;
              esac
          fi
 -        # gcc 3.2 and up supports 970
 +        # cc 3.2 and up supports 970
          if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
              case "$proc" in
                  970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
 @@ -2291,14 +2290,14 @@
                  *) ;;
              esac
          fi
 -        # gcc 3.3 and up supports POWER4
 +        # cc 3.3 and up supports POWER4
          if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
              case "$proc" in
                  POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
                  *) ;;
              esac
          fi
 -        # gcc 3.4 and up supports 440*
 +        # cc 3.4 and up supports 440*
          if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
              case "$proc" in
                  440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
 @@ -2306,7 +2305,7 @@
                  *) ;;
              esac
          fi
 -        # gcc 4.0 and up supports POWER5
 +        # cc 4.0 and up supports POWER5
          if test "$_cc_major" -ge "4"; then
              case "$proc" in
                  POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
 @@ -2383,7 +2382,7 @@
              R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
              R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
          esac
 -        # gcc < 3.x does not support -mtune.
 +        # cc < 3.x does not support -mtune.
          if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
              _mcpu=''
          fi
 @@ -2513,7 +2512,7 @@
  echocheck "GCC support of -mstackrealign"
  # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
  # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
 -# crashes when loading Win32 DLLs. Unfortunately some gcc versions create
 +# crashes when loading Win32 DLLs. Unfortunately some cc versions create
  # wrong code with this flag, but this can be worked around by adding
  # -fno-unit-at-a-time as described in the blog post at
  # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
 @@ -2687,7 +2686,7 @@
          "xor %0, %0"
          :"=b"(x)
          // just adding ebx to clobber list seems unreliable with some
 -        // compilers, e.g. Haiku's gcc 2.95
 +        // compilers, e.g. Haiku's cc 2.95
      );
      // and the above check does not work for OSX 64 bit...
      __asm__ volatile("":::"%ebx");
 @@ -3618,22 +3617,10 @@
  if linux ; then
    THREAD_CFLAGS=-D_REENTRANT
  elif freebsd || netbsd || openbsd || bsdos ; then
 -  THREAD_CFLAGS=-D_THREAD_SAFE
 -fi
 -if test "$_pthreads" = auto ; then
 -cat > $TMPC << EOF
 -#include <pthread.h>
 -void* func(void *arg) { return arg; }
 -int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
 -EOF
 -_pthreads=no
 -if ! hpux ; then
 -  for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
 -    # for crosscompilation, we cannot execute the program, be happy if we can link statically
 -    cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
 -  done
 -fi
 +  THREAD_CFLAGS=${PTHREAD_CFLAGS}
  fi
 +_pthreads=yes
 +_ld_pthread="${PTHREAD_LIBS}"
  if test "$_pthreads" = yes ; then
    test $_ld_pthread && res_comment="using $_ld_pthread"
    def_pthreads='#define HAVE_PTHREADS 1'
 @@ -3746,8 +3733,13 @@
  
  
  echocheck "sys/dvdio.h"
 +cat > $TMPC << EOF
 +#include <unistd.h>
 +#include <sys/dvdio.h>
 +int main(void) { return 0; }
 +EOF
  _dvdio=no
 -header_check sys/dvdio.h && _dvdio=yes
 +cc_check && _dvdio=yes
  if test "$_dvdio" = yes ; then
    def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
  else
 @@ -4388,7 +4380,7 @@
      fi
    done
    if test $_cross_compile = no; then
 -    for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
 +    for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/local/include \
               /usr/include/X11R6 /usr/openwin/include ; do
        if test -f "$I/X11/Xlib.h" ; then
          extra_cflags="$extra_cflags -I$I"
 @@ -4408,8 +4400,8 @@
  #include <X11/Xutil.h>
  int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
  EOF
 -  for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
 -           -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
 +  for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/local/lib -L/usr/lib/X11R6 \
 +           -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/local/lib64 \
             -L/usr/lib ; do
      if netbsd; then
        _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
 @@ -6038,7 +6030,7 @@
  elif amigaos ; then
    default_cdrom_device="a1ide.device:2"
  else
 -  default_cdrom_device="/dev/cdrom"
 +  default_cdrom_device="/dev/acd0"
  fi
  
  if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
 @@ -6046,7 +6038,7 @@
  elif darwin ; then
    default_dvd_device="/dev/rdiskN"
  else
 -  default_dvd_device="/dev/dvd"
 +  default_dvd_device="/dev/acd0"
  fi
  
  
 @@ -6936,7 +6928,7 @@
      case $cc_version in
        3.1*|3.2) # ICE/insn with these versions
          _faad_internal=no
 -        res_comment="broken gcc"
 +        res_comment="broken cc"
          ;;
        *)
          _faad=yes
 @@ -7800,7 +7792,7 @@
  else
    # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
    # png for vf_screenshot, mjpeg for zr
 -  libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
 +  libavencoders="MPEG1VIDEO_ENCODER H263_ENCODER SNOW_ENCODER"
    test "$_zlib" = yes && libavencoders="$libavencoders PNG_ENCODER"
    test "$_zr" = yes && libavencoders="$libavencoders MJPEG_ENCODER"
    libavmuxers=""
 @@ -8161,8 +8153,11 @@
  if test "$_gui" = yes ; then
  
    # Required libraries
 -  if test "$_libavcodec" != yes ||
 -      ! echo $libavdecoders | grep -q PNG_DECODER ; then
 +  # Work around a sh bug in FreeBSD < 8
 +  if test "$_libavcodec" != yes ; then
 +    die "The GUI requires libavcodec with PNG support (needs zlib)."
 +  fi
 +  if ! echo $libavdecoders | grep -q PNG_DECODER ; then
      die "The GUI requires libavcodec with PNG support (needs zlib)."
    fi
    test "$_freetype" = no && test "$_bitmap_font" = no && \
 @@ -8352,7 +8347,7 @@
  echocheck "joystick"
  def_joystick='#undef CONFIG_JOYSTICK'
  if test "$_joystick" = yes ; then
 -  if linux ; then
 +  if linux || freebsd ; then
      # TODO add some check
      def_joystick='#define CONFIG_JOYSTICK 1'
    else
 @@ -8438,7 +8433,7 @@
    CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
    if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
      # dvdread support requires this (for off64_t)
 -    CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
 +    CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"
    fi
  fi
  
 @@ -8560,7 +8555,7 @@
  EXESUF      = $_exesuf
  EXESUFS_ALL = .exe
  
 -ARCH = $arch
 +MPLAYER_ARCH = $arch
  $(mak_enable "$arch_all"    "$arch"    ARCH)
  $(mak_enable "$subarch_all" "$subarch" ARCH)
  $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
 @@ -8761,7 +8756,7 @@
  HOSTCFLAGS = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
  HOSTLIBS   = -lm
  CC_O       = -o \$@
 -LD         = gcc
 +LD         = cc
  RANLIB     = $_ranlib
  YASM       = $_yasm
  YASMDEP    = $_yasm
 
 --------------030307080407020001020202--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008231850.o7NIo3PX046526>