]> git.sesse.net Git - vlc/blobdiff - bindings/python/setup.py
macosx: Fix a memleak.
[vlc] / bindings / python / setup.py
index 5589b7f9d733422e059a2862c77b7fee5f9ec028..018e0809e03f72efc10a3cc557da36fb356ebad2 100644 (file)
@@ -2,16 +2,8 @@ from distutils.core import setup, Extension
 import os
 
 # Get build variables (buildir, srcdir)
-try:
-    top_builddir=os.environ['top_builddir']
-except KeyError:
-    # Note: do not initialize here, so that we get
-    # a correct default value if the env. var is
-    # defined but empty
-    top_builddir=None
-if not top_builddir:
-    top_builddir = os.path.join( '..', '..' )
-    os.environ['top_builddir'] = top_builddir
+top_builddir = os.path.join( '..', '..' )
+os.environ['top_builddir'] = top_builddir
 
 # Determine the extra link args. Normally, vlc-config should take care
 # of this and return the right path values, from a development tree or
@@ -30,13 +22,7 @@ else:
         linkargs=[ '-L' + d ]
 
 # For out-of-tree compilations
-try:
-    srcdir=os.environ['srcdir']
-except KeyError:
-    # Note: same as above
-    srcdir=None
-if not srcdir:
-    srcdir = '.'
+srcdir = '.'
 
 def get_vlcconfig():
     vlcconfig=None
@@ -71,7 +57,7 @@ def get_cflags():
 def get_ldflags():
     vlcconfig=get_vlcconfig()
     if vlcconfig is None:
-        return [ '-lvlc-control' ]
+        return [ '-lvlc' ]
     else:
        ldflags = []
        if os.sys.platform == 'darwin':
@@ -81,9 +67,9 @@ def get_ldflags():
        if os.sys.platform == 'darwin':
            ldflags.append('-lstdc++')
         if not libtool:
-            # vlc-config is broken and gives a -lvlc-control which
+            # vlc-config is broken and gives a -lvlc which
             # does not exist if libtool is disabled.
-            ldflags.remove('-lvlc-control')
+            ldflags.remove('-lvlc')
         return ldflags
 
 #source_files = [ 'vlc_module.c', 'vlc_mediacontrol.c',
@@ -92,12 +78,12 @@ source_files = [ 'vlc_module.c' ]
 
 # To compile in a local vlc tree
 vlclocal = Extension('vlc',
-                     sources = [ os.path.join( srcdir, f ) for f in source_files ],
-                     include_dirs = [ top_builddir,
-                                      os.path.join( srcdir, '..', '..', 'include' ),
-                                      srcdir,
-                                      '/usr/win32/include' ],
-                extra_objects = [ ],
+               sources = [ os.path.join( srcdir, f ) for f in source_files ],
+               include_dirs = [ top_builddir,
+                             os.path.join( srcdir, '..', '..', 'include' ),
+                             srcdir,
+                             '/usr/win32/include' ],
+               extra_objects = [ ],
                 extra_compile_args = get_cflags(),
                extra_link_args = linkargs + get_ldflags(),
                 )