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