Skip to Content.
Sympa Menu

freetds - Re: [freetds] Compiling and using FreeTDS on Mac OS X

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Duncan Wilcox <duncan AT mclink.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Compiling and using FreeTDS on Mac OS X
  • Date: Tue, 18 Nov 2003 16:08:07 +0100

Hi,

I'm using Panther and gcc3.3:

gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)

I downloaded the nightly freetds-0.62.dev.20031118.

As Mark Lilback mentioned a few days ago, the problem with the build on OS X seems to be libtds_objects.a being linked in twice in a few places, causing a bunch of multiple symbol definition errors.

Removing libtds_objects.la in the following lines seems to fix the build, don't know if it's the right way of doing it though, or if it breaks other platforms:

src/tds/Makefile.am:
libtds_la_LIBADD = libtds_objects.la $(NETWORK_LIBS) $(LIBICONV) ../replacements/libreplacements.la

src/ctlib/Makefile.am:
libct_la_LIBADD = ../tds/libtds_objects.la $(NETWORK_LIBS) $(LIBICONV) ../replacements/libreplacements.la

src/dblib/Makefile.am:
libsybdb_la_LIBADD= ../tds/libtds_objects.la $(NETWORK_LIBS) $(LIBICONV) ../replacements/libreplacements.la

src/odbc/Makefile.am:
libtdsodbc_la_LIBADD= ../tds/libtds_objects.la $(ODBCLIB) $(NETWORK_LIBS) $(LIBICONV) ../replacements/libreplacements.la

src/server/Makefile.am:
libtdssrv_la_LIBADD = ../tds/libtds_objects.la $(NETWORK_LIBS) $(LIBICONV) ../replacements/libreplacements.la


So then I had to add ../tds/libtds_objects.la in these lines (and I suppose all other library users will also have to do the same):

src/apps/Makefile.am:
tsql_LDADD = ../tds/libtds_objects.la $(READLINE_LIBS) $(LDADD) $(NETWORK_LIBS)
freebcp_LDADD = ../dblib/libsybdb.la ../tds/libtds_objects.la $(NETWORK_LIBS)

src/pool/Makefile.am:
LDADD = ../tds/libtds.la ../tds/libtds_objects.la ../server/libtdssrv.la $(NETWORK_LIBS)

Also the OS X toolchain doesn't really like -Bsymbolic, so I removed it from this line to build:

src/odbc/Makefile.am:
libtdsodbc_la_LDFLAGS = -export-symbols-regex '^(SQL|ODBCINST).*' -Wl,-Bsymbolic

With these hacks libtds builds fine on OS X, though I haven't tried it out to see if it's usable.

I'm really a newbie to freetds, so please excuse me for the lack of a proper patch, I'm not even sure this is the correct approach to fix the problem, just providing a hint.

Thanks,
Duncan





Archive powered by MHonArc 2.6.24.

Top of Page