Build the WebRTC as a shared library.

1,976 views
Skip to first unread message

Dongwoo Im

unread,
Dec 7, 2011, 7:56:40 PM12/7/11
to discuss-webrtc
Hi.

I'm trying to build the WebRTC as a shared library to link with the
WebKit.
Is there any build option to make the WebRTC as a shared library
instead of static libraries?

If not, any help or comments making them as a shared library?


Thanks!

Soo-Hyun Choi

unread,
Dec 8, 2011, 3:20:32 AM12/8/11
to discuss...@googlegroups.com
It looks like the shared library build option is disabled on purpose -
<http://code.google.com/p/chromium/issues/detail?id=83308>. If this is
the case, I wonder why webrtc.org has removed (or plan to remove) this
option.

Any comments?

Cheers,
Soo-Hyun

Dongwoo Im

unread,
Dec 13, 2011, 7:53:21 AM12/13/11
to discuss-webrtc
Hi all,

I've been trying to build webrtc as a set of shared libraries, but I'm
getting stuck with a bunch of undef reference errors as follows.


What I did is,

1. Change the build option from 'static_library' to 'shared_library'
in the ".gypi" files listed below.
- build/common.gypi
- common_standalone.gypi
- voice_engine_tests.gypi

2. re-run build script
$> ./build/gyp_chromium --depth=. webrtc.gyp

3. Removed test related objects in "All.target.mk"
- removed all test related stuffs as I don't need the test codes at
the moment.
(e.g., removed '$(builddir)/common_audio_unittests', and so on)

4. run make
$> make all

Then I met a bunch of "undefined reference" errors as shown in the
link below.
- http://paste.pocoo.org/show/520212/


Any comments? I really need some help from you guys!

Cheers,
Dongwoo

Soo-Hyun Choi

unread,
Dec 22, 2011, 5:22:22 AM12/22/11
to discuss...@googlegroups.com
Hi all,

I have created a diff file that enables to build shared libraries:
<http://hackerslab.eu/src/build_so.diff>. Basically, the original
gyp/gypi files are missing a condition that adds "-shared" option in
LDFLAGS_Debug in the associated ".mk" file.

1) Apply the above diff file
$> patch -p0 < build_so.diff

2) Update .mk files
$> ./build/gyp_chromium -D "library=shared_library" --depth=. webrtc.gyp

3) Build
$> make all

I'd kindly like to get to know of your feedback on this patch.

Cheers,
Soo-Hyun


P.S.
The diff file can be also accessed at
<http://paste.pocoo.org/show/dpjRzawB0McPePJarDZj/>.

Felix Lechner

unread,
Feb 23, 2012, 8:38:57 AM2/23/12
to discuss...@googlegroups.com
Soo-Hyun,

Thank you for the patch. It will be helpful to me, except it no longer works with svn1751.

Would you have an updated patch?

Thank you.

Felix

ac tsai

unread,
Mar 21, 2012, 3:39:27 AM3/21/12
to discuss...@googlegroups.com
Dear Soo-Hyun,

When I executed step 2), some messages are showing as:
Updating projects from gyp files...
python: can't open file '.webrtc.gyp/tools/win/supalink/check_installed.py': [Errno uch file or directory
Traceback (most recent call last):
  File "./build/gyp_chromium", line 171, in <module>
    sys.exit(gyp.main(args))
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/__init__.py", line 471, in m
    options.circular_check)
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/__init__.py", line 111, in L
    depth, generator_input_info, check, circular_check)
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/input.py", line 2289, in Loa
    depth, check)
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/input.py", line 387, in LoaduildFile
    build_file_path)
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/input.py", line 932, in ProcablesAndConditionsInDict
    variables, build_file, 'variables')
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/input.py", line 939, in ProcablesAndConditionsInDict
    expanded = ExpandVariables(value, is_late, variables, build_file)
  File "/home/ann/depot_tools/trunk/tools/gyp/pylib/gyp/input.py", line 696, in Expables
    (contents, p.returncode))
Exception: Call to 'python .webrtc.gyp/tools/win/supalink/check_installed.py' return status 2. while trying to load webrtc.gyp

Do you know why this happens?
Please kindly give me some advice.
Thank you very much.
AC Tsai

Soo-Hyun Choi

unread,
Mar 22, 2012, 1:08:40 AM3/22/12
to discuss...@googlegroups.com
On Wed, Mar 21, 2012 at 16:39, ac tsai <acts...@gmail.com> wrote:
> Dear Soo-Hyun,

>
> Do you know why this happens?
> Please kindly give me some advice.

Basically, WebRTC.org has been radically changed since I've put up the
patch. However, it would be easy for you to create your own patch by
consulting my original one: you could simply add "-shared" option in
the necessary gyp/gypi files.

Kind regards,
Soo-Hyun

Reply all
Reply to author
Forward
0 new messages