Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

erlang (bottled) linked to iODBC instead of unixODBC #38845

Closed
leoliu opened this issue Apr 20, 2015 · 5 comments
Closed

erlang (bottled) linked to iODBC instead of unixODBC #38845

leoliu opened this issue Apr 20, 2015 · 5 comments

Comments

@leoliu
Copy link

leoliu commented Apr 20, 2015

So the erlang formula lists unixODBC as a dep but never actually uses it.

otool -L /usr/local/opt/erlang/lib/erlang/lib/odbc-2.10.22/priv/bin/odbcserver shows

/usr/lib/libiodbc.2.dylib (compatibility version 4.0.0, current version 4.18.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
@xu-cheng
Copy link
Member

Could you try and open a pull request? This document should be helpful. Thanks!

@leoliu
Copy link
Author

leoliu commented Apr 27, 2015

It seems erlang is hard-coded to link to iodbc on Darwin. So one cannot link to unixODBC even if it is installed. I use the following patch to build erlang with unixodbc since I find unixodbc easier to setup and already the default on linux systems where our erlang software is deployed.

diff --git a/lib/odbc/configure.in b/lib/odbc/configure.in
index 0cfcb996..64f36cf3 100644
--- a/lib/odbc/configure.in
+++ b/lib/odbc/configure.in
@@ -136,18 +136,18 @@ AC_SUBST(THR_LIBS)
 odbc_lib_link_success=no
 AC_SUBST(TARGET_FLAGS)
     case $host_os in
-        darwin1[[0-4]].*|darwin[[0-9]].*)
-                TARGET_FLAGS="-DUNIX"
-           if test ! -d "$with_odbc" || test "$with_odbc" = "yes"; then
-           ODBC_LIB= -L"/usr/lib"
-           ODBC_INCLUDE="-I/usr/lib/include"
-       else
-           ODBC_LIB=-L"$with_odbc/lib"
-           ODBC_INCLUDE="-I$with_odbc/include"
-       fi
+        dnl darwin1[[0-4]].*|darwin[[0-9]].*)
+        dnl         TARGET_FLAGS="-DUNIX"
+   dnl         if test ! -d "$with_odbc" || test "$with_odbc" = "yes"; then
+   dnl         ODBC_LIB= -L"/usr/lib"
+   dnl         ODBC_INCLUDE="-I/usr/lib/include"
+   dnl     else
+   dnl         ODBC_LIB=-L"$with_odbc/lib"
+   dnl         ODBC_INCLUDE="-I$with_odbc/include"
+   dnl     fi

-               AC_CHECK_LIB(iodbc, SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes])
-            ;;
+        dnl        AC_CHECK_LIB(iodbc, SQLAllocHandle,[ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes])
+        dnl     ;;
         win32|cygwin)
        TARGET_FLAGS="-DWIN32"
        AC_CHECK_LIB(ws2_32, main)

@xu-cheng
Copy link
Member

xu-cheng commented May 2, 2015

If you want, you should report this problem to upstream and ask them to add an argument to make unixODBC deps work.

@leoliu
Copy link
Author

leoliu commented May 8, 2015

You cannot classify this issue as upstream issue. Upstream has opted for iodbc on darwin. So the dependency on unixODBC of this formula is incorrect.

BTW, I have sent a report to request for unixODBC support on upstream's bug list but how they would fix this issue is unclear.

@samunplugged
Copy link

I have similar issue on Mac while installing erlang using brew install.

MikeMcQuaid added a commit to Homebrew/homebrew-core that referenced this issue Apr 3, 2016
iODBC is used instead.

Closes Homebrew/legacy-homebrew#38845.

Closes #6.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants