Skip to content

Commit 392a997

Browse files
author
Nima Talebi
committed
Moved a OS-specific library settings out to common
The libxml2 path is now handled by `setup_common.py', so the actual setup files are clean from any OS-specific (Debian/RedHat) hacks.
1 parent f229e49 commit 392a997

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/setup-dbg.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
#
2828

2929
from distutils.core import setup, Extension
30-
from distutils.sysconfig import get_python_lib
3130
from setup_common import *
3231

3332
#
3433
# Some default values
3534
#
3635
incdir = []
37-
#. XXX: Debian Workaound: libdir = [get_python_lib(1), "/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2]]
38-
libdir = [get_python_lib(1)]
36+
libdir = []
3937
libs = []
4038

4139
# Get libxml2 info

src/setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
#
2828

2929
from distutils.core import setup, Extension
30-
from distutils.sysconfig import get_python_lib
3130
from setup_common import *
3231

3332
#
3433
# Some default values
3534
#
3635
incdir = []
37-
#. XXX: Debian Workaound: libdir = [get_python_lib(1), "/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2]]
38-
libdir = [get_python_lib(1)]
36+
libdir = []
3937
libs = []
4038

4139
# Get libxml2 info

src/setup_common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#
2828

2929
import commands, sys
30+
from os import path as os_path
31+
from distutils.sysconfig import get_python_lib
3032

3133
# libxml2 - C flags
3234
def libxml2_include(incdir):
@@ -46,6 +48,10 @@ def libxml2_include(incdir):
4648

4749
# libxml2 - library flags
4850
def libxml2_lib(libdir, libs):
51+
libdir.append(get_python_lib(1))
52+
if os_path.exists("/etc/debian_version"): #. XXX: Debian Workaround...
53+
libdir.append("/usr/lib/pymodules/python%d.%d"%sys.version_info[0:2])
54+
4955
(res, libxml2_libs) = commands.getstatusoutput("xml2-config --libs")
5056
if res != 0:
5157
print "Could not build python-dmidecode."

0 commit comments

Comments
 (0)