aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-security/samhain/files/samhain-avoid-searching-host-for-postgresql.patch
blob: 6bf67e09b0c1b64e6c6b5de5cf4457d4a97b9fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
From 3e2ca7e06b16ceff6d12beb5113312f6525df595 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 14 Sep 2017 11:02:12 +0800
Subject: [PATCH] configure.ac: avoid searching host for postgresql

Upstream-Status: Inappropriate [cross compile specific]

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 configure.ac | 101 +++--------------------------------------------------------
 1 file changed, 5 insertions(+), 96 deletions(-)

diff --git a/configure.ac b/configure.ac
index a224c68..f658d53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1278,90 +1278,11 @@ AC_ARG_WITH(database,
           AC_DEFINE(WITH_POSTGRES)
           AC_DEFINE(WITH_DATABASE)
 	  #
-	  PGCONF="no"
-	  MY_PATH="${PATH}:/usr/local/bin:/usr/local/pgsql/bin"
-	  OLD_IFS="$IFS"
-	  IFS=":"
-	  for ff in ${MY_PATH}
-	  do
-	    if test -f "$ff/pg_config"
-	    then
-		PGCONF="$ff/pg_config"
-	    fi
-	  done
-	  IFS="${OLD_IFS}"
-	  #
-	  #
-	  if test "x${PGCONF}" = "xno"
-	  then
-	    AC_MSG_CHECKING(for PostgreSQL in /usr/local/pgsql /usr/pgsql /usr/local /usr PGSQL_HOME)
-	    pgsql_directory="/usr/local/pgsql /usr/pgsql /usr/local /usr ${PGSQL_HOME}"
-  	    for i in $pgsql_directory; do 
-    	      if test -r $i/include/pgsql/libpq-fe.h; then
-                PGSQL_INC_DIR=$i/include
-		PGSQL_DIR=$i
-		# use AC_CHECK_HEADERS to check for pgsql/libpq-fe.h
-              fi
-            done 
-            if test -z "$PGSQL_DIR"; then
-  	      for i in $pgsql_directory; do 
-    	        if test -r $i/include/postgresql/libpq-fe.h; then
-                  PGSQL_INC_DIR=$i/include
-		  PGSQL_DIR=$i
-                fi
-              done
-	    fi
-            if test -z "$PGSQL_DIR"; then
-  	      for i in $pgsql_directory; do 
-    	        if test -r $i/include/libpq-fe.h; then
-                  PGSQL_INC_DIR=$i/include
-		  PGSQL_DIR=$i
-                fi
-              done
-	    fi
-	    
-            if test -z "$PGSQL_DIR"; then
-              tmp=""
-              for i in $pgsql_directory; do
-                tmp="$tmp $i/include $i/include/pgsql $i/include/postgresql"
-              done
-              FAIL_MESSAGE("PostgreSQL header file (libpq-fe.h)", $tmp)
-	    fi
-
-	    for i in lib lib/pgsql lib/postgresql; do
-      		str="$PGSQL_DIR/$i/libpq.*"
-      		for j in `echo $str`; do
-       		 if test -r $j; then
-       		   PGSQL_LIB_DIR="$PGSQL_DIR/$i"
-       		   break 2
-      		  fi
-    		done
-   	    done
-
-	    if test -z "$PGSQL_LIB_DIR"; then
-	      for ff in $pgsql_directory; do
-		for i in lib lib/pgsql lib/postgresql; do
-      		  str="$ff/$i/libpq.*"
-      		  for j in `echo $str`; do
-       		    if test -r $j; then
-       		      PGSQL_LIB_DIR="$ff/$i"
-       		      break 3
-      		    fi
-    		  done
-   	        done
-              done
-	    fi
-
-	    if test -z "$PGSQL_LIB_DIR"; then
-	       tmp=""
-	       for i in $pgsql_directory; do
-		   tmp="$i/lib $i/lib/pgsql $i/lib/postgresql"
-	       done
-	       FAIL_MESSAGE("postgresql library libpq", $tmp)
-            fi
-
-            AC_MSG_RESULT(yes)
-
+	  if test -z "${PGSQL_LIB_DIR}" ; then
+            FAIL_MESSAGE("PGSQL_LIB_DIR is not set!")
+	  elif test -z "${PGSQL_INC_DIR}" ; then
+            FAIL_MESSAGE("PGSQL_INC_DIR is not set!")
+	  else
 	    LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lm"
 	    if test x"$enable_static" = xyes; then
 	      LIBS="$LIBS -L${PGSQL_LIB_DIR} -lpq -lcrypt -lm"
@@ -1370,18 +1291,6 @@ AC_ARG_WITH(database,
 	    fi
 	    # CFLAGS="$CFLAGS -I${PGSQL_INC_DIR}"
 	    CPPFLAGS="$CPPFLAGS -I${PGSQL_INC_DIR}"
-	    AC_CHECK_HEADERS(pgsql/libpq-fe.h)
-	    AC_CHECK_HEADERS(postgresql/libpq-fe.h)
-	  else
-	    pg_lib_dir=`${PGCONF} --libdir`
-	    if test x"$enable_static" = xyes; then
-	      LIBS="$LIBS -L${pg_lib_dir} -lpq -lcrypt -lm"
-            else
-	      LIBS="$LIBS -L${pg_lib_dir} -lpq -lm"
-            fi
-	    pg_inc_dir=`${PGCONF} --includedir`
-	    # CFLAGS="$CFLAGS -I${pg_inc_dir}"
-	    CPPFLAGS="$CPPFLAGS -I${pg_inc_dir}"
 	  fi
 	elif test "x${withval}" = "xodbc"; then
 	  AC_MSG_CHECKING(for odbc in /usr /usr/local ODBC_HOME)
-- 
2.11.0