blob: a84229e58e2e589e6b6f5b021a925c343c2280e8 [file] [log] [blame]
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +05301From 3e2ca7e06b16ceff6d12beb5113312f6525df595 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Thu, 14 Sep 2017 11:02:12 +0800
4Subject: [PATCH] configure.ac: avoid searching host for postgresql
5
6Upstream-Status: Inappropriate [cross compile specific]
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 configure.ac | 101 +++--------------------------------------------------------
11 1 file changed, 5 insertions(+), 96 deletions(-)
12
Andrew Geisslerf31b8bd2020-11-30 19:54:56 -060013Index: samhain-4.4.2/configure.ac
14===================================================================
15--- samhain-4.4.2.orig/configure.ac
16+++ samhain-4.4.2/configure.ac
17@@ -1290,90 +1290,11 @@ AC_ARG_WITH(database,
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +053018 AC_DEFINE(WITH_POSTGRES)
19 AC_DEFINE(WITH_DATABASE)
20 #
21- PGCONF="no"
22- MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
23- OLD_IFS="$IFS"
24- IFS=":"
25- for ff in ${MY_PATH}
26- do
27- if test -f "$ff/pg_config"
28- then
29- PGCONF="$ff/pg_config"
30- fi
31- done
32- IFS="${OLD_IFS}"
33- #
34- #
35- if test "x${PGCONF}" = "xno"
36- then
37- AC_MSG_CHECKING(for PostgreSQL in /usr/local/pgsql /usr/pgsql /usr/local /usr PGSQL_HOME)
38- pgsql_directory="/usr/local/pgsql /usr/pgsql /usr/local /usr ${PGSQL_HOME}"
39- for i in $pgsql_directory; do
40- if test -r $i/include/pgsql/libpq-fe.h; then
41- PGSQL_INC_DIR=$i/include
42- PGSQL_DIR=$i
43- # use AC_CHECK_HEADERS to check for pgsql/libpq-fe.h
44- fi
45- done
46- if test -z "$PGSQL_DIR"; then
47- for i in $pgsql_directory; do
48- if test -r $i/include/postgresql/libpq-fe.h; then
49- PGSQL_INC_DIR=$i/include
50- PGSQL_DIR=$i
51- fi
52- done
53- fi
54- if test -z "$PGSQL_DIR"; then
55- for i in $pgsql_directory; do
56- if test -r $i/include/libpq-fe.h; then
57- PGSQL_INC_DIR=$i/include
58- PGSQL_DIR=$i
59- fi
60- done
61- fi
62-
63- if test -z "$PGSQL_DIR"; then
64- tmp=""
65- for i in $pgsql_directory; do
66- tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql"
67- done
68- FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
69- fi
70-
71- for i in lib lib/pgsql lib/postgresql; do
72- str="$PGSQL_DIR/$i/libpq.*"
73- for j in `echo $str`; do
74- if test -r $j; then
75- PGSQL_LIB_DIR="$PGSQL_DIR/$i"
76- break 2
77- fi
78- done
79- done
80-
81- if test -z "$PGSQL_LIB_DIR"; then
82- for ff in $pgsql_directory; do
83- for i in lib lib/pgsql lib/postgresql; do
84- str="$ff/$i/libpq.*"
85- for j in `echo $str`; do
86- if test -r $j; then
87- PGSQL_LIB_DIR="$ff/$i"
88- break 3
89- fi
90- done
91- done
92- done
93- fi
94-
95- if test -z "$PGSQL_LIB_DIR"; then
96- tmp=""
97- for i in $pgsql_directory; do
98- tmp="$i/lib $i/lib/pgsql $i/lib/postgresql"
99- done
100- FAIL_MESSAGE("postgresql library libpq", $tmp)
101- fi
102-
103- AC_MSG_RESULT(yes)
104-
105+ if test -z "${PGSQL_LIB_DIR}" ; then
106+ FAIL_MESSAGE("PGSQL_LIB_DIR is not set!")
107+ elif test -z "${PGSQL_INC_DIR}" ; then
108+ FAIL_MESSAGE("PGSQL_INC_DIR is not set!")
109+ else
110 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
111 if test x"$enable_static" = xyes; then
112 LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
Andrew Geisslerf31b8bd2020-11-30 19:54:56 -0600113@@ -1382,18 +1303,6 @@ AC_ARG_WITH(database,
Richard Marian Thomaiyar14fddef2018-07-13 23:55:56 +0530114 fi
115 # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
116 CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
117- AC_CHECK_HEADERS(pgsql/libpq-fe.h)
118- AC_CHECK_HEADERS(postgresql/libpq-fe.h)
119- else
120- pg_lib_dir=`${PGCONF} --libdir`
121- if test x"$enable_static" = xyes; then
122- LIBS="$LIBS -L${pg_lib_dir} -lpq -lcrypt -lm"
123- else
124- LIBS="$LIBS -L${pg_lib_dir} -lpq -lm"
125- fi
126- pg_inc_dir=`${PGCONF} --includedir`
127- # CFLAGS="$CFLAGS -I${pg_inc_dir}"
128- CPPFLAGS="$CPPFLAGS -I${pg_inc_dir}"
129 fi
130 elif test "x${withval}" = "xodbc"; then
131 AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)