make/configure.vm

Sun, 22 Sep 2024 21:17:15 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 22 Sep 2024 21:17:15 +0200
branch
newapi
changeset 307
301d6c73087a
parent 277
5099a34747c4
permissions
-rw-r--r--

make headerbar buttons flat (GTK)

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

mercurial