aboutsummaryrefslogtreecommitdiff
path: root/package/rsyslog/0002-configure.ac-make-pgsql-support-cross-compile-friendly.patch
blob: 6e253dd1bdfa4c2ca65514259ae9ff157482d087 (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
From 80f49958083b90869e2857eb3edb7367e66c6a72 Mon Sep 17 00:00:00 2001
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
Date: Wed, 14 Jan 2015 10:11:42 -0300
Subject: [PATCH] configure.ac: make pgsql support cross-compile friendly

When cross-compiling pg_config shouldn't be expected to be in PATH
since normally this would point to distribution pgsql rather than cross,
which can be of a totally different architecture.

Change it so we can use ac_cv_prog_PG_CONFIG to point to the real one.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 configure.ac | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 4e662dc..6edaedd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -598,21 +598,22 @@ AC_ARG_ENABLE(pgsql,
 )
 if test "x$enable_pgsql" = "xyes"; then
   AC_CHECK_PROG(
-    [HAVE_PGSQL_CONFIG],
+    [PG_CONFIG],
     [pg_config],
-    [yes],,,
+    [pg_config],
+    [no],,,
   )
-  if test "x${HAVE_PGSQL_CONFIG}" != "xyes"; then
-    AC_MSG_FAILURE([pg_config not found in PATH])
+  if test "x${PG_CONFIG}" = "xno"; then
+    AC_MSG_FAILURE([pg_config not found])
   fi
   AC_CHECK_LIB(
     [pq],
     [PQconnectdb],
-    [PGSQL_CFLAGS="-I`pg_config --includedir`"
-     PGSQL_LIBS="-L`pg_config --libdir` -lpq"
+    [PGSQL_CFLAGS="-I`$PG_CONFIG --includedir`"
+     PGSQL_LIBS="-L`$PG_CONFIG --libdir` -lpq"
     ],
     [AC_MSG_FAILURE([PgSQL library is missing])],
-    [-L`pg_config --libdir`]
+    [-L`$PG_CONFIG --libdir`]
   )
 fi
 AM_CONDITIONAL(ENABLE_PGSQL, test x$enable_pgsql = xyes)
-- 
2.0.5