File: autogen.sh

package info (click to toggle)
libpqxx 6.4.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,992 kB
  • sloc: cpp: 12,634; sh: 4,426; xml: 1,104; makefile: 309; python: 294; ansic: 3
file content (68 lines) | stat: -rwxr-xr-x 1,759 bytes parent folder | download
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
#! /bin/sh
# Run this to generate all the initial makefiles, etc.
#
# Set CONFIG_ARGS to the argument list you wish to pass to configure.

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"
}

# Generate Windows makefiles.
# Add carriage returns to turn them into MS-DOS format.
makewinmake() {
	./tools/template2mak.py "$1" | tr -d '\r' | sed -e 's/$/\r/' >"$2"
}


# Use templating system to generate various Makefiles.
expand_templates() {
	for template in $@
	do
		./tools/template2mak.py "$template" "${template%.template}"
	done

	# Ensure CR/LF line endings for the Windows files we generate.
	for template in win32/*.mak.template
	do
		sed "${template%.template}" -i -e 's/\r*$/\r/'
	done
}


# Expand templates using our custom templating tool.  Skip the version.hxx
# template; that header gets generated in a completely different way.
expand_templates $(find -name \*.template | grep -v version.hxx)


# Generate version header.
substitute include/pqxx/version.hxx.template >include/pqxx/version.hxx


autoheader
libtoolize --force --automake --copy
aclocal -I . -I config/m4
automake --add-missing --copy
autoconf

conf_flags="--enable-maintainer-mode ${CONFIG_ARGS:-}"
if [ -z "${NOCONFIGURE:-}" ]
then
	echo Running ./configure $conf_flags "$@" ...
	./configure $conf_flags "$@"
	echo "Now type 'make' to compile libpqxx."
else
	echo Skipping configure process.
fi