summaryrefslogtreecommitdiff
path: root/python/setup.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'python/setup.py.in')
-rw-r--r--python/setup.py.in31
1 files changed, 6 insertions, 25 deletions
diff --git a/python/setup.py.in b/python/setup.py.in
index 77c10b07..4d77fbc7 100644
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -1,35 +1,16 @@
from distutils.core import setup
from distutils.extension import Extension
-import sys
import re
-def fail(msg):
- sys.stderr.write(msg)
- sys.exit(1)
-
INC = ['..', 'src/', '../decoder', '../utils', '../mteval']
LIB = ['../decoder', '../utils', '../mteval', '../training', '../klm/lm', '../klm/util']
-# set automatically by configure
-raw_config_libs = '@LIBS@'
-
-try:
- with open('../config.status') as config:
- config = config.read()
- subs = dict(re.findall('s,@(\w+)@,\|#_!!_#\|(.*),g', config)) # sed
- if not subs:
- subs = dict(re.findall('S\["(\w+)"\]="(.*)"', config)) # awk
- if not subs:
- fail('Cannot parse config.status\n'
- 'Please report this bug to the developers')
- LIBS = re.findall('-l([^\s]+)', subs['LIBS'])
- CPPFLAGS = re.findall('-[^R][^\s]+', subs['CPPFLAGS'])
- LDFLAGS = re.findall('-[^\s]+', subs['LDFLAGS'])
- LDFLAGS = [opt.replace('-R', '-Wl,-rpath,') for opt in LDFLAGS]
-except IOError:
- fail('Did you run ./configure? Cannot find config.status')
-except KeyError as e:
- fail('Cannot find option {0} in config.status'.format(e))
+# Set automatically by configure
+LIBS = re.findall('-l([^\s]+)', '@LIBS@')
+CPPFLAGS = re.findall('-[^\s]+', '@CPPFLAGS@')
+LDFLAGS = re.findall('-[^\s]+', '@LDFLAGS@')
+# Make sure linker flags go only to the linker
+LDFLAGS = [opt.replace('-R', '-Wl,-rpath,') for opt in LDFLAGS]
ext_modules = [
Extension(name='cdec._cdec',