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