test/make/configure.vm

Sun, 17 Sep 2023 12:08:05 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 17 Sep 2023 12:08:05 +0200
branch
configure-evo
changeset 55
d626acd09e9f
parent 54
2b8f40c58944
child 56
d9e8fdfc08f6
permissions
-rw-r--r--

revert to backticks - relates to #283

0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
3 # runs a command and returns 0 if the command failed
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
4 # same as ! cmd but compatible with svr4 sh
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
5 failed()
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
6 {
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
7 $@
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
8 if [ $? -ne 0 ]; then
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
9 return 0
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
10 else
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
11 return 1
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
12 fi
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
13 }
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
14
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
15 # create temporary directory
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
16 TEMP_DIR=".tmp-`uname -n`"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
17 rm -Rf "$TEMP_DIR"
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
18 if failed mkdir -p "$TEMP_DIR"; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
19 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
20 echo "Abort"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
21 exit 1
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
22 fi
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
23 touch "$TEMP_DIR/options"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
24 touch "$TEMP_DIR/features"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
25
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
26 # define standard variables
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
27 PREFIX=/usr
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
28 EPREFIX=/usr
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
29 BINDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
30 SBINDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
31 LIBDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
32 LIBEXECDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
33 DATADIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
34 SYSCONFDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
35 SHAREDSTATEDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
36 LOCALSTATEDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
37 INCLUDEDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
38 INFODIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
39 MANDIR=
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
40
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
41 # custom variables
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
42 #foreach( $var in $vars )
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
43 #if( $var.exec )
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
44 ${var.varName}=`${var.value}`
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
45 #else
40
b42bfc9e9983 first minor code improvements
Mike Becker <universe@uap-core.de>
parents: 39
diff changeset
46 ${var.varName}=${var.value}
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
47 #end
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
48 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 # features
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 #foreach( $feature in $features )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 #if( ${feature.isDefault()} )
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
53 ${feature.getVarName()}=auto
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
57 # clean abort
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
58 abort_configure()
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
59 {
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
60 rm -Rf "$TEMP_DIR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
61 exit 1
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
62 }
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
63
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64 # help text
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 printhelp()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 {
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
67 echo "Usage: $0 [OPTIONS]..."
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
68 cat << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69 Installation directories:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 --prefix=PREFIX path prefix for architecture-independent files
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 [/usr]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 --exec-prefix=EPREFIX path prefix for architecture-dependent files
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 [PREFIX]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 --bindir=DIR user executables [EPREFIX/bin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76 --sbindir=DIR system admin executables [EPREFIX/sbin]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 --libexecdir=DIR program executables [EPREFIX/libexec]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78 --sysconfdir=DIR system configuration files [PREFIX/etc]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
79 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
80 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
81 --libdir=DIR object code libraries [EPREFIX/lib]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82 --includedir=DIR C header files [PREFIX/include]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
83 --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
84 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
85 --infodir=DIR info documentation [DATAROOTDIR/info]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 --mandir=DIR man documentation [DATAROOTDIR/man]
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88 #if( $options.size() > 0 )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 Options:
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
90 --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
91 --release add extra compile flags for release builds
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 #foreach( $opt in $options )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93 --${opt.getArgument()}=${opt.getValuesString()}
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97 #if( $features.size() > 0 )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 Optional Features:
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99 #foreach( $feature in $features )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 #if( $feature.default )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101 --disable-${feature.arg}
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 #else
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103 --enable-${feature.arg}
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105 #end
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 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 __EOF__
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111 #
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
112 # parse arguments
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113 #
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
114 BUILD_TYPE="default"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115 #set( $D = '$' )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
116 for ARG in "$@"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117 do
16
4fac0e25ee04 improve posix shell compatibility
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 15
diff changeset
118 case "$ARG" in
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
119 "--prefix="*) PREFIX=${D}{ARG#--prefix=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
120 "--exec-prefix="*) EPREFIX=${D}{ARG#--exec-prefix=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
121 "--bindir="*) BINDIR=${D}{ARG#----bindir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
122 "--sbindir="*) SBINDIR=${D}{ARG#--sbindir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
123 "--libdir="*) LIBDIR=${D}{ARG#--libdir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
124 "--libexecdir="*) LIBEXECDIR=${D}{ARG#--libexecdir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
125 "--datadir="*) DATADIR=${D}{ARG#--datadir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
126 "--sysconfdir="*) SYSCONFDIR=${D}{ARG#--sysconfdir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
127 "--sharedstatedir="*) SHAREDSTATEDIR=${D}{ARG#--sharedstatedir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
128 "--localstatedir="*) LOCALSTATEDIR=${D}{ARG#--localstatedir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
129 "--includedir="*) INCLUDEDIR=${D}{ARG#--includedir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
130 "--infodir="*) INFODIR=${D}{ARG#--infodir=} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
131 "--mandir"*) MANDIR=${D}{ARG#--mandir} ;;
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
132 "--help"*) printhelp; abort_configure ;;
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
133 "--debug") BUILD_TYPE="debug" ;;
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
134 "--release") BUILD_TYPE="release" ;;
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
135 #foreach( $opt in $options )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
136 "--${opt.getArgument()}="*) ${opt.getVarName()}=${D}{ARG#--${opt.getArgument()}=} ;;
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
138 #foreach( $feature in $features )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
139 "--enable-${feature.arg}") ${feature.getVarName()}=on ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
140 "--disable-${feature.arg}") unset ${feature.getVarName()} ;;
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
141 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
142 "-"*) echo "unknown option: $ARG"; abort_configure ;;
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
143 esac
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
146 ## Begin unparsed content. **
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
147 #[[
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 # set dir variables
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
149 BINDIR=${BINDIR:-"$EPREFIX/bin"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
150 SBINDIR=${SBINDIR:-"$EPREFIX/sbin"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
151 LIBDIR=${LIBDIR:-"$EPREFIX/lib"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
152 LIBEXECDIR=${LIBEXECDIR:-"$EPREFIX/libexec"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
153 DATADIR=${DATADIR:-"$PREFIX/share"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
154 SYSCONFDIR=${SYSCONFDIR:-"$PREFIX/etc"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
155 SHAREDSTATEDIR=${SHAREDSTATEDIR:-"$PREFIX/com"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
156 LOCALSTATEDIR=${LOCALSTATEDIR:-"$PREFIX/var"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
157 INCLUDEDIR=${INCLUDEDIR:-"$PREFIX/include"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
158 INFODIR=${INFODIR:-"$PREFIX/info"}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
159 MANDIR=${MANDIR:-"$PREFIX/man"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
160
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
161 # 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
162 PKG_CONFIG=`command -v pkg-config`
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
163 PKG_CONFIG=${PKG_CONFIG:-"false"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165 # Simple uname based platform detection
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 # $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
167 OS=`uname -s`
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
168 OS_VERSION=`uname -r`
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 printf "detect platform... "
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
170 if [ "$OS" = "SunOS" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 PLATFORM="solaris sunos unix svr4"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
173 if [ "$OS" = "Linux" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
174 PLATFORM="linux unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
175 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
176 if [ "$OS" = "FreeBSD" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
177 PLATFORM="freebsd bsd unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
179 if [ "$OS" = "Darwin" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 PLATFORM="macos osx bsd unix"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
182 if echo "$OS" | grep -i "MINGW" > /dev/null; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183 PLATFORM="windows mingw"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 fi
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
185 PLATFORM=${PLATFORM:-"unix"}
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
187 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
188 echo "$PLATFORM_NAME"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 isplatform()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191 {
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 for p in $PLATFORM
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193 do
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
194 if [ "$p" = "$1" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195 return 0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 return 1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199 }
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
200 ]]#
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
201 ## End of unparsed content **
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
203 # generate config.mk
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
204 cat > "$TEMP_DIR/vars.mk" << __EOF__
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
205 PREFIX=$PREFIX
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
206 EPREFIX=$EPREFIX
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
207 BINDIR=$BINDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
208 SBINDIR=$SBINDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
209 LIBDIR=$LIBDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
210 LIBEXECDIR=$LIBEXECDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
211 DATADIR=$DATADIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
212 SYSCONFDIR=$SYSCONFDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
213 SHAREDSTATEDIR=$SHAREDSTATEDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
214 LOCALSTATEDIR=$LOCALSTATEDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
215 INCLUDEDIR=$INCLUDEDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
216 INFODIR=$INFODIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
217 MANDIR=$MANDIR
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
218 #foreach( $var in $vars )
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
219 ${var.varName}=$${var.varName}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
220 #end
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
221 __EOF__
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
222 cat > "$TEMP_DIR/config.mk" << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 # config.mk generated by configure
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225 #
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
226 __EOF__
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
227 sort -u "$TEMP_DIR/vars.mk" >> "$TEMP_DIR/config.mk"
7
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
228
686991ae6e2f add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 6
diff changeset
229
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
230 # toolchain detection
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231 # this will insert make vars to config.mk
13
cdf8bf4549c4 fix compiler flag generation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 12
diff changeset
232 . make/toolchain.sh
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
233 if [ -n "$TOOLCHAIN_ERROR" ]; then
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
234 echo "Toolchain error: $TOOLCHAIN_ERROR"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
235 echo "Abort."
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
236 abort_configure
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
238
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 # DEPENDENCIES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
242
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
243 # 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
244 echo > "$TEMP_DIR/make.mk"
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
245
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
246 #foreach( $dependency in $namedDependencies )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
247 dependency_${dependency.name}()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
248 {
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
249 printf "checking for ${dependency.name}... "
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
250 #foreach( $sub in $dependency.getSubdependencies() )
39
3ca85da78515 add RegressionTest - fixes #264
Mike Becker <universe@uap-core.de>
parents: 37
diff changeset
251 # dependency $sub.getFullName()
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
252 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
253 do
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
254 #if( $sub.platform )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
255 if failed isplatform "${sub.platform}"; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
258 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
259 #foreach( $np in $sub.getNotList() )
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
260 if isplatform "${np}"; then
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
261 break
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
262 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
263 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 #if( $sub.pkgconfig.size() > 0 )
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
265 if [ -z "$PKG_CONFIG" ]; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
266 break
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 #end
33
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
269 #foreach( $test in $sub.tests )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
270 if failed $test > /dev/null ; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
271 break
33
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
272 fi
b77d51b3c9bb dependency tests executed too late - fixes #282
Mike Becker <universe@uap-core.de>
parents: 32
diff changeset
273 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274 #foreach( $pkg in $sub.pkgconfig )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
275 if failed $pkg.getPkgConfigTestQuery() ; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277 fi
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
278 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
279 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281 #foreach( $flags in $sub.flags )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 #if( $flags.exec )
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
283 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
284 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285 else
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
288 #else
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
289 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
290 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
292 #if ( $sub.make.length() > 0 )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
293 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
294 # Dependency: $dependency.name
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
295 $sub.make
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
296 __EOF__
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
297 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
298 echo yes
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299 return 0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300 done
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
301
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
302 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
303 echo no
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
304 return 1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
307
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
308 DEPENDENCIES_FAILED=
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
309 ERROR=0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
310 #if( $dependencies.size() > 0 )
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
311 # 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
312 TEMP_CFLAGS=
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
313 TEMP_LDFLAGS=
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314 #foreach( $dependency in $dependencies )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316 do
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
317 #if( $dependency.platform )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
318 if failed isplatform "${dependency.platform}"; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
321 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
322 #foreach( $np in $dependency.getNotList() )
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
323 if isplatform "${np}"; then
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
324 break
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
325 fi
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
326 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327 while true
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
328 do
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
329 #if( $dependency.pkgconfig.size() > 0 )
9
ebdecbbb2f79 fix incompatibility with some unix systems
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 7
diff changeset
330 if [ -z "$PKG_CONFIG" ]; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
332 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
333 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
334 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
335 #foreach( $pkg in $dependency.pkgconfig )
41
75ee588d5d9e some more code cleanup
Mike Becker <universe@uap-core.de>
parents: 40
diff changeset
336 printf "checking for pkg-config package $pkg.name... "
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
337 if failed $pkg.getPkgConfigTestQuery() ; then
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
338 echo no
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
339 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
340 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
341 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
342 echo yes
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
343 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags $pkg.name`"
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
344 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs $pkg.name`"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
345 #end
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
346
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
347 #foreach( $flags in $dependency.flags )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
348 #if( $flags.exec )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
349 $flags.value > /dev/null
53
704368f1bb23 revert command substitution syntax change (relates to #283)
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 52
diff changeset
350 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
351 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
352 else
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
353 ERROR=1
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
354 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
355 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356 #else
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
357 TEMP_$flags.varName="$TEMP_$flags.varName $flags.value"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
358 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
359 #end
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
360 #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
361 cat >> "$TEMP_DIR/make.mk" << __EOF__
6
d4363f69fd97 fix unnamed dependency make code template
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 3
diff changeset
362 $dependency.make
2
14a4b7f0bc74 add element for adding make code for dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
363 __EOF__
3
9d60baefa4ed add option for excluding dependencies on specific platforms
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 2
diff changeset
364 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
365 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
366 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
367 break
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
368 done
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
369 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
371 # add unnamed dependency flags to config.mk
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
372 echo >> "$TEMP_DIR/config.mk"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
373 if [ -n "${TEMP_CFLAGS}" ]; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
374 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
376 if [ -n "${TEMP_LDFLAGS}" ]; then
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
377 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
0
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
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 # OPTION VALUES
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
383 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384 #foreach( $opt in $options )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
385 #foreach( $val in $opt.values )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
386 ${val.func}()
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
387 {
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
388 VERR=0
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
389 #foreach( $dep in $val.dependencies )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
390 if failed dependency_$dep ; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
391 VERR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
392 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
393 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
394 if [ $VERR -ne 0 ]; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
395 return 1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
396 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
397 #foreach( $def in $val.defines )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
398 TEMP_CFLAGS="$TEMP_CFLAGS ${def.toFlags()}"
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
399 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
400 #if( $val.hasMake() )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
401 cat >> "$TEMP_DIR/make.mk" << __EOF__
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
402 $val.make
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
403 __EOF__
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
404 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
405 return 0
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
406 }
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
407 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
408 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
409
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
410 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
411 # TARGETS
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
412 #
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
413
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
414 #foreach( $target in $targets )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
415 #if ( $target.name )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
416 # Target: $target.name
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 # Target
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
419 #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
420 TEMP_CFLAGS=
d4c38bb71fa0 don't use cflags/ldflags directly in the configure script - fixes #281
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 19
diff changeset
421 TEMP_LDFLAGS=
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
422
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
423 #foreach( $dependency in $target.dependencies )
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
424 if failed dependency_$dependency; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
425 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
426 ERROR=1
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
427 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
428 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
429
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
430 # Features
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
431 #foreach( $feature in $target.features )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
432 if [ -n "$${feature.getVarName()}" ]; then
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
433 #foreach( $dependency in $feature.dependencies )
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
434 # check dependency
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
435 if failed dependency_$dependency ; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
436 # "auto" features can fail and are just disabled in this case
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
437 if [ "$${feature.getVarName()}" = "auto" ]; then
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
438 unset ${feature.getVarName()}
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
439 else
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
440 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED ${dependency} "
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
441 ERROR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
442 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
443 fi
14
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
444 #end
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
445 fi
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
446 #end
87fea7ab27de implement optional (feature) dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 13
diff changeset
447
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
448 #foreach( $opt in $target.options )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
449 # Option: --${opt.argument}
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
450 if [ -z ${D}${opt.getVarName()} ]; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
451 SAVED_ERROR="$ERROR"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
452 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
453 ERROR=1
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
454 while true
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
455 do
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
456 #foreach( $optdef in $opt.defaults )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
457 #if( $optdef.platform )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
458 if isplatform "$optdef.platform"; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
459 #end
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
460 if $optdef.func ; then
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
461 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
462 ERROR=0
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
463 break
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 #if( $optdef.platform )
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
466 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
467 #end
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 break
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
470 done
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
471 if [ $ERROR -ne 0 ]; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
472 SAVED_ERROR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
473 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
474 ERROR="$SAVED_ERROR"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
475 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
476 else
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
477 if false; then
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
478 false
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
479 #foreach( $optval in $opt.values )
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
480 elif [ "${D}${opt.getVarName()}" = "${optval.value}" ]; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
481 echo " ${opt.argument}: ${D}${opt.getVarName()}" >> $TEMP_DIR/options
54
2b8f40c58944 make configure script svr4 compatible again
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 53
diff changeset
482 if failed $optval.func ; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
483 ERROR=1
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
484 fi
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
485 #end
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
486 fi
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
487 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
488 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
489
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
490 echo >> "$TEMP_DIR/config.mk"
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
491 if [ -n "${TEMP_CFLAGS}" ]; then
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
492 echo "${target.getCFlags()} += $TEMP_CFLAGS" >> "$TEMP_DIR/config.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
493 fi
51
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
494 if [ "$BUILD_TYPE" = "debug" ]; then
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
495 echo '${target.getCFlags()} += ${DEBUG_FLAGS}' >> "$TEMP_DIR/config.mk"
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
496 fi
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
497 if [ "$BUILD_TYPE" = "release" ]; then
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
498 echo '${target.getCFlags()} += ${RELEASE_FLAGS}' >> "$TEMP_DIR/config.mk"
5c12e9e29733 add debug/release options - fixes #285
Mike Becker <universe@uap-core.de>
parents: 47
diff changeset
499 fi
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
500 if [ -n "${TEMP_LDFLAGS}" ]; then
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
501 echo "${target.getLDFlags()} += $TEMP_LDFLAGS" >> "$TEMP_DIR/config.mk"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
502 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
503
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
504 #end
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
505 if [ $ERROR -ne 0 ]; then
32
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
506 echo
c3132f7f19da fix mix of spaces and tabs
Mike Becker <universe@uap-core.de>
parents: 30
diff changeset
507 echo "Error: Unresolved dependencies"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
508 echo "$DEPENDENCIES_FAILED"
52
afcb57893858 major evolution of configure template - fixes #283
Mike Becker <universe@uap-core.de>
parents: 51
diff changeset
509 abort_configure
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
510 fi
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
511
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
512 echo "configure finished"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
513 echo
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
514 echo "Build Config:"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
515 echo " PREFIX: $PREFIX"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
516 echo " TOOLCHAIN: $TOOLCHAIN_NAME"
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
517 #if ( $options.size() > 0 )
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
518 echo "Options:"
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
519 cat "$TEMP_DIR/options"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
520 #end
47
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
521 #if ( $features.size() > 0 )
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
522 echo "Features:"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
523 #foreach( $feature in $features )
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
524 if [ -n "$${feature.getVarName()}" ]; then
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
525 echo " $feature.name: on"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
526 else
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
527 echo " $feature.name: off"
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
528 fi
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
529 #end
78ee95836412 automatically disable default-features if dependencies fail
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 46
diff changeset
530 #end
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
531 echo
34
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
532 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/make.mk" > config.mk
4486849e6a6c fixes several minor potential issues in configure script
Mike Becker <universe@uap-core.de>
parents: 33
diff changeset
533 rm -Rf "$TEMP_DIR"
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
534
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
535

mercurial