Hi, On Thu, Jul 21, 2022 at 9:16 AM Greg Wooledge <g...@wooledge.org> wrote: > > On Thu, Jul 21, 2022 at 09:06:53AM -0500, David Wright wrote: > > I thought that was what the attached was (actually for Ubuntu AIUI). > > As I originally wrote, "As if by magic, […] someone else supplies a copy." > > > > Cheers, > > David. > > > #! /bin/sh > > > > # This shell script saves various pieces of information about the > > # installed version of unixODBC. Packages that interface to > > # unixODBC can use it to configure their build. > > # This file replaces the standard odbc_config, which is not > > # relocatable > > # > > # Author: Alberto Di Meglio <alberto.di.meg...@cern.ch> > > # Public domain > > > > me=`basename $0` > > mydir=`dirname $0` > > mydir=${mydir%/bin} > > > > # stored configuration values > > val_prefix="$mydir" > > val_bindir="$mydir/bin" > > val_includedir="$mydir/include" > > val_libdir="$mydir/lib" > > val_libs="-L$mydir/lib -lodbc" > > val_version='2.2.11' > > This is not going to give the correct linker arguments. It's going to > spit out a -L option which is totally unneeded, and worse, the *content* > of that -L option is going to depend on where the operating system thinks > the script has been "installed". > > If the script is "installed" in /usr/local/bin/odbc_config, it's going > to spit out -L/usr/local/lib -lodbc. > > As the script itself says, > > > # This file replaces the standard odbc_config > > So, why not use the "standard odbc_config", whatever that is? > > Again, this really needs to be taken up with the upstream maintainers of > the library, and with the Debian maintainer(s) of the Debian packages of > the library.
I agree. When asked Nick Gorham (the official maintainer of unixODBC) how to identify the options in the host software for unixODBC he pointed me out to odbc_config. No mentions of pkg-config or any other script were given. [quote] On Fri, Jul 15, 2022 at 3:28 AM Nick Gorham <nick.gor...@easysoft.com> wrote: > > On 15/07/2022 03:07, Igor Korot wrote: > > Hi, > > Is there a way to identify where unixODBC is installed (headers/libraries) > > and what libraries to link against? > > > > Some kind of `pkg-config unixodbc` command... > > > > Thank you. > > Thats what odbc_config is aimed at > > odbc_config --libs > -L/usr/local/lib -lodbc > > odbc_config --include-prefix > /usr/local/include > > odbc_config --prefix > /usr/local > > odbc_config --version > 2.3.12pre [/quote] Now, last night I tried to check. Turns out sometime ago unixODBC introduced pkg-config: [quote] 19.Mar.20182.3.6 Released Single bug fix that ws a possible security issue so I have pushed a version out. As always, any problems just let me know. Fix order of arguments in SQLWriteFileDSN.c, fix unwanted free() in iusql.c Add pkg-config files [/quote] But Nick still points to the odbc_config as the official way to get the build options into your software. However according to Mr. Langacek, odbc_config should be thrown away and pkg-config should be used all around, because apparently it's output is wrong (re. https://linux.debian.bugs.dist.narkive.com/JqZh4ioW/bug-422207-unixodbc-dev-install-odbc-config). I would question Mr. Langacek here as he is not an upstream maintainer of ubnixODBC and so does not know better. ;-) Now, I asked Nick what the deal is with pkg-config and will update as soon as I get a reply. Thank you. > >