src/test/resources/golden-sample/configure

Tue, 12 Sep 2023 22:42:12 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 12 Sep 2023 22:42:12 +0200
changeset 50
d26da280c934
parent 49
68cc8e282a26
child 51
5c12e9e29733
permissions
-rwxr-xr-x

automatically generate dist files with correct version number - fixes #262

39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
1 #!/bin/sh
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
2
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
3 HOST=`uname -n`
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
4 PREFIX=`pwd`/work
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
5 INSTALL_DIR=$PREFIX
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
6
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
7 EPREFIX=$PREFIX
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
8
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
9 BINDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
10 SBINDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
11 LIBDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
12 LIBEXECDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
13 DATADIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
14 SYSCONFDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
15 SHAREDSTATEDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
16 LOCALSTATEDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
17 INCLUDEDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
18 INFODIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
19 MANDIR=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
20
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
21 OS=`uname -s`
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
22 OS_VERSION=`uname -r`
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
23
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
24 TEMP_DIR=".tmp-`uname -n`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
25 mkdir -p "$TEMP_DIR"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
26 if [ $? -ne 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
27 echo "Cannot create tmp dir"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
28 echo "Abort"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
29 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
30 touch "$TEMP_DIR/options"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
31 touch "$TEMP_DIR/features"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
32
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
33 # features
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
34 FEATURE_PG=auto
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
35
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
36 # help text
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
37 printhelp()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
38 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
39 echo "Usage: $0 [OPTIONS]..."
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
40 cat << __EOF__
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
41 Installation directories:
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
42 --prefix=PREFIX path prefix for architecture-independent files
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
43 [/usr]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
44 --exec-prefix=EPREFIX path prefix for architecture-dependent files
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
45 [PREFIX]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
46
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
47 --bindir=DIR user executables [EPREFIX/bin]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
48 --sbindir=DIR system admin executables [EPREFIX/sbin]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
49 --libexecdir=DIR program executables [EPREFIX/libexec]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
50 --sysconfdir=DIR system configuration files [PREFIX/etc]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
51 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
52 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
53 --libdir=DIR object code libraries [EPREFIX/lib]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
54 --includedir=DIR C header files [PREFIX/include]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
55 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
56 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
57 --infodir=DIR info documentation [DATAROOTDIR/info]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
58 --mandir=DIR man documentation [DATAROOTDIR/man]
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
59
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
60 Optional Features:
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
61 --disable-pg
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
62
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
63 __EOF__
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
64 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
65
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
66 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
67 # parse arguments
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
68 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
69 for ARG in "$@"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
70 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
71 case "$ARG" in
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
72 "--prefix="*) PREFIX=${ARG#--prefix=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
73 "--exec-prefix="*) EPREFIX=${ARG#--exec-prefix=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
74 "--bindir="*) BINDIR=${ARG#----bindir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
75 "--sbindir="*) SBINDIR=${ARG#--sbindir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
76 "--libdir="*) LIBDIR=${ARG#--libdir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
77 "--libexecdir="*) LIBEXECDIR=${ARG#--libexecdir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
78 "--datadir="*) DATADIR=${ARG#--datadir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
79 "--sysconfdir="*) SYSCONFDIR=${ARG#--sysconfdir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
80 "--sharedstatedir="*) SHAREDSTATEDIR=${ARG#--sharedstatedir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
81 "--localstatedir="*) LOCALSTATEDIR=${ARG#--localstatedir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
82 "--includedir="*) INCLUDEDIR=${ARG#--includedir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
83 "--infodir="*) INFODIR=${ARG#--infodir=} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
84 "--mandir"*) MANDIR=${ARG#--mandir} ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
85 "--help"*) printhelp; rm -Rf "$TEMP_DIR"; exit 1 ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
86 "--enable-pg") FEATURE_PG=on ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
87 "--disable-pg") unset FEATURE_PG ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
88 "-"*) echo "unknown option: $ARG"; rm -Rf "$TEMP_DIR"; exit 1 ;;
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
89 esac
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
90 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
91
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
92 # set dir variables
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
93 if [ -z "$BINDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
94 BINDIR=$EPREFIX/bin
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
95 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
96 if [ -z "$SBINDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
97 SBINDIR=$EPREFIX/sbin
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
98 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
99 if [ -z "$LIBDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
100 LIBDIR=$EPREFIX/lib
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
101 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
102 if [ -z "$LIBEXEC" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
103 LIBEXECDIR=$EPREFIX/libexec
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
104 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
105 if [ -z "$DATADIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
106 DATADIR=$PREFIX/share
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
107 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
108 if [ -z "$SYSCONFDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
109 SYSCONFDIR=$PREFIX/etc
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
110 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
111 if [ -z "$SHAREDSTATEDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
112 SHAREDSTATEDIR=$PREFIX/com
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
113 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
114 if [ -z "$LOCALSTATEDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
115 LOCALSTATEDIR=$PREFIX/var
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
116 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
117 if [ -z "$INCLUDEDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
118 INCLUDEDIR=$PREFIX/include
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
119 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
120 if [ -z "$INFODIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
121 INFODIR=$PREFIX/info
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
122 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
123 if [ -z "$MANDIR" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
124 MANDIR=$PREFIX/man
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
125 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
126
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
127 which pkg-config > /dev/null
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
128 if [ $? -eq 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
129 PKG_CONFIG=pkg-config
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
130 else
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
131 PKG_CONFIG=false
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
132 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
133
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
134 # Simple uname based platform detection
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
135 # $PLATFORM is used for platform dependent dependency selection
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
136 printf "detect platform... "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
137 if [ "$OS" = "SunOS" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
138 PLATFORM="solaris sunos unix svr4"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
139 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
140 if [ "$OS" = "Linux" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
141 PLATFORM="linux unix"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
142 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
143 if [ "$OS" = "FreeBSD" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
144 PLATFORM="freebsd bsd unix"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
145 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
146 if [ "$OS" = "Darwin" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
147 PLATFORM="macos osx bsd unix"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
148 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
149 echo "$OS" | grep -i "MINGW" > /dev/null
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
150 if [ $? -eq 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
151 PLATFORM="windows mingw"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
152 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
153
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
154 if [ -z "$PLATFORM" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
155 PLATFORM="unix"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
156 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
157
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
158 for p in $PLATFORM
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
159 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
160 PLATFORM_NAME=$p
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
161 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
162 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
163 echo $PLATFORM_NAME
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
164
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
165 isplatform()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
166 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
167 for p in $PLATFORM
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
168 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
169 if [ "$p" = "$1" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
170 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
171 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
172 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
173 return 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
174 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
175 isnotplatform()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
176 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
177 for p in $PLATFORM
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
178 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
179 if [ "$p" = "$1" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
180 return 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
181 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
182 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
183 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
184 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
185
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
186 # generate config.mk and config.h
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
187 cat > "$TEMP_DIR/config.mk" << __EOF__
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
188 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
189 # config.mk generated by configure
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
190 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
191
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
192 # general vars
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
193 HOST=$HOST
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
194 PREFIX=$PREFIX
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
195 INSTALL_DIR=$INSTALL_DIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
196
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
197 EPREFIX=$EPREFIX
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
198
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
199 BINDIR=$BINDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
200 SBINDIR=$SBINDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
201 LIBDIR=$LIBDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
202 LIBEXECDIR=$LIBEXECDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
203 DATADIR=$DATADIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
204 SYSCONFDIR=$SYSCONFDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
205 SHAREDSTATEDIR=$SHAREDSTATEDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
206 LOCALSTATEDIR=$LOCALSTATEDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
207 INCLUDEDIR=$INCLUDEDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
208 INFODIR=$INFODIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
209 MANDIR=$MANDIR
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
210
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
211 __EOF__
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
212
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
213 echo > "$TEMP_DIR/make.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
214
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
215 ENV_CFLAGS=$CFLAGS
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
216 ENV_LDFLAGS=$LDFLAGS
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
217 ENV_CXXFLAGS=$CXXFLAGS
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
218
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
219 # Toolchain detection
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
220 # this will insert make vars to config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
221 . make/toolchain.sh
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
222
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
223 # add user specified flags to config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
224 echo "# project specific flags" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
225 if [ -n "${ENV_CFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
226 echo "CFLAGS += $ENV_CFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
227 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
228 if [ -n "${ENV_CXXFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
229 echo "CXXFLAGS += $ENV_CXXFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
230 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
231 if [ -n "${ENV_LDFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
232 echo "LDFLAGS += $ENV_LDFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
233 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
234
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
235 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
236 # DEPENDENCIES
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
237 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
238
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
239 dependency_libpq()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
240 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
241 printf "checking for libpq... "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
242 # dependency libpq
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
243 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
244 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
245 if [ -z "$PKG_CONFIG" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
246 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
247 fi
49
68cc8e282a26 fix failing test
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
248 $PKG_CONFIG libpq
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
249 if [ $? -ne 0 ] ; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
250 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
251 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
252 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libpq`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
253 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libpq`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
254 echo yes
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
255 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
256 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
257
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
258 echo no
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
259 return 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
260 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
261 dependency_openssl()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
262 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
263 printf "checking for openssl... "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
264 # dependency openssl
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
265 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
266 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
267 if [ -z "$PKG_CONFIG" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
268 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
269 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
270 $PKG_CONFIG openssl
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
271 if [ $? -ne 0 ] ; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
272 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
273 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
274 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags openssl`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
275 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs openssl`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
276 echo yes
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
277 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
278 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
279
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
280 # dependency openssl platform="bsd"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
281 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
282 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
283 if isnotplatform "bsd"; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
284 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
285 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
286 TEMP_LDFLAGS="$TEMP_LDFLAGS -lssl -lcrypto"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
287 echo yes
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
288 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
289 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
290
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
291 echo no
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
292 return 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
293 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
294 dependency_libxml2()
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
295 {
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
296 printf "checking for libxml2... "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
297 # dependency libxml2 platform="macos"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
298 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
299 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
300 if isnotplatform "macos"; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
301 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
302 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
303 xml2-config --cflags > /dev/null
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
304 if [ $? -eq 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
305 TEMP_CFLAGS="$TEMP_CFLAGS `xml2-config --cflags`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
306 else
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
307 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
308 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
309 xml2-config --libs > /dev/null
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
310 if [ $? -eq 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
311 TEMP_LDFLAGS="$TEMP_LDFLAGS `xml2-config --libs`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
312 else
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
313 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
314 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
315 echo yes
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
316 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
317 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
318
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
319 # dependency libxml2
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
320 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
321 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
322 if [ -z "$PKG_CONFIG" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
323 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
324 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
325 $PKG_CONFIG libxml-2.0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
326 if [ $? -ne 0 ] ; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
327 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
328 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
329 TEMP_CFLAGS="$TEMP_CFLAGS `$PKG_CONFIG --cflags libxml-2.0`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
330 TEMP_LDFLAGS="$TEMP_LDFLAGS `$PKG_CONFIG --libs libxml-2.0`"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
331 echo yes
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
332 return 0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
333 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
334
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
335 echo no
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
336 return 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
337 }
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
338
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
339 DEPENDENCIES_FAILED=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
340 ERROR=0
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
341 # general dependencies
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
342 TEMP_CFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
343 TEMP_LDFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
344 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
345 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
346 while true
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
347 do
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
348
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
349
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
350 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
351 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
352
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
353 break
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
354 done
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
355
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
356 # add general dependency flags to config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
357 echo >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
358 if [ -n "${TEMP_CFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
359 echo "CFLAGS += $TEMP_CFLAGS" >> $TEMP_DIR/config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
360 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
361 if [ -n "${TEMP_CXXFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
362 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> $TEMP_DIR/config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
363 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
364 if [ -n "${TEMP_LDFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
365 echo "LDFLAGS += $TEMP_LDFLAGS" >> $TEMP_DIR/config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
366 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
367
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
368 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
369 # OPTION VALUES
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
370 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
371
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
372 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
373 # TARGETS
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
374 #
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
375 TEMP_CFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
376 TEMP_CXXFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
377 TEMP_LDFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
378
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
379 # Target
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
380 TEMP_CFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
381 TEMP_LDFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
382 TEMP_CXXFLAGS=
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
383
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
384 dependency_libxml2
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
385 if [ $? -ne 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
386 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libxml2 "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
387 ERROR=1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
388 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
389 dependency_openssl
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
390 if [ $? -ne 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
391 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED openssl "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
392 ERROR=1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
393 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
394
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
395 # Features
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
396 if [ -n "$FEATURE_PG" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
397 # check dependency
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
398 dependency_libpq
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
399 if [ $? -ne 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
400 # "auto" features can fail and are just disabled in this case
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
401 if [ "$FEATURE_PG" != "auto" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
402 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED libpq "
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
403 ERROR=1
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
404 else
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
405 unset FEATURE_PG
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
406 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
407 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
408 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
409
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
410
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
411 echo >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
412 if [ -n "${TEMP_CFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
413 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
414 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
415 if [ -n "${TEMP_CXXFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
416 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
417 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
418 if [ -n "${TEMP_LDFLAGS}" ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
419 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
420 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
421
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
422 if [ $ERROR -ne 0 ]; then
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
423 echo
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
424 echo "Error: Unresolved dependencies"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
425 echo "$DEPENDENCIES_FAILED"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
426 rm -Rf "$TEMP_DIR"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
427 exit 1
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
428 fi
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
429
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
430 echo "configure finished"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
431 echo
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
432 echo "Build Config:"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
433 echo " PREFIX: $PREFIX"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
434 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
435 echo "Features:"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
436 if [ -n "$FEATURE_PG" ]; then
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
437 echo " pg: on"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
438 else
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
439 echo " pg: off"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 39
diff changeset
440 fi
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
441 echo
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
442 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
443 rm -Rf "$TEMP_DIR"
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
444
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents:
diff changeset
445

mercurial