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