make/configure.vm

Tue, 09 Jan 2024 00:01:03 +0100

author
Mike Becker <universe@uap-core.de>
date
Tue, 09 Jan 2024 00:01:03 +0100
changeset 798
7644da6e2d35
parent 796
fec90b848f4b
child 815
b0c4750cecd8
permissions
-rw-r--r--

migrate low level linked list tests - relates to #342

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

mercurial