Program does not work after configure modifications
I modified my configure.ac to read:
AC_CHECK_PROG([ODBC_CONFIG], [odbc_config], [odbc_config], [no])
AS_IF([test "x$ODBC_CONFIG" != "xno"], [
ODBC_CFLAGS=`$ODBC_CONFIG --cflags`
ODBC_LIBS=`$ODBC_CONFIG --libs`
], [
PKG_CHECK_MODULES([ODBC], [odbc])
])
ODBC_LIBS="$ODBC_LIBS -lodbcinst"
AC_SUBST(ODBC_CFLAGS)
AC_SUBST(ODBC_LIBS)
and then in Makefile.am I used:
libodbc_lib_la_CXXFLAGS = -I../../dbinterface \
-DUNICODE \
-DUNIXODBC \
$(ODBC_CFLAGS) \
@DBTOOLKIT@
libodbc_lib_la_LDFLAGS = -L../dbinterface \
-ldbinterface \
$(ODBC_LIBS)
I rebuilt everything but upon running the program I got an error that SQLInstallerErrorW can not be found.
However, when the Makefile just had:
libodbc_lib_la_CXXFLAGS = -I../../dbinterface \
-DUNICODE \
-DUNIXODBC \
`pkg-config \
odbc \
--cflags`\
@DBTOOLKIT@
libodbc_lib_la_LDFLAGS = -L../dbinterface \
-ldbinterface \
`pkg-config \
odbc \
--libs` \
-lodbcinst
everything worked as expected.
But it is hard-coding the variables, which is wrong.