src/test/resources/golden-sample/configure

Sun, 10 Sep 2023 13:12:54 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 10 Sep 2023 13:12:54 +0200
changeset 45
f4ec2feccebb
parent 39
3ca85da78515
child 47
78ee95836412
permissions
-rw-r--r--

add missing shId() in feature var name

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

mercurial