+ def CheckLibkpathseaSo (context):
+ saveCFLAGS = []
+ if context.env.has_key ('CFLAGS'):
+ saveCFLAGS = context.env['CFLAGS']
+ CFLAGS_shared_no_debugging = filter (lambda x: x != '-g',
+ saveCFLAGS)\
+ + ['-shared']
+ # FIXME: how does this work, with scons
+ context.env.Replace (CFLAGS = CFLAGS_shared_no_debugging)
+ #context.env.Replace (CFLAGS = '')
+ #context.env.Append (CFLAGS = ['-shared'])
+ context.Message ('Checking for libkpathsea... ')
+ ret = conf.TryLink ('''#include <kpathsea/kpathsea.h>
+ int main ()
+ {
+ kpse_var_expand ("\$TEXMF");
+ return 0;
+ }
+ ''', '.c')
+ context.env.Replace (CFLAGS = saveCFLAGS)
+ # FIXME: this prints 'ok' already
+ context.Result (ret)
+ if not ret:
+ return 0
+
+ sys.stdout.write ('Checking for libkpathsea.so... ')
+ testfile = str (context.sconf.lastTarget)
+ shared_size = os.path.getsize (testfile)
+ ret = shared_size < 40000
+ if ret:
+ print 'ok'
+ else:
+ print 'no'
+ return ret
+