Compile and build mplayer in Solaris

Get mplayer source :

download mplayer from page.

You can also get MPlayer via Subversion. (If you use proxy in SWAN, before check out source you need install and configure runsocks) Issue the following command to
get the latest sources:

svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

If you use runsocks:

runsocks svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

A directory named mplayer will be created in the current directory.
You can later update your sources by typing

svn update

If you use runsocks:

runsocks svn update

from within that directory.

The sources will contain the libav* directories from FFmpeg so you
don’t need to download these separately.

Build and Compile mplayer

prepare:

  • install cbe env
  • install gmake , gcc (optional, you can use default in Solaris /usr/sfw/bin/gcc)

build:

  • set evn: . /opt/jdsbld/bin/env.sh
  • export CPP="/usr/sfw/bin/gcc -E"
  • export CC=/usr/sfw/bin/gcc
  • configure –enable-gui –enable-menu
  • $path/gmake
  • $path/gmake install

Issue and solution 

  • If you can not run configure file, modify #!/bin/sh to #!/bin/ksh. BecauseSolaris /bin/sh doesn’t support $(foo) but /bin/ksh does. you can also modify configure file by yourself
  • If awk syntax error was happened, modify awk to gawk in Makefile.
  • After make you may see "gcc:unrecognized option `-rdynamic’".
    It's maybe a bug in the configuration, and since it's harmless, nobody had
    bothered to remove it. However, it should be fixed in the future.

    What is -rdynamic?

    It's used for resolving symbols in the executable itself when using
    dynamic loading, and typically is a synonym for whatever the native
    linker expects (-export-dynamic on Linux for example). On some OS's
    such as IRIX, it's ignored, and just works. .
    The -rdynamic option is slightly different. It seems to have been
    introduced as a high-level interface to the linker, to (a) force the
    allocation of a global symbol table in the final executable, even if it's
    not strictly needed, and (b) cause the inclusion of the global symbols in
    that symbol table.
    FYI: gcc link option page
    Add document mail.

       2 Solutions:

       1> Delete it in configure file

       2> Instead, with a gcc that is configured to use GNU’s assembler and linker, I had to use -Wl,-export-dynamic which is apparently what -rdynamic translates into on Linux. Without that, the –load-extension feature doesn’t work. On the other hand, if gcc is configured to use the Solaris assembler and linker, –load-extension works even though -rdynamic is ignored. Many gcc installations on Solaris are configured to use the Solaris assembler and linker by default, But You could force gcc to use them with -B/usr/ccs/bin/.
  

4 thoughts on “Compile and build mplayer in Solaris

  1. Hi, I follow the steps, but when meet "gcc:unrecognized option `-rdynamic’".
    I could not fix it.
    your solutions have two way, but each one I try is failed.
    Can you explain how to:
    ‘Delete it in configure file’ ?
    how to delete "-rdynamic" ?

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s