Skip to Content.
Sympa Menu

freetds - Re: [freetds] Failure to build on OSX

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Merle Reinhart <merlereinhart AT mac.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Failure to build on OSX
  • Date: Mon, 23 Nov 2020 09:25:02 -0500

Igor,

I have not had any issues building either libiodbc or freetds on Mac OS X .

libiodbc:
sh autogen.sh
./configure --prefix=/usr/local/iodbc --with-iodbc-inidir=/Library/ODBC
--disable-gui --disable-libodbc CFLAGS="-arch x86-64" CC="gcc-9"
make
sudo make install

I stick it in a separate directory in /usr/local/ to make it easier for me to
maintain, but that is just me.
--with-iodbc-inidir=/Library/ODBC to make it more compatible with the way
other apps tend to expect the ODBC configuration files
--disable-gui to not bother with the gui and likely the frameworks which just
complicates things, ie, I just treat it as a normal unix build
--disable-libodbc since for my uses libiodbc had to coexist beside the
unixodbc library
CFLAGS and -arch x86-64 is just a holdover from years ago where I had to
build both 32 and 64 bit libraries
CC="gcc-9" I found years ago that the actual gnu c compiler worked better
than Apple gcc compatibility wrapper around clang

Last time I built it was this past August on macOS Mojave (Xcode 10.3) with
iODBC 3.52.13.


freetds then builds for me with out issues.

./configure --with-iodbc=/usr/local/iodbc --prefix=/usr/local/freetds
--with-libiconv-prefix=/opt/sw -disable-debug --disable-server --disable-pool
--enable-krb5 --enable-sspi CC=clang CFLAGS="-arch x86_64" LDFLAGS="-arch
x86_64"

--with-libiconv-prefix=/opt/sw I use the libiconv from the Fink software
manager as I've had fewer issues with the more recent version it provides
--disable-debug, -server, -pool I don't need these, so I explicitly disable
them
--enable-krb5 we use Kerberos database authentication
--enable-sspi doesn't really matter on macOS
CC=clang direct clang and not the Apple gcc compatibility wrapper seems to
work a little bit better for me
-arch x86_64 again is just a holdover from years ago when I had to build both
32 and 64 bit libraries

Last time I built it was this past August on macOS Mojave (Xcode 10.3) with
Freetds 1.0.48 and 1.1.24.


Hopefully, this helps.

Merle




> On Nov 22, 2020, at 12:31 PM, Frediano Ziglio <freddy77 AT gmail.com> wrote:
>
> Il giorno sab 21 nov 2020 alle ore 06:46 Igor Korot <ikorot01 AT gmail.com> ha
> scritto:
>
>> Sorry, I accidentally hit "Send"...
>>
>> Frediano,
>> Sorry for the top-posting.
>> Here are my observations:
>>
>> The configure script requires the directory where isql.h is
>>
>> On my system is in:
>>
>> [code]
>> Igors-MacBook-Air:/ igorkorot$ find . -name isql.h
>> find: ./usr/sbin/authserver: Permission denied
>> ./usr/local/iODBC/include/isql.h
>> find: ./.Spotlight-V100: Permission denied
>> find: ./Library/Application Support/Apple/ParentalControls/Users:
>> Permission denied
>> find: ./Library/Application Support/Apple/AssetCache/Data: Permission
>> denied
>> find: ./Library/Application Support/ApplePushService: Permission denied
>> ./Library/Frameworks/iODBC.framework/Versions/3.52/Headers/isql.h
>> [/code]
>>
>> And so running:
>>
>> [code]
>> Igors-MacBook-Air:freetds igorkorot$ ./configure --enable-odbc
>> --enable-debug --enable-odbc-wide --with-iodbc=/usr/local/iODBC/
>> [/code]
>>
>> succeeded.
>>
>> However, running "make" after that, results in:
>>
>> [code]
>> Making all in odbc
>> /Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
>> Making all in .
>> CC odbc.lo
>> In file included from odbc.c:38:
>> In file included from ../../include/freetds/odbc.h:36:
>> /usr/local/iODBC//include/isql.h:84:10: fatal error: 'iODBC/sql.h'
>> file not found
>> #include <iODBC/sql.h>
>> ^~~~~~~~~~~~~
>> 1 error generated.
>> make[4]: *** [odbc.lo] Error 1
>> make[3]: *** [all-recursive] Error 1
>> make[2]: *** [all] Error 2
>> make[1]: *** [all-recursive] Error 1
>> make: *** [all-recursive] Error 1
>> [/code]
>>
>> So, any help fixing this/properly running configure & make?
>>
>> Thank you.
>>
>>
> Hi,
> it looks like MacOS is pretty weird. Also the installation of iODBC is
> not that coherent.
> There's a iodbc-config I tried to use but is pretty useless as it uses
> "normal" Unix arguments (-L, -I, etc) while
> iODBC is installed using MacOS frameworks. I "solved" using these commands:
>
> $ IODBC_CFLAGS='-I/usr/local/iODBC/include -F/Library/Frameworks -framework
> iODBC -framework iODBCinst'
> $ export IODBC_CFLAGS
> $ IODBC_LIBS='-I/usr/local/iODBC/include -F/Library/Frameworks -framework
> iODBC -framework iODBCinst'
> $ export IODBC_LIBS
> $ ./configure --with-iodbc
>
> (yes, the 2 environments are duplicated)
>
> it compiles (not currently tested) although otool -L is reporting that 2
> iodbc libraries are imported (it should
> import only one).
>
> I found on the internet a discussion where somebody wrote that a patch was
> in progress (in May) but I installed
> last iODBC and it still has the issue.
>
> I don't have much MacOS knowledge to suggest the final method, not sure if
> this is the best way to
> solve the issue.
>
> Frediano
>
>
>>
>>> On Fri, Nov 20, 2020 at 3:28 AM Igor Korot <ikorot01 AT gmail.com> wrote:
>>>>
>>>> Hi, Frediano,
>>>>
>>>> On Fri, Nov 20, 2020 at 2:41 AM Frediano Ziglio <freddy77 AT gmail.com>
>> wrote:
>>>>>
>>>>> Il giorno ven 20 nov 2020 alle ore 07:37 Igor Korot <
>> ikorot01 AT gmail.com> ha
>>>>> scritto:
>>>>>
>>>>>> Hi, (Frediano),
>>>>>> I am trying to build freeTDS latest release on OSX 10.13 with the
>> ODBC
>>>>>> driver.
>>>>>>
>>>>>> I installed latest iODBC DM and then tried building.
>>>>>>
>>>>>> The log is below:
>>>>>>
>>>>>> [code]
>>>>>> Igors-MacBook-Air:freetds igorkorot$ ./configure --enable-odbc
>>>>>> --enable-debug --enable-odbc-wide --with-iodbc && make
>>>>>> checking for a BSD-compatible install... /usr/bin/install -c
>>>>>> checking whether build environment is sane... yes
>>>>>> checking for a thread-safe mkdir -p... ./install-sh -c -d
>>>>>> checking for gawk... no
>>>>>> checking for mawk... no
>>>>>> checking for nawk... no
>>>>>> checking for awk... awk
>>>>>> checking whether make sets $(MAKE)... yes
>>>>>> checking whether make supports nested variables... yes
>>>>>> checking whether make supports nested variables... (cached) yes
>>>>>> checking for gawk... (cached) awk
>>>>>> checking for grep that handles long lines and -e... /usr/bin/grep
>>>>>> checking whether ln -s works... yes
>>>>>> checking for a sed that does not truncate output... /usr/bin/sed
>>>>>> checking for pkg-config... no
>>>>>>
>>>>>
>>>>> That's not expected. Weird on a new system, but maybe is just that I
>> have
>>>>> Brew installed.
>>>>
>>>> Probably.
>>>> I rather prefer to install official packages and not from HB.
>>>>
>>>> Just grabbed it from iodbc.org...
>>>>
>>>>>
>>>>>
>>>>>> checking build system type... x86_64-apple-darwin17.7.0
>>>>>> checking host system type... x86_64-apple-darwin17.7.0
>>>>>> checking whether make supports the include directive... yes (GNU
>> style)
>>>>>> checking for gcc... gcc
>>>>>>
>>>>>
>>>>> ... omissis ...
>>>>>
>>>>> checking compile-time options
>>>>>> checking for IODBC... no
>>>>>> configure: error: in `/Users/igorkorot/freetds':
>>>>>> configure: error: The pkg-config script could not be found or is
>> too
>>>>>> old. Make sure it
>>>>>> is in your PATH or set the PKG_CONFIG environment variable to the
>> full
>>>>>> path to pkg-config.
>>>>>>
>>>>>
>>>>> That is the result of not founding pkg-config previously
>>>>
>>>> Correct.
>>>>
>>>>>
>>>>>
>>>>>> Alternatively, you may set the environment variables IODBC_CFLAGS
>>>>>> and IODBC_LIBS to avoid the need to call pkg-config.
>>>>>>
>>>>>
>>>>> That's a workaround. Or you could try using --with-idobc=<directory>
>>>>> instead.
>>>>
>>>> I don't know what flags that library was built with...
>>>>
>>>>>
>>>>> In configure.ac:
>>>>>
>>>>> # The user asked for iodbc support, but didn't tell us
>>>>> # where to look. So, we'll try to get the info from
>>>>> # pkg-config. If we can't, we'll display an error.
>>>>> PKG_CHECK_MODULES(IODBC, libiodbc)
>>>>>
>>>>> so the configure it's behaving as expected (although it could try a
>> bit
>>>>> harder).
>>>>
>>>> ... so I should use the path to libiodbc, right?
>>>>
>>>>>
>>>>>
>>>>>> See the pkg-config man page for more details.
>>>>>>
>>>>>> To get pkg-config, see <http://pkg-config.freedesktop.org/>.
>>>>>> See `config.log' for more details
>>>>>> Igors-MacBook-Air:freetds igorkorot$
>>>>>> [/code]
>>>>>>
>>>>>> I can successfully run the iODBC GUI.
>>>>>>
>>>>>> So what is going on?
>>>>>>
>>>>>> Thank you.
>>>>>>
>>>>>
>>>>> I'll check my MacOS to see where pkg-config is and where the include
>> files
>>>>> are.
>>>>
>>>> Maybe the install is different if its downloaded from iodbc.org?
>>>>
>>>> Thank you.
>>>>
>>>>>
>>>>> Frediano
>>>>> _______________________________________________
>>>>> FreeTDS mailing list
>>>>> FreeTDS AT lists.ibiblio.org
>>>>> https://lists.ibiblio.org/mailman/listinfo/freetds
>> _______________________________________________
>> FreeTDS mailing list
>> FreeTDS AT lists.ibiblio.org
>> https://lists.ibiblio.org/mailman/listinfo/freetds
>>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page