-
Notifications
You must be signed in to change notification settings - Fork 241
/
autogen.sh
executable file
·51 lines (40 loc) · 1.37 KB
/
autogen.sh
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
#! /bin/sh
# Run this to generate the configure script etc.
set -eu
PQXXVERSION=$(./tools/extract_version)
PQXX_ABI=$(./tools/extract_version --abi)
PQXX_MAJOR=$(./tools/extract_version --major)
PQXX_MINOR=$(./tools/extract_version --minor)
echo "libpqxx version $PQXXVERSION"
echo "libpqxx ABI version $PQXX_ABI"
substitute() {
sed -e "s/@PQXXVERSION@/$PQXXVERSION/g" \
-e "s/@PQXX_MAJOR@/$PQXX_MAJOR/g" \
-e "s/@PQXX_MINOR@/$PQXX_MINOR/g" \
-e "s/@PQXX_ABI@/$PQXX_ABI/g" \
"$1"
}
# Use templating system to generate various Makefiles.
expand_templates() {
for template in "$@"
do
./tools/template2mak.py "$template" "${template%.template}"
done
}
# We have two kinds of templates. One uses our custom templating tool. And
# a few others simply have some substitutions done.
# shellcheck disable=SC2046
expand_templates $(find . -name \*.template)
substitute include/pqxx/version.hxx.template >include/pqxx/version.hxx
substitute include/pqxx/doc/mainpage.md.template >include/pqxx/doc/mainpage.md
# Generate feature test snippets for C++ features that we simply detect by
# checking a C++ feature test macro.
./tools/generate_cxx_checks.py
# Generate autoconf and CMake configuration for our feature test snippets.
./tools/generate_check_config.py
autoheader
libtoolize --force --automake --copy
aclocal -I . -I config/m4
automake --add-missing --copy
autoconf
echo "Done."