make/configure.vm

changeset 815
b0c4750cecd8
parent 796
fec90b848f4b
child 821
5e6f15005efd
equal deleted inserted replaced
814:5f9e07d3dd6c 815:b0c4750cecd8
91 91
92 #end 92 #end
93 #if( $features.size() > 0 ) 93 #if( $features.size() > 0 )
94 Optional Features: 94 Optional Features:
95 #foreach( $feature in $features ) 95 #foreach( $feature in $features )
96 #if( $feature.auto ) 96 ${feature.helpText}
97 --disable-${feature.arg}
98 #else
99 --enable-${feature.arg}
100 #end
101 #end 97 #end
102 98
103 #end 99 #end
104 __EOF__ 100 __EOF__
105 } 101 }
188 OS=`uname -s` 184 OS=`uname -s`
189 OS_VERSION=`uname -r` 185 OS_VERSION=`uname -r`
190 printf "detect platform... " 186 printf "detect platform... "
191 if [ "$OS" = "SunOS" ]; then 187 if [ "$OS" = "SunOS" ]; then
192 PLATFORM="solaris sunos unix svr4" 188 PLATFORM="solaris sunos unix svr4"
193 fi 189 elif [ "$OS" = "Linux" ]; then
194 if [ "$OS" = "Linux" ]; then
195 PLATFORM="linux unix" 190 PLATFORM="linux unix"
196 fi 191 elif [ "$OS" = "FreeBSD" ]; then
197 if [ "$OS" = "FreeBSD" ]; then
198 PLATFORM="freebsd bsd unix" 192 PLATFORM="freebsd bsd unix"
199 fi 193 elif [ "$OS" = "OpenBSD" ]; then
200 if [ "$OS" = "Darwin" ]; then 194 PLATFORM="openbsd bsd unix"
195 elif [ "$OS" = "NetBSD" ]; then
196 PLATFORM="netbsd bsd unix"
197 elif [ "$OS" = "Darwin" ]; then
201 PLATFORM="macos osx bsd unix" 198 PLATFORM="macos osx bsd unix"
202 fi 199 elif echo "$OS" | grep -i "MINGW" > /dev/null; then
203 if echo "$OS" | grep -i "MINGW" > /dev/null; then
204 PLATFORM="windows mingw" 200 PLATFORM="windows mingw"
205 fi 201 fi
206 : ${PLATFORM:="unix"} 202 : ${PLATFORM:="unix"}
207 203
208 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` 204 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
221 notisplatform() 217 notisplatform()
222 { 218 {
223 for p in $PLATFORM 219 for p in $PLATFORM
224 do 220 do
225 if [ "$p" = "$1" ]; then 221 if [ "$p" = "$1" ]; then
222 return 1
223 fi
224 done
225 return 0
226 }
227 istoolchain()
228 {
229 for t in $TOOLCHAIN
230 do
231 if [ "$t" = "$1" ]; then
232 return 0
233 fi
234 done
235 return 1
236 }
237 notistoolchain()
238 {
239 for t in $TOOLCHAIN
240 do
241 if [ "$t" = "$1" ]; then
226 return 1 242 return 1
227 fi 243 fi
228 done 244 done
229 return 0 245 return 0
230 } 246 }
305 #if( $sub.platform ) 321 #if( $sub.platform )
306 if notisplatform "${sub.platform}"; then 322 if notisplatform "${sub.platform}"; then
307 break 323 break
308 fi 324 fi
309 #end 325 #end
326 #if( $sub.toolchain )
327 if notistoolchain "${sub.toolchain}"; then
328 break
329 fi
330 #end
310 #foreach( $np in $sub.notList ) 331 #foreach( $np in $sub.notList )
311 if isplatform "${np}"; then 332 if isplatform "${np}" || istoolchain "${np}"; then
312 break 333 break
313 fi 334 fi
314 #end 335 #end
315 #foreach( $lang in $sub.lang ) 336 #foreach( $lang in $sub.lang )
316 if [ -z "$lang_${lang}" ] ; then 337 if [ -z "$lang_${lang}" ] ; then
382 #if( $dependency.platform ) 403 #if( $dependency.platform )
383 if notisplatform "${dependency.platform}"; then 404 if notisplatform "${dependency.platform}"; then
384 break 405 break
385 fi 406 fi
386 #end 407 #end
408 #if( $dependency.toolchain )
409 if notistoolchain "${dependency.toolchain}"; then
410 break
411 fi
412 #end
387 #foreach( $np in $dependency.notList ) 413 #foreach( $np in $dependency.notList )
388 if isplatform "${np}"; then 414 if isplatform "${np}" || istoolchain "${np}"; then
389 break 415 break
390 fi 416 fi
391 #end 417 #end
392 while true 418 while true
393 do 419 do
442 done 468 done
443 #end 469 #end
444 470
445 # add general dependency flags to flags.mk 471 # add general dependency flags to flags.mk
446 echo "# general flags" >> "$TEMP_DIR/flags.mk" 472 echo "# general flags" >> "$TEMP_DIR/flags.mk"
447 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then 473 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
448 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" 474 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
449 fi 475 fi
450 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then 476 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
451 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" 477 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
452 fi 478 fi
453 if [ -n "${TEMP_LDFLAGS}" ]; then 479 if [ -n "${TEMP_LDFLAGS}" ]; then
454 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" 480 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
455 fi 481 fi
576 #end 602 #end
577 fi 603 fi
578 fi 604 fi
579 #end 605 #end
580 606
581 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then 607 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
582 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" 608 echo "${target.cFlags} += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
583 fi 609 fi
584 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then 610 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
585 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" 611 echo "${target.cxxFlags} += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
586 fi 612 fi
587 if [ "$BUILD_TYPE" = "debug" ]; then 613 if [ "$BUILD_TYPE" = "debug" ]; then
588 if [ -n "$lang_c" ]; then 614 if [ -n "$lang_c" ]; then
589 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" 615 echo '${target.cFlags} += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
643 669
644 __EOF__ 670 __EOF__
645 write_toolchain_defaults "$TEMP_DIR/toolchain.mk" 671 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
646 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk 672 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
647 rm -Rf "$TEMP_DIR" 673 rm -Rf "$TEMP_DIR"
648
649
650

mercurial