src/main/resources/make/configure.vm

Sun, 15 Dec 2024 14:56:05 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 15 Dec 2024 14:56:05 +0100
changeset 129
b38ea78d842c
parent 128
22f7262475e7
child 130
424a0fb2c64f
permissions
-rw-r--r--

add detection for invalid option values - fixes #518

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
115
36e4aedd5663 fix hardcoded default for prefix in help text
Mike Becker <universe@uap-core.de>
parents: 114
diff changeset
3 #set( $D = '$' )
116
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
4 #[[
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
5 # some utility functions
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
6 isplatform()
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
7 {
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
8 for p in $PLATFORM
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
9 do
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
10 if [ "$p" = "$1" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
11 return 0
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
12 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
13 done
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
14 return 1
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
15 }
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
16 notisplatform()
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
17 {
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
18 for p in $PLATFORM
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
19 do
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
20 if [ "$p" = "$1" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
21 return 1
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
22 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
23 done
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
24 return 0
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
25 }
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
26 istoolchain()
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
27 {
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
28 for t in $TOOLCHAIN
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
29 do
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
30 if [ "$t" = "$1" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
31 return 0
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
32 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
33 done
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
34 return 1
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
35 }
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
36 notistoolchain()
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
37 {
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
38 for t in $TOOLCHAIN
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
39 do
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
40 if [ "$t" = "$1" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
41 return 1
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
42 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
43 done
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
44 return 0
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
45 }
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
47 # clean abort
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
48 abort_configure()
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
49 {
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
50 rm -Rf "$TEMP_DIR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
51 exit 1
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
52 }
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
53
116
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
54 # Test for availability of pkg-config
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
55 PKG_CONFIG=`command -v pkg-config`
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
56 : ${PKG_CONFIG:="false"}
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
57
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
58 # Simple uname based platform detection
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
59 # $PLATFORM is used for platform dependent dependency selection
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
60 OS=`uname -s`
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
61 OS_VERSION=`uname -r`
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
62 printf "detect platform... "
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
63 if [ "$OS" = "SunOS" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
64 PLATFORM="solaris sunos unix svr4"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
65 elif [ "$OS" = "Linux" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
66 PLATFORM="linux unix"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
67 elif [ "$OS" = "FreeBSD" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
68 PLATFORM="freebsd bsd unix"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
69 elif [ "$OS" = "OpenBSD" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
70 PLATFORM="openbsd bsd unix"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
71 elif [ "$OS" = "NetBSD" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
72 PLATFORM="netbsd bsd unix"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
73 elif [ "$OS" = "Darwin" ]; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
74 PLATFORM="macos osx bsd unix"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
75 elif echo "$OS" | grep -i "MINGW" > /dev/null; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
76 PLATFORM="windows mingw"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
77 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
78 : ${PLATFORM:="unix"}
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
79
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
80 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
81 echo "$PLATFORM_NAME"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
82 ]]#
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
83
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 # help text
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 printhelp()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 {
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
87 echo "Usage: $0 [OPTIONS]..."
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
88 cat << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 Installation directories:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 --prefix=PREFIX path prefix for architecture-independent files
115
36e4aedd5663 fix hardcoded default for prefix in help text
Mike Becker <universe@uap-core.de>
parents: 114
diff changeset
91 [${D}prefix]
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 --exec-prefix=EPREFIX path prefix for architecture-dependent files
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 [PREFIX]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95 --bindir=DIR user executables [EPREFIX/bin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 --sbindir=DIR system admin executables [EPREFIX/sbin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 --libexecdir=DIR program executables [EPREFIX/libexec]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 --sysconfdir=DIR system configuration files [PREFIX/etc]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
88
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
101 --runstatedir=DIR run-time variable data [LOCALSTATEDIR/run]
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 --libdir=DIR object code libraries [EPREFIX/lib]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 --includedir=DIR C header files [PREFIX/include]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 --infodir=DIR info documentation [DATAROOTDIR/info]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107 --mandir=DIR man documentation [DATAROOTDIR/man]
88
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
108 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109
128
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
110 Build Types:
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
111 --debug add extra compile flags for debug builds
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
112 --release add extra compile flags for release builds
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 #if( $options.size() > 0 )
128
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
114
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 Options:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 #foreach( $opt in $options )
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
117 --${opt.argument}=${opt.valuesString}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 #if( $features.size() > 0 )
128
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
121
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 Optional Features:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123 #foreach( $feature in $features )
97
1af1bfacd25a add helptext descriptions for features
Mike Becker <universe@uap-core.de>
parents: 94
diff changeset
124 ${feature.helpText}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125 #end
128
22f7262475e7 fixes debug/release options only showing when other options are specified - fixes #528
Mike Becker <universe@uap-core.de>
parents: 127
diff changeset
126 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 __EOF__
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130
116
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
131 # create temporary directory
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
132 TEMP_DIR=".tmp-`uname -n`"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
133 rm -Rf "$TEMP_DIR"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
134 if mkdir -p "$TEMP_DIR"; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
135 :
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
136 else
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
137 echo "Cannot create tmp dir $TEMP_DIR"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
138 echo "Abort"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
139 exit 1
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
140 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
141 touch "$TEMP_DIR/options"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
142 touch "$TEMP_DIR/features"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
143
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
144 # define standard variables
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
145 # also define standard prefix (this is where we will search for config.site)
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
146 prefix=/usr
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
147 exec_prefix=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
148 bindir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
149 sbindir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
150 libdir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
151 libexecdir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
152 datarootdir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
153 datadir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
154 sysconfdir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
155 sharedstatedir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
156 localstatedir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
157 runstatedir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
158 includedir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
159 infodir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
160 localedir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
161 mandir=
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
162
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
163 # custom variables
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
164 #foreach( $cfg in $config )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
165 if true \
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
166 #if( $cfg.platform )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
167 && isplatform "${cfg.platform}" \
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
168 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
169 #foreach( $np in $cfg.notList )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
170 && notisplatform "${np}" \
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
171 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
172 ; then
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
173 #foreach( $var in $cfg.vars )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
174 #if( $var.exec )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
175 ${var.varName}=`${var.value}`
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
176 #else
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
177 ${var.varName}="${var.value}"
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
178 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
179 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
180 fi
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
181 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
182
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
183 # features
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
184 #foreach( $feature in $features )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
185 #if( ${feature.auto} )
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
186 ${feature.varName}=auto
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
187 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
188 #end
41981a23aff8 add platform attributes to config element
Mike Becker <universe@uap-core.de>
parents: 115
diff changeset
189
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 #
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
191 # parse arguments
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 #
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
193 BUILD_TYPE="default"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
194 for ARG in "$@"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 do
16
4fac0e25ee04 improve posix shell compatibility
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 15
diff changeset
196 case "$ARG" in
88
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
197 "--prefix="*) prefix=${D}{ARG#--prefix=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
198 "--exec-prefix="*) exec_prefix=${D}{ARG#--exec-prefix=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
199 "--bindir="*) bindir=${D}{ARG#----bindir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
200 "--sbindir="*) sbindir=${D}{ARG#--sbindir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
201 "--libdir="*) libdir=${D}{ARG#--libdir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
202 "--libexecdir="*) libexecdir=${D}{ARG#--libexecdir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
203 "--datarootdir="*) datarootdir=${D}{ARG#--datarootdir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
204 "--datadir="*) datadir=${D}{ARG#--datadir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
205 "--sysconfdir="*) sysconfdir=${D}{ARG#--sysconfdir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
206 "--sharedstatedir="*) sharedstatedir=${D}{ARG#--sharedstatedir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
207 "--localstatedir="*) localstatedir=${D}{ARG#--localstatedir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
208 "--includedir="*) includedir=${D}{ARG#--includedir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
209 "--infodir="*) infodir=${D}{ARG#--infodir=} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
210 "--mandir"*) mandir=${D}{ARG#--mandir} ;;
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
211 "--localedir"*) localedir=${D}{ARG#--localedir} ;;
127
33bc4ae5d7cf improve error text when option is used without value - fixes #519
Mike Becker <universe@uap-core.de>
parents: 123
diff changeset
212 "--help"*) printhelp; abort_configure ;;
33bc4ae5d7cf improve error text when option is used without value - fixes #519
Mike Becker <universe@uap-core.de>
parents: 123
diff changeset
213 "--debug") BUILD_TYPE="debug" ;;
33bc4ae5d7cf improve error text when option is used without value - fixes #519
Mike Becker <universe@uap-core.de>
parents: 123
diff changeset
214 "--release") BUILD_TYPE="release" ;;
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
215 #foreach( $opt in $options )
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
216 "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
127
33bc4ae5d7cf improve error text when option is used without value - fixes #519
Mike Becker <universe@uap-core.de>
parents: 123
diff changeset
217 "--${opt.argument}") echo "option '$ARG' needs a value:"; echo " $ARG=${opt.valuesString}"; abort_configure ;;
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
219 #foreach( $feature in $features )
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
220 "--enable-${feature.arg}") ${feature.varName}=on ;;
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
221 "--disable-${feature.arg}") unset ${feature.varName} ;;
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
222 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
223 "-"*) echo "unknown option: $ARG"; abort_configure ;;
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
224 esac
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
227 ## Begin unparsed content. **
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
228 #[[
88
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
229
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
230 # set defaults for dir variables
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
231 : ${exec_prefix:="$prefix"}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
232 : ${bindir:='${exec_prefix}/bin'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
233 : ${sbindir:='${exec_prefix}/sbin'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
234 : ${libdir:='${exec_prefix}/lib'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
235 : ${libexecdir:='${exec_prefix}/libexec'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
236 : ${datarootdir:='${prefix}/share'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
237 : ${datadir:='${datarootdir}'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
238 : ${sysconfdir:='${prefix}/etc'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
239 : ${sharedstatedir:='${prefix}/com'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
240 : ${localstatedir:='${prefix}/var'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
241 : ${runstatedir:='${localstatedir}/run'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
242 : ${includedir:='${prefix}/include'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
243 : ${infodir:='${datarootdir}/info'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
244 : ${mandir:='${datarootdir}/man'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
245 : ${localedir:='${datarootdir}/locale'}
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
246
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
247 # check if a config.site exists and load it
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
248 if [ -n "$CONFIG_SITE" ]; then
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
249 # CONFIG_SITE may contain space separated file names
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
250 for cs in $CONFIG_SITE; do
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
251 printf "loading defaults from $cs... "
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
252 . "$cs"
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
253 echo ok
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
254 done
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
255 elif [ -f "$prefix/share/config.site" ]; then
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
256 printf "loading site defaults... "
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
257 . "$prefix/share/config.site"
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
258 echo ok
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
259 elif [ -f "$prefix/etc/config.site" ]; then
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
260 printf "loading site defaults... "
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
261 . "$prefix/etc/config.site"
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
262 echo ok
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
263 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
264 ]]#
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
265 ## End of unparsed content **
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
267 # generate vars.mk
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
268 cat > "$TEMP_DIR/vars.mk" << __EOF__
114
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
269 prefix=$prefix
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
270 exec_prefix=$exec_prefix
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
271 bindir=$bindir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
272 sbindir=$sbindir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
273 libdir=$libdir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
274 libexecdir=$libexecdir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
275 datarootdir=$datarootdir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
276 datadir=$datadir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
277 sysconfdir=$sysconfdir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
278 sharedstatedir=$sharedstatedir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
279 localstatedir=$localstatedir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
280 runstatedir=$runstatedir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
281 includedir=$includedir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
282 infodir=$infodir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
283 mandir=$mandir
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
284 localedir=$localedir
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
285 #foreach( $var in $vars )
114
0fa5a6f08245 remove unnecessary double-quotes in vars.mk - fixes #370
Mike Becker <universe@uap-core.de>
parents: 105
diff changeset
286 ${var.varName}=${D}${var.varName}
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
287 #end
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
288 __EOF__
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
289
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
290 # toolchain detection utilities
13
cdf8bf4549c4 fix compiler flag generation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
291 . make/toolchain.sh
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 # DEPENDENCIES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296
67
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
297 # check languages
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
298 lang_c=
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
299 lang_cpp=
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
300 #foreach( $lang in $languages )
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
301 if detect_${lang}_compiler ; then
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
302 lang_${lang}=1
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
303 fi
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
304 #end
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
305
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
306 # 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
307 echo > "$TEMP_DIR/make.mk"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
308
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
309 test_pkg_config()
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
310 {
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
311 if "$PKG_CONFIG" --exists "$1" ; then :
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
312 else return 1 ; fi
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
313 if [ -z "$2" ] || "$PKG_CONFIG" --atleast-version="$2" "$1" ; then :
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
314 else return 1 ; fi
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
315 if [ -z "$3" ] || "$PKG_CONFIG" --exact-version="$3" "$1" ; then :
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
316 else return 1 ; fi
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
317 if [ -z "$4" ] || "$PKG_CONFIG" --max-version="$4" "$1" ; then :
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
318 else return 1 ; fi
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
319 return 0
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
320 }
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
321
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
322 print_check_msg()
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
323 {
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
324 if [ -z "$1" ]; then
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
325 shift
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
326 printf "$@"
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
327 fi
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
328 }
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
329
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
330 #foreach( $dependency in $namedDependencies )
78
c3a62e0baa9e fix special chars in dependency names are breaking configure - fixes #312
Mike Becker <universe@uap-core.de>
parents: 77
diff changeset
331 dependency_error_${dependency.id}()
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
332 {
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
333 print_check_msg "${D}dep_checked_${dependency.id}" "checking for ${dependency.name}... "
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
334 #foreach( $sub in $dependency.subdependencies )
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
335 # dependency $sub.fullName
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
336 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
337 do
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
338 #if( $sub.platform )
56
d9e8fdfc08f6 bring back notisplatform
Mike Becker <universe@uap-core.de>
parents: 54
diff changeset
339 if notisplatform "${sub.platform}"; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
340 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
341 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
342 #end
104
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
343 #if( $sub.toolchain )
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
344 if notistoolchain "${sub.toolchain}"; then
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
345 break
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
346 fi
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
347 #end
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
348 #foreach( $np in $sub.notList )
104
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
349 if isplatform "${np}" || istoolchain "${np}"; then
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
350 break
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
351 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
352 #end
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
353 #foreach( $lang in $sub.lang )
67
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
354 if [ -z "$lang_${lang}" ] ; then
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
355 break
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
356 fi
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
357 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
358 #if( $sub.pkgconfig.size() > 0 )
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
359 if [ -z "$PKG_CONFIG" ]; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
360 break
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
361 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
362 #end
33
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
363 #foreach( $test in $sub.tests )
58
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
364 if $test > /dev/null ; then
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
365 :
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
366 else
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
367 break
33
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
368 fi
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
369 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370 #foreach( $pkg in $sub.pkgconfig )
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
371 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
58
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
372 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
373 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
374 else
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378 #foreach( $flags in $sub.flags )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
379 #if( $flags.exec )
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
380 if tmp_flags=`$flags.value` ; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
381 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 else
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
383 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
385 #else
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
386 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
387 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
388 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
389 #if ( $sub.make.length() > 0 )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
390 cat >> $TEMP_DIR/make.mk << __EOF__
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
391 # Dependency: $dependency.name
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
392 $sub.make
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
393 __EOF__
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
394 #end
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
395 print_check_msg "${D}dep_checked_${dependency.id}" "yes\n"
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
396 dep_checked_${dependency.id}=1
57
df03772f7429 invert logic of dependency check
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
397 return 1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
398 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
399
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
400 #end
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
401 print_check_msg "${D}dep_checked_${dependency.id}" "no\n"
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
402 dep_checked_${dependency.id}=1
57
df03772f7429 invert logic of dependency check
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
403 return 0
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
404 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
405 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
406
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
407 # start collecting dependency information
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
408 echo > "$TEMP_DIR/flags.mk"
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
409
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
410 DEPENDENCIES_FAILED=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
411 ERROR=0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
412 #if( $dependencies.size() > 0 )
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
413 # unnamed dependencies
30
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
414 TEMP_CFLAGS=
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
415 TEMP_CXXFLAGS=
30
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
416 TEMP_LDFLAGS=
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
417 #foreach( $dependency in $dependencies )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
418 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
419 do
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
420 #if( $dependency.platform )
56
d9e8fdfc08f6 bring back notisplatform
Mike Becker <universe@uap-core.de>
parents: 54
diff changeset
421 if notisplatform "${dependency.platform}"; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
422 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
423 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
424 #end
104
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
425 #if( $dependency.toolchain )
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
426 if notistoolchain "${dependency.toolchain}"; then
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
427 break
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
428 fi
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
429 #end
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
430 #foreach( $np in $dependency.notList )
104
ea36fd802446 adds documentation for new toolchain attr to XSD
Mike Becker <universe@uap-core.de>
parents: 102
diff changeset
431 if isplatform "${np}" || istoolchain "${np}"; then
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
432 break
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
433 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
434 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
435 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
436 do
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
437 #foreach( $lang in $dependency.lang )
67
e43d30273f74 check compilers before any dependency checks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 66
diff changeset
438 if [ -z "$lang_${lang}" ] ; then
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
439 ERROR=1
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
440 break
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
441 fi
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
442 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
443 #if( $dependency.pkgconfig.size() > 0 )
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
444 if [ -z "$PKG_CONFIG" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
445 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
446 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
447 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
448 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
449 #foreach( $pkg in $dependency.pkgconfig )
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
450 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "checking for pkg-config package $pkg.name... "
63
ac47c2fb2c4a fix bogus version constraint test - relates to #294
Mike Becker <universe@uap-core.de>
parents: 59
diff changeset
451 if test_pkg_config "$pkg.name" "$pkg.atleast" "$pkg.exact" "$pkg.max" ; then
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
452 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "yes\n"
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
453 dep_pkgconfig_checked_${pkg.id}=1
58
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
454 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
455 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
456 else
91
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
457 print_check_msg "${D}dep_pkgconfig_checked_${pkg.id}" "no\n"
f14d77dd4215 fix duplicate output when checking dependencies
Mike Becker <universe@uap-core.de>
parents: 90
diff changeset
458 dep_pkgconfig_checked_${pkg.id}=1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
459 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
460 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
461 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
462 #end
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
463
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
464 #foreach( $flags in $dependency.flags )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
465 #if( $flags.exec )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
466 $flags.value > /dev/null
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
467 if tmp_flags=`$flags.value` ; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
468 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
469 else
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
470 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
471 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
472 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
473 #else
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
474 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
475 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
476 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
477 #if ( $dependency.make.length() > 0 )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
478 cat >> "$TEMP_DIR/make.mk" << __EOF__
6
d4363f69fd97 fix unnamed dependency make code template
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
479 $dependency.make
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
480 __EOF__
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
481 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
482 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
483 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
484 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
485 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
486 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
487
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
488 # add general dependency flags to flags.mk
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
489 echo "# general flags" >> "$TEMP_DIR/flags.mk"
94
002497e6c27d replace -a with && in configure
Mike Becker <universe@uap-core.de>
parents: 91
diff changeset
490 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
491 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
492 fi
94
002497e6c27d replace -a with && in configure
Mike Becker <universe@uap-core.de>
parents: 91
diff changeset
493 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
494 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
495 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
496 if [ -n "${TEMP_LDFLAGS}" ]; then
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
497 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
498 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
499 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
500
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
501 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
502 # OPTION VALUES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
503 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
504 #foreach( $opt in $options )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
505 #foreach( $val in $opt.values )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
506 ${val.func}()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
507 {
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
508 VERR=0
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
509 #foreach( $dep in $val.dependencies )
57
df03772f7429 invert logic of dependency check
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
510 if dependency_error_$dep ; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
511 VERR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
512 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
513 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
514 if [ $VERR -ne 0 ]; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
515 return 1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
516 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
517 #foreach( $def in $val.defines )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
518 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
519 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
520 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
521 #if( $val.hasMake() )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
522 cat >> "$TEMP_DIR/make.mk" << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
523 $val.make
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
524 __EOF__
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
525 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
526 return 0
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
527 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
528 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
529 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
530
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
531 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
532 # TARGETS
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
533 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
534
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
535 #foreach( $target in $targets )
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
536 echo >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
537 #if ( $target.name )
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
538 echo "configuring target: $target.name"
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
539 echo "# flags for target $target.name" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
540 #else
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
541 echo "configuring global target"
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
542 echo "# flags for unnamed target" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
543 #end
30
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
544 TEMP_CFLAGS=
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
545 TEMP_CXXFLAGS=
30
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
546 TEMP_LDFLAGS=
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
547
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
548 #foreach( $dependency in $target.dependencies )
57
df03772f7429 invert logic of dependency check
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
549 if dependency_error_$dependency; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
550 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
551 ERROR=1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
552 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
553 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
554
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
555 # Features
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
556 #foreach( $feature in $target.features )
82
85f5188acc21 use ${D} instead of hoping for $$ to always work
Mike Becker <universe@uap-core.de>
parents: 79
diff changeset
557 if [ -n "${D}${feature.varName}" ]; then
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
558 #foreach( $dependency in $feature.dependencies )
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
559 # check dependency
57
df03772f7429 invert logic of dependency check
Mike Becker <universe@uap-core.de>
parents: 56
diff changeset
560 if dependency_error_$dependency ; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
561 # "auto" features can fail and are just disabled in this case
82
85f5188acc21 use ${D} instead of hoping for $$ to always work
Mike Becker <universe@uap-core.de>
parents: 79
diff changeset
562 if [ "${D}${feature.varName}" = "auto" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
563 DISABLE_${feature.varName}=1
68
c997c0978665 fix automatic feature disabling failed when more than one dependency is missing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
564 else
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
565 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
566 ERROR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
567 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
568 fi
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
569 #end
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
570 if [ -n "$DISABLE_${feature.varName}" ]; then
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
571 unset ${feature.varName}
68
c997c0978665 fix automatic feature disabling failed when more than one dependency is missing
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 67
diff changeset
572 fi
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
573 fi
122
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
574 if [ -n "${D}${feature.varName}" ]; then
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
575 :
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
576 #foreach( $def in $feature.defines )
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
577 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
578 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
579 #end
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
580 #if( $feature.hasMake() )
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
581 cat >> "$TEMP_DIR/make.mk" << __EOF__
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
582 $feature.make
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
583 __EOF__
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
584 #end
123
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
585 else
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
586 :
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
587 #foreach( $def in $feature.disabled.defines )
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
588 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
589 TEMP_CXXFLAGS="$TEMP_CXXFLAGS ${def.toFlags()}"
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
590 #end
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
591 #if( $feature.disabled.hasMake() )
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
592 cat >> "$TEMP_DIR/make.mk" << __EOF__
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
593 $feature.disabled.make
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
594 __EOF__
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
595 #end
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
596 #foreach( $dependency in $feature.disabled.dependencies )
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
597 if dependency_error_$dependency ; then
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
598 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
599 ERROR=1
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
600 fi
d89b75fdf0aa add target data for disabled features - resolves #476
Mike Becker <universe@uap-core.de>
parents: 122
diff changeset
601 #end
122
5706694c17c4 fix configure not emitting target data for features - fixes #478
Mike Becker <universe@uap-core.de>
parents: 116
diff changeset
602 fi
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
603 #end
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
604
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
605 #foreach( $opt in $target.options )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
606 # Option: --${opt.argument}
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
607 if [ -z "${D}${opt.varName}" ]; then
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
608 echo "auto-detecting option '${opt.argument}'"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
609 SAVED_ERROR="$ERROR"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
610 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
611 ERROR=1
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
612 while true
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
613 do
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
614 #foreach( $optdef in $opt.defaults )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
615 #if( $optdef.platform )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
616 if isplatform "$optdef.platform"; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
617 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
618 if $optdef.func ; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
619 echo " ${opt.argument}: ${optdef.valueName}" >> "$TEMP_DIR/options"
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
620 ERROR=0
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
621 break
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
622 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
623 #if( $optdef.platform )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
624 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
625 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
626 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
627 break
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
628 done
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
629 if [ $ERROR -ne 0 ]; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
630 SAVED_ERROR=1
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
631 SAVED_DEPENDENCIES_FAILED="option '${opt.argument}' $SAVED_DEPENDENCIES_FAILED"
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
632 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
633 ERROR="$SAVED_ERROR"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
634 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
635 else
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
636 echo "checking option ${opt.argument} = ${D}${opt.varName}"
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
637 if false; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
638 false
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
639 #foreach( $optval in $opt.values )
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
640 elif [ "${D}${opt.varName}" = "${optval.value}" ]; then
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
641 echo " ${opt.argument}: ${D}${opt.varName}" >> $TEMP_DIR/options
58
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
642 if $optval.func ; then
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
643 :
362998dbe619 removal of failed function in favor what the ancients actually did
Mike Becker <universe@uap-core.de>
parents: 57
diff changeset
644 else
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
645 ERROR=1
83
868e0d4b0a57 fix missing error reporting when all option defaults fail - fixes #299
Mike Becker <universe@uap-core.de>
parents: 82
diff changeset
646 DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED"
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
647 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
648 #end
129
b38ea78d842c add detection for invalid option values - fixes #518
Mike Becker <universe@uap-core.de>
parents: 128
diff changeset
649 else
b38ea78d842c add detection for invalid option values - fixes #518
Mike Becker <universe@uap-core.de>
parents: 128
diff changeset
650 echo
b38ea78d842c add detection for invalid option values - fixes #518
Mike Becker <universe@uap-core.de>
parents: 128
diff changeset
651 echo "Invalid option value - usage:"
b38ea78d842c add detection for invalid option values - fixes #518
Mike Becker <universe@uap-core.de>
parents: 128
diff changeset
652 echo " --${opt.argument}=${opt.valuesString}"
b38ea78d842c add detection for invalid option values - fixes #518
Mike Becker <universe@uap-core.de>
parents: 128
diff changeset
653 abort_configure
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
654 fi
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
655 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
656 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
657
94
002497e6c27d replace -a with && in configure
Mike Becker <universe@uap-core.de>
parents: 91
diff changeset
658 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
659 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
660 fi
94
002497e6c27d replace -a with && in configure
Mike Becker <universe@uap-core.de>
parents: 91
diff changeset
661 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
662 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
663 fi
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
664 if [ "$BUILD_TYPE" = "debug" ]; then
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
665 if [ -n "$lang_c" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
666 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
667 fi
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
668 if [ -n "$lang_cpp" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
669 echo '${target.cxxFlags} += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
670 fi
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
671 fi
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
672 if [ "$BUILD_TYPE" = "release" ]; then
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
673 if [ -n "$lang_c" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
674 echo '${target.cFlags} += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
675 fi
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
676 if [ -n "$lang_cpp" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
677 echo '${target.cxxFlags} += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk"
77
439902ff0af3 do not generate flags when lang is not required - fixes #311
Mike Becker <universe@uap-core.de>
parents: 76
diff changeset
678 fi
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
679 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
680 if [ -n "${TEMP_LDFLAGS}" ]; then
79
ef0635b78b7b remove explicit calls of getters in velocity template
Mike Becker <universe@uap-core.de>
parents: 78
diff changeset
681 echo "${target.ldFlags} += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
682 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
683
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
684 #end
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
685
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
686 # final result
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
687 if [ $ERROR -ne 0 ]; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
688 echo
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
689 echo "Error: Unresolved dependencies"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
690 echo "$DEPENDENCIES_FAILED"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
691 abort_configure
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
692 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
693
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
694 echo "configure finished"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
695 echo
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
696 echo "Build Config:"
88
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
697 echo " PREFIX: $prefix"
0a663c3692a0 add support for config.site - fixes #313
Mike Becker <universe@uap-core.de>
parents: 83
diff changeset
698 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
699 #if ( $options.size() > 0 )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
700 echo "Options:"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
701 cat "$TEMP_DIR/options"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
702 #end
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
703 #if ( $features.size() > 0 )
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
704 echo "Features:"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
705 #foreach( $feature in $features )
82
85f5188acc21 use ${D} instead of hoping for $$ to always work
Mike Becker <universe@uap-core.de>
parents: 79
diff changeset
706 if [ -n "${D}${feature.varName}" ]; then
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
707 echo " $feature.name: on"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
708 else
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
709 echo " $feature.name: off"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
710 fi
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
711 #end
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
712 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
713 echo
66
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
714
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
715 # generate the config.mk file
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
716 cat > "$TEMP_DIR/config.mk" << __EOF__
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
717 #
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
718 # config.mk generated by configure
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
719 #
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
720
dc758dcd4645 add basic support for the lang element - fixes #284
Mike Becker <universe@uap-core.de>
parents: 63
diff changeset
721 __EOF__
71
b8d06f7b617c fix vars.mk never appended to config.mk
Mike Becker <universe@uap-core.de>
parents: 68
diff changeset
722 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
b8d06f7b617c fix vars.mk never appended to config.mk
Mike Becker <universe@uap-core.de>
parents: 68
diff changeset
723 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
724 rm -Rf "$TEMP_DIR"

mercurial