-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·66 lines (53 loc) · 2.12 KB
/
configure
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
#!/bin/sh
##
# configure the pg-python build.
# This script constructs the build/cache for the PGXS GNUmakefile.
##
pg_config 2>/dev/null >/dev/null || ! echo >&2 "ERROR: could not find 'pg_config' executable" || exit 1
python3 -c 'pass' || ! echo >&2 "ERROR: could not find 'python3' executable" || exit 1
if test -d build/cache
then
if test -f build/cache/__pg_python_build_cache__
then
echo >&2 "LOG: removing previous build/cache"
rm -rf build/cache
else
echo >&2 "ERROR: build/cache does not appear to be from pg-python"
echo >&2 "HINT: The __pg_python_build_cache__ file did not exist in that directory."
echo >&2 " This file is used to validate that the directory is the pg-python"
echo >&2 " build/cache directory."
exit 2
fi
fi
mkdir -p build/cache
touch build/cache/__pg_python_build_cache__
echo >&2 "LOG: identifying requirements from environment"
system=`(pg_config 2>&1 --version | python3 build/tools/pg_identify.py)`
if test $? -ne 0
then
exit 1
fi
echo >&2 "LOG: linking test directories for installcheck"
echo >&2 ' rm' -f sql expected
rm -f sql expected || exit 1
echo >&2 ' ln' -s test/sql sql
ln -s "test/sql" sql || exit 1
echo >&2 ' ln' -s test/expected/$system expected
ln -s "test/expected/$system" expected || exit 1
echo >&2 "LOG: building Makefile includes for PGXS build"
echo >&2 "LOG: caching postgres.mk. derived from $(pg_config --bindir)/pg_config"
echo >&2 '(pg_config --version)'
echo "PGXS:=`(pg_config --pgxs)`" >build/cache/postgres.mk
cat `(pg_config --pgxs)` >>build/cache/postgres.mk
echo "pg_bindir :="`(pg_config --bindir)` >>build/cache/postgres.mk
echo >&2 "LOG: caching python.mk. derived from $(python3 -c 'import sys; print(sys.executable)') "
echo >&2 `(python3 -c 'import sys; print(sys.version.replace("\n",""))')`
python3 build/tools/config.py >build/cache/python.mk
project_version=`python3 -c 'import sys; sys.path.append("./src"); import project; print(project.version)'`
cp src/install.sql python--$project_version.sql
cat >python.control <<EOF
default_version='$project_version'
comment='procedural language extension for Python 3'
encoding='utf-8'
relocatable=true
EOF