Erlang_odbc with nix on Mac OS fails the link check to unixODBC

I already filed an issue to the nix repository here: https://github.com/NixOS/nixpkgs/issues/94644

But, as you can see in my last comment there, I think that this issue might be caused by a setting in the configure phase of the build. Somehow the build script assumes that I want to build with the flag -liodbc instead of -lodbc - which is bogus.

That’s why I reach out here: can someone explain, why idobc is used even though I specifically pass the path to unixODBC to the build via --with-odbc=/nix/store/2z0cwqcwk21ai7mspflgx0ry4c7jr92k-unixODBC-2.3.7?

Specifically I don’t fully understand this line in the configure script: https://github.com/erlang/otp/blob/OTP-22.3.1/lib/odbc/configure.in#L154

It seems like I’ve found the solution: In AC_CHECK_LIB(iodbc, SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -lodbc"; odbc_lib_link_success=yes]) the iodbc should be odbc. Then the build completes without the warning :man_shrugging: