configure

changeset 815
b0c4750cecd8
parent 796
fec90b848f4b
child 821
5e6f15005efd
equal deleted inserted replaced
814:5f9e07d3dd6c 815:b0c4750cecd8
161 OS=`uname -s` 161 OS=`uname -s`
162 OS_VERSION=`uname -r` 162 OS_VERSION=`uname -r`
163 printf "detect platform... " 163 printf "detect platform... "
164 if [ "$OS" = "SunOS" ]; then 164 if [ "$OS" = "SunOS" ]; then
165 PLATFORM="solaris sunos unix svr4" 165 PLATFORM="solaris sunos unix svr4"
166 fi 166 elif [ "$OS" = "Linux" ]; then
167 if [ "$OS" = "Linux" ]; then
168 PLATFORM="linux unix" 167 PLATFORM="linux unix"
169 fi 168 elif [ "$OS" = "FreeBSD" ]; then
170 if [ "$OS" = "FreeBSD" ]; then
171 PLATFORM="freebsd bsd unix" 169 PLATFORM="freebsd bsd unix"
172 fi 170 elif [ "$OS" = "OpenBSD" ]; then
173 if [ "$OS" = "Darwin" ]; then 171 PLATFORM="openbsd bsd unix"
172 elif [ "$OS" = "NetBSD" ]; then
173 PLATFORM="netbsd bsd unix"
174 elif [ "$OS" = "Darwin" ]; then
174 PLATFORM="macos osx bsd unix" 175 PLATFORM="macos osx bsd unix"
175 fi 176 elif echo "$OS" | grep -i "MINGW" > /dev/null; then
176 if echo "$OS" | grep -i "MINGW" > /dev/null; then
177 PLATFORM="windows mingw" 177 PLATFORM="windows mingw"
178 fi 178 fi
179 : ${PLATFORM:="unix"} 179 : ${PLATFORM:="unix"}
180 180
181 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -` 181 PLATFORM_NAME=`echo "$PLATFORM" | cut -f1 -d' ' -`
194 notisplatform() 194 notisplatform()
195 { 195 {
196 for p in $PLATFORM 196 for p in $PLATFORM
197 do 197 do
198 if [ "$p" = "$1" ]; then 198 if [ "$p" = "$1" ]; then
199 return 1
200 fi
201 done
202 return 0
203 }
204 istoolchain()
205 {
206 for t in $TOOLCHAIN
207 do
208 if [ "$t" = "$1" ]; then
209 return 0
210 fi
211 done
212 return 1
213 }
214 notistoolchain()
215 {
216 for t in $TOOLCHAIN
217 do
218 if [ "$t" = "$1" ]; then
199 return 1 219 return 1
200 fi 220 fi
201 done 221 done
202 return 0 222 return 0
203 } 223 }
265 } 285 }
266 286
267 dependency_error_coverage() 287 dependency_error_coverage()
268 { 288 {
269 print_check_msg "$dep_checked_coverage" "checking for coverage... " 289 print_check_msg "$dep_checked_coverage" "checking for coverage... "
270 # dependency coverage 290 # dependency coverage toolchain="gnuc"
271 while true 291 while true
272 do 292 do
293 if notistoolchain "gnuc"; then
294 break
295 fi
273 TEMP_CFLAGS="$TEMP_CFLAGS \${COVERAGE_CFLAGS}" 296 TEMP_CFLAGS="$TEMP_CFLAGS \${COVERAGE_CFLAGS}"
274 TEMP_LDFLAGS="$TEMP_LDFLAGS \${COVERAGE_LDFLAGS}" 297 TEMP_LDFLAGS="$TEMP_LDFLAGS \${COVERAGE_LDFLAGS}"
275 print_check_msg "$dep_checked_coverage" "yes\n" 298 print_check_msg "$dep_checked_coverage" "yes\n"
276 dep_checked_coverage=1 299 dep_checked_coverage=1
277 return 1 300 return 1
451 break 474 break
452 done 475 done
453 476
454 # add general dependency flags to flags.mk 477 # add general dependency flags to flags.mk
455 echo "# general flags" >> "$TEMP_DIR/flags.mk" 478 echo "# general flags" >> "$TEMP_DIR/flags.mk"
456 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then 479 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
457 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" 480 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
458 fi 481 fi
459 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then 482 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
460 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" 483 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
461 fi 484 fi
462 if [ -n "${TEMP_LDFLAGS}" ]; then 485 if [ -n "${TEMP_LDFLAGS}" ]; then
463 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" 486 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk"
464 fi 487 fi
637 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED" 660 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED"
638 fi 661 fi
639 fi 662 fi
640 fi 663 fi
641 664
642 if [ -n "${TEMP_CFLAGS}" -a -n "$lang_c" ]; then 665 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then
643 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" 666 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk"
644 fi 667 fi
645 if [ -n "${TEMP_CXXFLAGS}" -a -n "$lang_cpp" ]; then 668 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then
646 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" 669 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk"
647 fi 670 fi
648 if [ "$BUILD_TYPE" = "debug" ]; then 671 if [ "$BUILD_TYPE" = "debug" ]; then
649 if [ -n "$lang_c" ]; then 672 if [ -n "$lang_c" ]; then
650 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" 673 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk"
697 720
698 __EOF__ 721 __EOF__
699 write_toolchain_defaults "$TEMP_DIR/toolchain.mk" 722 write_toolchain_defaults "$TEMP_DIR/toolchain.mk"
700 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk 723 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk
701 rm -Rf "$TEMP_DIR" 724 rm -Rf "$TEMP_DIR"
702
703
704

mercurial