python build: check that the lib was compiled PIC
This commit is contained in:
parent
2a091e874c
commit
cc5ba21d79
@ -1,8 +1,9 @@
|
|||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
sys = os.uname()[0]
|
sysname = os.uname()[0]
|
||||||
if sys == 'Linux':
|
if sysname == 'Linux':
|
||||||
libs = ['rcl', 'xapian']
|
libs = ['rcl', 'xapian']
|
||||||
else:
|
else:
|
||||||
libs = ['rcl', 'xapian', 'iconv']
|
libs = ['rcl', 'xapian', 'iconv']
|
||||||
@ -16,12 +17,28 @@ for datadir in datadirs:
|
|||||||
if os.path.exists(datadir):
|
if os.path.exists(datadir):
|
||||||
break
|
break
|
||||||
if datadir == '/':
|
if datadir == '/':
|
||||||
print 'You need to install Recoll first'
|
print 'share/recoll directory not found: you need to install Recoll first'
|
||||||
os.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
top = os.path.join('..', '..')
|
top = os.path.join('..', '..')
|
||||||
|
|
||||||
|
# Test for PIC library
|
||||||
|
localdefs = os.path.join(top, 'mk', 'localdefs')
|
||||||
|
try:
|
||||||
|
lines = open(localdefs, 'r').readlines()
|
||||||
|
except:
|
||||||
|
print 'You need to build recoll first. Use configure --enable-pic'
|
||||||
|
sys.exit(1)
|
||||||
|
picok = False
|
||||||
|
for line in lines:
|
||||||
|
if line.find('PICFLAGS') == 0:
|
||||||
|
picok = True
|
||||||
|
break
|
||||||
|
if not picok:
|
||||||
|
print 'You need to rebuild recoll with PIC enabled. Use configure --enable-pic and make clean'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
module1 = Extension('recoll',
|
module1 = Extension('recoll',
|
||||||
define_macros = [('MAJOR_VERSION', '1'),
|
define_macros = [('MAJOR_VERSION', '1'),
|
||||||
('MINOR_VERSION', '0'),
|
('MINOR_VERSION', '0'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user