ODBC build fixes

* Require SQLGetPrivateProfileString in ODBC libraries

* Attempt to fix reported deadlock with unixODBC by rearranging
functions
This commit is contained in:
Evan Miller
2020-08-12 15:05:25 -04:00
parent acbace242c
commit 362938f17c
4 changed files with 60 additions and 286 deletions

View File

@@ -68,7 +68,7 @@ AM_CONDITIONAL(SQL, test x$sql = xtrue)
AC_SUBST(SQL)
AC_SUBST(LFLAGS)
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Werror"
CFLAGS="$CFLAGS -Wall -Werror"
AS_CASE([$host],
[*mingw*|*cygwin*], [LDFLAGS="$LDFLAGS -no-undefined"], [])
AS_CASE([$host],
@@ -104,10 +104,8 @@ if test "$with_iodbc"; then
OLDLDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $ODBC_LIBS"
AC_CHECK_LIB(iodbcinst, SQLGetPrivateProfileString,
[ODBC_LIBS="$ODBC_LIBS -liodbcinst"
AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1,
[Define to 1 if you have the SQLGetPrivateProfileString function.])])
AC_CHECK_LIB(iodbcinst, SQLGetPrivateProfileString, [FOO=bar],
AC_MSG_ERROR([Could not find SQLGetPrivateProfileString in -liodbcinst]))
LDFLAGS=$OLDLDFLAGS
fi
@@ -127,10 +125,8 @@ if test "$with_unixodbc"; then
OLDLDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $ODBC_LIBS"
AC_CHECK_LIB(odbcinst, SQLGetPrivateProfileString,
[ODBC_LIBS="$ODBC_LIBS -lodbcinst"
AC_DEFINE_UNQUOTED(HAVE_SQLGETPRIVATEPROFILESTRING, 1,
[Define to 1 if you have the SQLGetPrivateProfileString function.])])
AC_CHECK_LIB(odbcinst, SQLGetPrivateProfileString, [ODBC_LIBS="$ODBC_LIBS -lodbcinst"],
AC_MSG_ERROR([Could not find SQLGetPrivateProfileString in -lodbcinst]))
LDFLAGS=$OLDLDFLAGS
fi
@@ -146,6 +142,9 @@ if test "x$HAVE_ODBC" = "xtrue"; then
OPTDIRS="$OPTDIRS odbc"
fi
dnl Turn on -Wstrict-prototypes here because AC_CHECK_LIB is dumb
CFLAGS="$CFLAGS -Wstrict-prototypes"
dnl Conditionally build odbc wide version
AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = "yes")