make/configure.vm

Fri, 06 Oct 2023 21:21:10 +0200

author
Mike Becker <universe@uap-core.de>
date
Fri, 06 Oct 2023 21:21:10 +0200
changeset 0
593b60458157
child 1
e3113d4e2fc0
permissions
-rw-r--r--

initial commit

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

mercurial