RE: Python sybase-0.36 module with RedHat 9
Dave Cole <[email protected]> Tue, 16 Mar 2004 15:42:26 +1100
| Newsgroups | gmane.comp.python.sybase |
|---|---|
| Organization | Object Craft P/L |
| Message-ID | <[email protected]> |
On Tue, 2004-03-16 at 15:04, Brian Beaver wrote: > Full output below, with the ldd following...thanks > > # python setup.py build_ext [snip] > gcc -shared build/temp.linux-i686-2.2/blk.o > build/temp.linux-i686-2.2/databuf.o build/temp.linux-i686-2.2/cmd.o > build/temp.linux-i686-2.2/conn.o build/temp.linux-i686-2.2/ctx.o > build/temp.linux-i686-2.2/datafmt.o build/temp.linux-i686-2.2/iodesc.o > build/temp.linux-i686-2.2/locale.o build/temp.linux-i686-2.2/msgs.o > build/temp.linux-i686-2.2/numeric.o build/temp.linux-i686-2.2/money.o > build/temp.linux-i686-2.2/datetime.o build/temp.linux-i686-2.2/sybasect.o > -L/opt/sybase-12.5/OCS/lib -o build/lib.linux-i686-2.2/sybasect.so Just as I suspected - it is not finding the Sybase libraries. Can you please try the attached patch to setup.py? - Dave -- http://www.object-craft.com.au
setup.py-patch
(text/x-patch, 1.7 KB)
Index: setup.py
===================================================================
RCS file: /usr/local/cvsroot/object-craft/sybase/setup.py,v
retrieving revision 1.50
diff -u -r1.50 setup.py
--- setup.py 24 Nov 2003 23:58:35 -0000 1.50
+++ setup.py 16 Mar 2004 04:37:57 -0000
@@ -24,12 +24,17 @@
if re.search(r'CS_PUBLIC %s' % func, text):
return 1
+sybase = None
+if os.environ.has_key('SYBASE'):
+ sybase = os.environ['SYBASE']
+ if os.environ.has_key('SYBASE_OCS'):
+ ocs = os.environ['SYBASE_OCS']
+ sybase = os.path.join(sybase, ocs)
+
if os.name == 'posix': # unix
# Most people will define the location of their Sybase
# installation in their environment.
- if os.environ.has_key('SYBASE'):
- sybase = os.environ['SYBASE']
- else:
+ if sybase is None:
# Not in environment - assume /opt/sybase
sybase = '/opt/sybase'
if not os.access(sybase, os.F_OK):
@@ -52,9 +57,7 @@
elif os.name == 'nt': # win32
# Not sure how the installation location is specified under NT
- if os.environ.has_key('SYBASE'):
- sybase = os.environ['SYBASE']
- else:
+ if sybase is None:
sybase = r'i:\sybase\sql11.5'
if not os.access(sybase, os.F_OK):
sys.stderr.write(
@@ -72,10 +75,6 @@
'figure out how to get it working for your platform, please send\n'
'mail to [email protected] so you can help other people.\n')
sys.exit(1)
-
-if os.environ.has_key('SYBASE_OCS'):
- ocs = os.environ['SYBASE_OCS']
- sybase = os.path.join(sybase, ocs)
syb_incdir = os.path.join(sybase, 'include')
syb_libdir = os.path.join(sybase, 'lib')