test/configure

Fri, 15 Sep 2023 14:06:50 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 15 Sep 2023 14:06:50 +0200
branch
configure-evo
changeset 54
2b8f40c58944
parent 53
704368f1bb23
child 60
43d6680e6410
permissions
-rwxr-xr-x

make configure script svr4 compatible again

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

mercurial