1From 8ca6b0c72b6b933642ec7c4ebb83734244fec46f Mon Sep 17 00:00:00 2001 2From: "Song.Li" <Song.Li@windriver.com> 3Date: Tue, 5 Sep 2017 10:24:10 +0800 4Subject: [PATCH] remove some checks for cross-compiling 5 6some lib check is not suitable for 7cross-compiling, so remove them. 8 9Upstream-Status: Inappropriate [not a real bug,just for cross-compiling] 10 11Signed-off-by: Song.Li <Song.Li@windriver.com> 12Signed-off-by: Kai Kang <kai.kang@windriver.com> 13Signed-off-by: Jackie Huang <jackie.huang@windriver.com> 14 15--- 16 configure.ac | 80 +++++----------------------------------------------- 17 1 file changed, 7 insertions(+), 73 deletions(-) 18 19diff --git a/configure.ac b/configure.ac 20index 7f79563..00b359e 100644 21--- a/configure.ac 22+++ b/configure.ac 23@@ -57,71 +57,20 @@ AC_ARG_WITH(iodbc, [ --with-iodbc[[=DIR]] [[default=no]] DIR is the iODBC bas 24 if test "$with_iodbc" != no; then 25 with_unixodbc=no 26 AC_DEFINE(WITH_IODBC, 1, [Define to 1 to build with iODBC support]) 27- if test "$with_iodbc" = yes; then 28- AC_PATH_PROGS(ODBC_CONFIG, iodbc-config) 29- else 30- ODBC_CONFIG=$with_iodbc 31- fi 32- if test ! -x "${ODBC_CONFIG}/bin/iodbc-config"; then 33- if test ! -x "${ODBC_CONFIG}"; then 34- AC_MSG_ERROR([iodbc-config not found (required for iODBC build)]) 35- fi 36- else 37- ODBC_CONFIG=${ODBC_CONFIG}/bin/iodbc-config 38- fi 39 fi 40 41 wo_odbc_config=__without_odbc_config 42 if test "$with_unixodbc" != no; then 43 AC_DEFINE(WITH_UNIXODBC, 1, 44 [Define to 1 to build with unixODBC support]) 45- if test "$with_unixodbc" = yes; then 46- AC_PATH_PROGS(ODBC_CONFIG, odbc_config) 47- else 48- ODBC_CONFIG=$with_unixodbc 49- fi 50- if test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then 51- : 52- elif test ! -x "${ODBC_CONFIG}/bin/odbc_config"; then 53- if test ! -x "${ODBC_CONFIG}"; then 54- AC_MSG_ERROR([odbc_config not found (required for unixODBC build)]) 55- fi 56- else 57- ODBC_CONFIG=${ODBC_CONFIG}/bin/odbc_config 58- fi 59 fi 60 61 # 62 # ODBC include and library 63 # 64- 65-if test "$ODBC_CONFIG" != ""; then 66- if test "$with_iodbc" != no; then 67- ODBC_INCLUDE=`${ODBC_CONFIG} --cflags` 68- CPPFLAGS="$CPPFLAGS ${ODBC_INCLUDE}" 69- # Linking libiodoc is rather problematic 70- [ODBC_LIBDIR=`${ODBC_CONFIG} --libs | sed -e "s/^\(-L\|.*[ \t]-L\)\([^ \n\r\f\t]*\).*$/-L\2/"`] 71- LDFLAGS="$LDFLAGS ${ODBC_LIBDIR}" 72- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test 73- elif test "${ODBC_CONFIG}" = "${wo_odbc_config}"; then 74- ODBC_INCLUDE=/usr/include 75- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}" 76- ODBC_LIBDiR="" 77- LIBODBC="-lodbc" # for regression test 78- else 79- ODBC_INCLUDE=`${ODBC_CONFIG} --include-prefix` 80- CPPFLAGS="$CPPFLAGS -I${ODBC_INCLUDE}" 81- # Linking libodbc is rather problematic 82- ODBC_LIBDIR=`${ODBC_CONFIG} --lib-prefix` 83- if test "${ODBC_LIBDIR}" != ""; then 84- LDFLAGS="$LDFLAGS -L${ODBC_LIBDIR}" 85- fi 86- LIBODBC=`${ODBC_CONFIG} --libs` # for regression test 87- fi 88- AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBDIR]) 89- AC_MSG_NOTICE([using $LIBODBC for regression test]) 90-fi 91-AC_SUBST(LIBODBC) 92+ODBC_LIBS="-lodbcinst" 93+LIBS="$LIBS ${ODBC_LIBS}" 94+AC_MSG_NOTICE([using $ODBC_INCLUDE $ODBC_LIBS]) 95 96 # 97 # SQLCOLATTRIBUTE_SQLLEN check 98@@ -190,19 +139,10 @@ PGAC_ARG_BOOL(enable, pthreads, yes, 99 # Find libpq headers and libraries 100 # 101 102-if test -z "$PG_CONFIG"; then 103- AC_PATH_PROGS(PG_CONFIG, pg_config) 104-fi 105- 106-if test -n "$PG_CONFIG"; then 107- pg_includedir=`"$PG_CONFIG" --includedir` 108- pg_pkg_includedir=`"$PG_CONFIG" --pkgincludedir` 109- pg_libdir=`"$PG_CONFIG" --libdir` 110- CPPFLAGS="$CPPFLAGS -I$pg_includedir -I$pg_pkg_includedir/internal" 111- LDFLAGS="$LDFLAGS -L$pg_libdir" 112-fi 113- 114- 115+pg_includedir="" 116+pg_libdir="" 117+CPPFLAGS="$CPPFLAGS" 118+LDFLAGS="$LDFLAGS" 119 120 # 1. Programs 121 122@@ -226,12 +166,6 @@ if test "$with_iodbc" != no; then 123 [AC_MSG_ERROR([iODBC library "iodbcinst" not found])]) 124 fi 125 126-if test "$enable_pthreads" = yes; then 127- AC_CHECK_LIB(pthreads, pthread_create, 128- [], 129- [AC_CHECK_LIB(pthread, pthread_create)]) 130-fi 131- 132 AC_CHECK_LIB(pq, PQsetSingleRowMode, [], 133 [AC_MSG_ERROR([libpq library version >= 9.2 is required])]) 134 135