Commit 1d62f562 authored by Olivier Aubert's avatar Olivier Aubert

mediacontrol-python/setup.py: do not use PIC libraries on win32 and darwin-ppc

parent 708b80c4
from distutils.core import setup, Extension from distutils.core import setup, Extension
import os import os
if os.sys.platform in ('win32', 'darwin'):
# Do not use PIC version on win32 and Mac OS X
vlclib='../../lib/libvlc.a'
picflag=''
else:
vlclib='../../lib/libvlc_pic.a'
picflag='pic'
def get_vlcconfig(): def get_vlcconfig():
vlcconfig=None vlcconfig=None
for n in ( 'vlc-config', for n in ( 'vlc-config',
...@@ -40,7 +48,9 @@ def get_ldflags(): ...@@ -40,7 +48,9 @@ def get_ldflags():
ldflags = [] ldflags = []
if os.sys.platform == 'darwin': if os.sys.platform == 'darwin':
ldflags = "-read_only_relocs warning".split() ldflags = "-read_only_relocs warning".split()
ldflags.extend(os.popen('%s --libs vlc pic builtin' % vlcconfig, 'r').readline().rstrip().split()) ldflags.extend(os.popen('%s --libs vlc %s builtin' % (vlcconfig,
picflag),
'r').readline().rstrip().split())
if os.sys.platform == 'darwin': if os.sys.platform == 'darwin':
ldflags.append('-lstdc++') ldflags.append('-lstdc++')
return ldflags return ldflags
...@@ -50,7 +60,7 @@ vlclocal = Extension('vlc', ...@@ -50,7 +60,7 @@ vlclocal = Extension('vlc',
sources = ['vlcglue.c', sources = ['vlcglue.c',
'../../src/control/mediacontrol_init.c'], '../../src/control/mediacontrol_init.c'],
include_dirs = ['../../include', '../../', '/usr/win32/include' ], include_dirs = ['../../include', '../../', '/usr/win32/include' ],
extra_objects = [ '../../lib/libvlc_pic.a' ], extra_objects = [ vlclib ],
extra_compile_args = get_cflags(), extra_compile_args = get_cflags(),
extra_link_args = [ '-L../..' ] + get_ldflags(), extra_link_args = [ '-L../..' ] + get_ldflags(),
) )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment