summaryrefslogtreecommitdiff
path: root/python/setup.py.in
diff options
context:
space:
mode:
authorVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-11 23:30:00 -0400
committerVictor Chahuneau <vchahune@cs.cmu.edu>2012-08-11 23:30:00 -0400
commit7527592aaf4245749845500aca6a7fcc97eb2f17 (patch)
treed8fdb627c657e7a4699baf0670ca749df1f7e972 /python/setup.py.in
parentdad8da6f5f65e157476b3999257069bda7b8552e (diff)
[python] fix for new dict API
- TDConvert returns a string - various c_str fixes (make copies) - cleanup .gitignore
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',