From: Phil E. <ph...@li...> - 2007-11-09 17:32:42
|
Sébastien Sablé wrote: > Hi Phil, > > You can post your patch here. > Probably not the prettiest code, but it seems to work. The issue being worked around is that on CentOS5 the FreeTDS header files get installed in /usr/include/freetds rather than /usr/include. -----begin diff output----- --- setup.py.org 2007-11-08 16:59:42.000000000 +0000 +++ setup.py 2007-11-08 17:23:23.000000000 +0000 @@ -85,9 +85,16 @@ 'mail to dj...@ob... so you can help other people.\n') sys.exit(1) -syb_incdir = os.path.join(sybase, 'include') +# fixes to make compilation work on CentOS5 +_incdirs = [] +_incdirs.append(os.path.join(sybase, 'include')) +_incdirs.append(os.path.join(_incdirs[0], 'freetds')) + +syb_incdir = _incdirs syb_libdir = os.path.join(sybase, 'lib') -for dir in (syb_incdir, syb_libdir): +_dirs = syb_incdir +_dirs.append(syb_libdir) +for dir in _dirs: if not os.access(dir, os.F_OK): sys.stderr.write('Directory %s does not exist - cannot build.\n' % dir) sys.exit(1) @@ -146,15 +153,20 @@ for api in ('blk_alloc', 'blk_describe', 'blk_drop', 'blk_rowxfer_mult', 'blk_textxfer',): - if api_exists(api, os.path.join(syb_incdir, 'bkpublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'bkpublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) + for api in ('ct_cursor', 'ct_data_info', 'ct_dynamic', 'ct_send_data', 'ct_setparam',): - if api_exists(api, os.path.join(syb_incdir, 'ctpublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'ctpublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) + for api in ('cs_calc', 'cs_cmp',): - if api_exists(api, os.path.join(syb_incdir, 'cspublic.h')): - syb_macros.append(('HAVE_' + string.upper(api), None)) + for dir in syb_incdir: + if api_exists(api, os.path.join(dir, 'cspublic.h')): + syb_macros.append(('HAVE_' + string.upper(api), None)) class PreReleaseCheck: def __init__(self, distribution): @@ -207,7 +219,7 @@ description="Sybase Extension to Python", url="http://python-sybase.sourceforge.net/", py_modules=['Sybase'], - include_dirs=[syb_incdir], + include_dirs=syb_incdir, ext_modules=[ Extension('sybasect', ['blk.c', 'databuf.c', 'cmd.c', 'conn.c', 'ctx.c', ------end diff output------ > Concerning your problem, I think it is a known bug when calling a stored > procedure with execute. > Could you try con.callproc("qGetDomain @Domain='linux2000.com'") instead > of con.execute? > Cool, I'll give that a try and see how I get on. Thanks. -- Regards Phil Edwards Brighton, UK |