-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
108 lines (97 loc) · 2.72 KB
/
configure.in
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
# Process this file with autoconf to produce a configure script.
#
# Configure.in for RPostgreSQL
# Copyright (C) 2008 Dirk Eddelbuettel and licensed under GNU GPL
#
# This file draws heavily on configure.in files from littler, RMySQL, and RdbiPgSQL
# Set the name and version -- the version set here will propagate to other files from here
AC_INIT(RPostgreSQL, 0.1)
# Checks for common programs using default macros
AC_PROG_CC
# Check for non-standard programs: pg_configg(1) to configure PostgreSQL builds
AC_PATH_PROG([PG_CONFIG], [pg_config])
# If pg_config was found, let's use it
if test "${PG_CONFIG}" != ""; then
# Use pg_config for header and linker arguments
PG_INCDIR=`${PG_CONFIG} --includedir`
PG_LIBDIR=`${PG_CONFIG} --libdir`
else
# let's look around -- code copied from RdbuiPgSQL but modified to use test -f
# added fink standard install location Neil 8/30/2009
AC_MSG_NOTICE([checking for PostgreSQL header files])
if ! test $PG_INCDIR
then
for dir in \
/usr/include \
/usr/include/pgsql \
/usr/include/postgresql \
/usr/local/include \
/usr/local/include/pgsql \
/usr/local/include/postgresql \
/usr/local/pgsql/include \
/usr/local/postgresql/include \
/opt/include \
/opt/include/pgsql \
/opt/include/postgresql \
/opt/local/include \
/opt/local/include/postgresql \
/opt/local/include/postgresql84 \
/sw/opt/postgresql-8.4/include \
/Library/PostgresPlus/8.4SS/include \
/sw/include/postgresql
do
AC_MSG_NOTICE([Checking include ${dir}.])
if test -f ${dir}/libpq-fe.h
then
PG_INCDIR=${dir}
break
fi
done
fi
# likewise, let's look around for libpq.so
if ! test $PG_LIBDIR
then
for dir in \
/usr/lib \
/usr/lib/pgsql \
/usr/lib/postgresql \
/usr/local/lib \
/usr/local/lib/pgsql \
/usr/local/lib/postgresql \
/usr/local/pgsql/lib \
/usr/local/postgresql/lib \
/opt/lib \
/opt/lib/pgsql \
/opt/lib/postgresql \
/opt/local/lib \
/opt/local/lib/postgresql \
/opt/local/lib/postgresql84 \
/sw/opt/postgresql-8.4/lib \
/Library/PostgresPlus/8.4SS/lib \
/sw/lib
do
AC_MSG_NOTICE([Checking lib ${dir}.])
if test -f ${dir}/libpq.so
then
PG_LIBDIR=${dir}
break
fi
if test -f ${dir}/libpq.dylib
then
PG_LIBDIR=${dir}
break
fi
done
fi
fi
# Expand into arguments
PKG_CPPFLAGS="-I${PG_INCDIR}"
PKG_LIBS="-L${PG_LIBDIR} -lpq"
# Test for sanity by looking for libpq-fe.h, no explicit action on found, error on failure
AC_CHECK_FILE(["${PG_INCDIR}/libpq-fe.h"],
,
AC_MSG_ERROR([File libpq-fe.h not in ${PG_INCDIR}; installation may be broken.]))
# Now substitute these two variable in src/Makevars.in to create src/Makevars
AC_SUBST(PKG_CPPFLAGS)
AC_SUBST(PKG_LIBS)
AC_OUTPUT(src/Makevars)