test/configure

Tue, 12 Sep 2023 22:34:02 +0200

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

fix failing test

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

mercurial