test/configure

Fri, 15 Sep 2023 11:33:35 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 15 Sep 2023 11:33:35 +0200
branch
configure-evo
changeset 53
704368f1bb23
parent 52
afcb57893858
child 54
2b8f40c58944
permissions
-rwxr-xr-x

revert command substitution syntax change (relates to #283)

0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
3 # create temporary directory
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
4 TEMP_DIR=".tmp-`uname -n`"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
5 rm -Rf "$TEMP_DIR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
6 if ! mkdir -p "$TEMP_DIR"; then
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
7 echo "Cannot create tmp dir $TEMP_DIR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
8 echo "Abort"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
9 exit 1
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
10 fi
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
11 touch "$TEMP_DIR/options"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
12 touch "$TEMP_DIR/features"
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
13
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
14 # define standard variables
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
15 PREFIX=/usr
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
16 EPREFIX=/usr
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 BINDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 SBINDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 LIBDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 LIBEXECDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 DATADIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 SYSCONFDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 SHAREDSTATEDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 LOCALSTATEDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 INCLUDEDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 INFODIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 MANDIR=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
29 # custom variables
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
30 HOST=`uname -n`
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
31 PREFIX=$(pwd)/work
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
32 INSTALL_DIR=$PREFIX
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 # features
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
35 FEATURE_PG=auto
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
37 # clean abort
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
38 abort_configure()
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
39 {
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
40 rm -Rf "$TEMP_DIR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
41 exit 1
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
42 }
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
43
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44 # help text
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 printhelp()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 {
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
47 echo "Usage: $0 [OPTIONS]..."
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
48 cat << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 Installation directories:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 --prefix=PREFIX path prefix for architecture-independent files
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 [/usr]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 --exec-prefix=EPREFIX path prefix for architecture-dependent files
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 [PREFIX]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 --bindir=DIR user executables [EPREFIX/bin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 --sbindir=DIR system admin executables [EPREFIX/sbin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 --libexecdir=DIR program executables [EPREFIX/libexec]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 --sysconfdir=DIR system configuration files [PREFIX/etc]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 --libdir=DIR object code libraries [EPREFIX/lib]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 --includedir=DIR C header files [PREFIX/include]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 --infodir=DIR info documentation [DATAROOTDIR/info]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 --mandir=DIR man documentation [DATAROOTDIR/man]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 Optional Features:
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
69 --disable-pg
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 __EOF__
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74 #
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
75 # parse arguments
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 #
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
77 BUILD_TYPE="default"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
78 for ARG in "$@"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 do
16
4fac0e25ee04 improve posix shell compatibility
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 15
diff changeset
80 case "$ARG" in
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
81 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
82 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
83 "--bindir="*) BINDIR=${ARG#----bindir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
84 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
85 "--libdir="*) LIBDIR=${ARG#--libdir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
86 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
87 "--datadir="*) DATADIR=${ARG#--datadir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
88 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
89 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
90 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
91 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
92 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
93 "--mandir"*) MANDIR=${ARG#--mandir} ;;
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
94 "--help"*) printhelp; abort_configure ;;
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
95 "--debug") BUILD_TYPE="debug" ;;
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
96 "--release") BUILD_TYPE="release" ;;
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
97 "--enable-pg") FEATURE_PG=on ;;
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
98 "--disable-pg") unset FEATURE_PG ;;
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
99 "-"*) echo "unknown option: $ARG"; abort_configure ;;
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
100 esac
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
103
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 # set dir variables
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
105 BINDIR=${BINDIR:-"$EPREFIX/bin"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
106 SBINDIR=${SBINDIR:-"$EPREFIX/sbin"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
107 LIBDIR=${LIBDIR:-"$EPREFIX/lib"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
108 LIBEXECDIR=${LIBEXECDIR:-"$EPREFIX/libexec"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
109 DATADIR=${DATADIR:-"$PREFIX/share"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
110 SYSCONFDIR=${SYSCONFDIR:-"$PREFIX/etc"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
111 SHAREDSTATEDIR=${SHAREDSTATEDIR:-"$PREFIX/com"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
112 LOCALSTATEDIR=${LOCALSTATEDIR:-"$PREFIX/var"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
113 INCLUDEDIR=${INCLUDEDIR:-"$PREFIX/include"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
114 INFODIR=${INFODIR:-"$PREFIX/info"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
115 MANDIR=${MANDIR:-"$PREFIX/man"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
117 # Test for availability of pkg-config
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
118 PKG_CONFIG=`command -v pkg-config`
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
119 PKG_CONFIG=${PKG_CONFIG:-"false"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121 # Simple uname based platform detection
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 # $PLATFORM is used for platform dependent dependency selection
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
123 OS=`uname -s`
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
124 OS_VERSION=`uname -r`
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 printf "detect platform... "
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
126 if [ "$OS" = "SunOS" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127 PLATFORM="solaris sunos unix svr4"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
129 if [ "$OS" = "Linux" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 PLATFORM="linux unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
132 if [ "$OS" = "FreeBSD" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 PLATFORM="freebsd bsd unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
135 if [ "$OS" = "Darwin" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 PLATFORM="macos osx bsd unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
138 if echo "$OS" | grep -i "MINGW" > /dev/null; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139 PLATFORM="windows mingw"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
141 PLATFORM=${PLATFORM:-"unix"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
143 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
144 echo "$PLATFORM_NAME"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 isplatform()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147 {
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 for p in $PLATFORM
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149 do
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
150 if [ "$p" = "$1" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151 return 0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 return 1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155 }
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
156
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
158 # generate config.mk
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
159 cat > "$TEMP_DIR/vars.mk" << __EOF__
8
82cd9f1d94cb add c++ compiler detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
160 PREFIX=$PREFIX
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
161 EPREFIX=$EPREFIX
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
162 BINDIR=$BINDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
163 SBINDIR=$SBINDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
164 LIBDIR=$LIBDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
165 LIBEXECDIR=$LIBEXECDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
166 DATADIR=$DATADIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
167 SYSCONFDIR=$SYSCONFDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
168 SHAREDSTATEDIR=$SHAREDSTATEDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
169 LOCALSTATEDIR=$LOCALSTATEDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
170 INCLUDEDIR=$INCLUDEDIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
171 INFODIR=$INFODIR
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
172 MANDIR=$MANDIR
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
173 HOST=$HOST
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
174 PREFIX=$PREFIX
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
175 INSTALL_DIR=$INSTALL_DIR
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
176 __EOF__
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
177 cat > "$TEMP_DIR/config.mk" << __EOF__
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
178 #
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
179 # config.mk generated by configure
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
180 #
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
181 __EOF__
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
182 sort -u "$TEMP_DIR/vars.mk" >> "$TEMP_DIR/config.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
185 # toolchain detection
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 # this will insert make vars to config.mk
13
cdf8bf4549c4 fix compiler flag generation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
187 . make/toolchain.sh
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
188 if [ -n "$TOOLCHAIN_ERROR" ]; then
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
189 echo "Toolchain error: $TOOLCHAIN_ERROR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
190 echo "Abort."
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
191 abort_configure
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 # DEPENDENCIES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
198 # create buffer for make variables required by dependencies
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
199 echo > "$TEMP_DIR/make.mk"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
200
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
201 dependency_libpq()
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 {
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
203 printf "checking for libpq... "
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
204 # dependency libpq
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
205 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
206 do
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 8
diff changeset
207 if [ -z "$PKG_CONFIG" ]; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
208 break
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
209 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
210 if ! $PKG_CONFIG libpq ; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
211 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
212 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
213 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libpq`"
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
214 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libpq`"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
215 echo yes
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
216 return 0
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
217 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
218
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
219 echo no
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
220 return 1
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
221 }
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
222 dependency_openssl()
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
223 {
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
224 printf "checking for openssl... "
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
225 # dependency openssl
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227 do
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 8
diff changeset
228 if [ -z "$PKG_CONFIG" ]; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
229 break
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
231 if ! $PKG_CONFIG openssl ; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
234 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags openssl`"
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
235 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs openssl`"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
236 echo yes
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
237 return 0
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
238 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
239
15
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
240 # dependency openssl platform="bsd"
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
241 while true
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
242 do
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
243 if ! isplatform "bsd"; then
15
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
244 break
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
245 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
246 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
247 echo yes
15
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
248 return 0
971ac4f0f1df fix toolchain detection in case gcc is not available
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
249 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
250
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
251 echo no
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
252 return 1
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
253 }
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
254 dependency_libxml2()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 {
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 printf "checking for libxml2... "
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
257 # dependency libxml2 platform="macos"
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
258 while true
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
259 do
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
260 if ! isplatform "macos"; then
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
261 break
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
262 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
263 if tmp_flags=`xml2-config --cflags` ; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
264 TEMP_CFLAGS="$TEMP_CFLAGS $tmp_flags"
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
265 else
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
266 break
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
267 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
268 if tmp_flags=`xml2-config --libs` ; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
269 TEMP_LDFLAGS="$TEMP_LDFLAGS $tmp_flags"
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
270 else
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
271 break
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
272 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
273 echo yes
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
274 return 0
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 16
diff changeset
275 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
276
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
277 # dependency libxml2
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 do
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 8
diff changeset
280 if [ -z "$PKG_CONFIG" ]; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
281 break
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
283 if ! $PKG_CONFIG libxml-2.0 ; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
286 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags libxml-2.0`"
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
287 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs libxml-2.0`"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
288 echo yes
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
289 return 0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
291
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
292 echo no
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
293 return 1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 DEPENDENCIES_FAILED=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297 ERROR=0
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
298 # unnamed dependencies
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
299 TEMP_CFLAGS=
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
300 TEMP_LDFLAGS=
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
301 while true
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
302 do
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
303 while true
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
304 do
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
305
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
306 break
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
307 done
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
308 break
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
309 done
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
310
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
311 # add unnamed dependency flags to config.mk
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
312 echo >> "$TEMP_DIR/config.mk"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
313 if [ -n "${TEMP_CFLAGS}" ]; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
314 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
315 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
316 if [ -n "${TEMP_LDFLAGS}" ]; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
317 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
318 fi
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
321 # OPTION VALUES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
322 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
323
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
324 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
325 # TARGETS
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
326 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327
5
895bf81d3b6e add missing source changes
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 4
diff changeset
328 # Target
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
329 TEMP_CFLAGS=
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
330 TEMP_LDFLAGS=
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
332 if ! dependency_libxml2; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
333 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 "
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
334 ERROR=1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
335 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
336 if ! dependency_openssl; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
337 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
338 ERROR=1
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
339 fi
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
340
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
341 # Features
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
342 if [ -n "$FEATURE_PG" ]; then
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
343 # check dependency
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
344 if ! dependency_libpq ; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
345 # "auto" features can fail and are just disabled in this case
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
346 if [ "$FEATURE_PG" = "auto" ]; then
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
347 unset FEATURE_PG
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
348 else
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
349 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq "
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
350 ERROR=1
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
351 fi
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
352 fi
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
353 fi
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
354
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
355
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
356 echo >> "$TEMP_DIR/config.mk"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
357 if [ -n "${TEMP_CFLAGS}" ]; then
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
358 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
359 fi
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
360 if [ "$BUILD_TYPE" = "debug" ]; then
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
361 echo 'CFLAGS += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
362 fi
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
363 if [ "$BUILD_TYPE" = "release" ]; then
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
364 echo 'CFLAGS += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
365 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
366 if [ -n "${TEMP_LDFLAGS}" ]; then
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
367 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
4
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
368 fi
6bf4c948d0ba make targets without name and prefix possible
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
369
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370 if [ $ERROR -ne 0 ]; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
371 echo
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
372 echo "Error: Unresolved dependencies"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
373 echo "$DEPENDENCIES_FAILED"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
374 abort_configure
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 echo "configure finished"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378 echo
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
379 echo "Build Config:"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380 echo " PREFIX: $PREFIX"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
382 echo "Features:"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
383 if [ -n "$FEATURE_PG" ]; then
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
384 echo " pg: on"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
385 else
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
386 echo " pg: off"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 34
diff changeset
387 fi
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
388 echo
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
389 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 20
diff changeset
390 rm -Rf "$TEMP_DIR"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
391
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
392

mercurial