diff options
Diffstat (limited to 'build/make/configure.sh')
-rwxr-xr-x | build/make/configure.sh | 56 |
1 files changed, 42 insertions, 14 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh index d25d6400e..a48fd9faf 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -78,11 +78,12 @@ Build options: --log=yes|no|FILE file configure log is written to [config.err] --target=TARGET target platform tuple [generic-gnu] --cpu=CPU optimize for a specific cpu rather than a family + --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS] ${toggle_extra_warnings} emit harmless warnings (always non-fatal) ${toggle_werror} treat warnings as errors, if possible (not available with all compilers) ${toggle_optimizations} turn on/off compiler optimization flags - ${toggle_pic} turn on/off Position Independant Code + ${toggle_pic} turn on/off Position Independent Code ${toggle_ccache} turn on/off compiler cache ${toggle_debug} enable/disable debug mode ${toggle_gprof} enable/disable gprof profiling instrumentation @@ -442,6 +443,9 @@ process_common_cmdline() { ;; --cpu=*) tune_cpu="$optval" ;; + --extra-cflags=*) + extra_cflags="${optval}" + ;; --enable-?*|--disable-?*) eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` echo "${CMDLINE_SELECT} ${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null || die_unknown $opt @@ -547,6 +551,10 @@ process_common_toolchain() { tgt_isa=universal tgt_os=darwin9 ;; + *darwin10*) + tgt_isa=x86_64 + tgt_os=darwin10 + ;; *mingw32*|*cygwin*) [ -z "$tgt_isa" ] && tgt_isa=x86 tgt_os=win32 @@ -606,10 +614,20 @@ process_common_toolchain() { add_ldflags "-isysroot /Developer/SDKs/MacOSX10.5.sdk" add_ldflags "-mmacosx-version-min=10.5" ;; + *-darwin10-*) + add_cflags "-isysroot /Developer/SDKs/MacOSX10.6.sdk" + add_cflags "-mmacosx-version-min=10.6" + add_ldflags "-isysroot /Developer/SDKs/MacOSX10.6.sdk" + add_ldflags "-mmacosx-version-min=10.6" + ;; esac # Handle Solaris variants. Solaris 10 needs -lposix4 case ${toolchain} in + sparc-solaris-*) + add_extralibs -lposix4 + add_cflags "-DMUST_BE_ALIGNED" + ;; *-solaris-*) add_extralibs -lposix4 ;; @@ -650,12 +668,12 @@ process_common_toolchain() { elif enabled armv7 then check_add_cflags -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-ftree-vectorize - check_add_asflags -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-march=armv7-a + check_add_asflags -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp #-march=armv7-a else check_add_cflags -march=${tgt_isa} check_add_asflags -march=${tgt_isa} fi - + enabled debug && add_asflags -g asm_conversion_cmd="${source_path}/build/make/ads2gas.pl" ;; rvct) @@ -680,16 +698,24 @@ process_common_toolchain() { arch_int=${tgt_isa##armv} arch_int=${arch_int%%te} check_add_asflags --pd "\"ARCHITECTURE SETA ${arch_int}\"" + enabled debug && add_asflags -g + add_cflags --gnu + add_cflags --enum_is_int + add_cflags --wchar32 ;; esac case ${tgt_os} in + none*) + disable multithread + disable os_support + ;; darwin*) SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer TOOLCHAIN_PATH=${SDK_PATH}/usr/bin CC=${TOOLCHAIN_PATH}/gcc AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin9-gcc-4.2.1 + LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-gcc-4.2.1 AS=${TOOLCHAIN_PATH}/as STRIP=${TOOLCHAIN_PATH}/strip NM=${TOOLCHAIN_PATH}/nm @@ -703,14 +729,14 @@ process_common_toolchain() { add_cflags -arch ${tgt_isa} add_ldflags -arch_only ${tgt_isa} - add_cflags "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk" + add_cflags "-isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk" # This should be overridable - alt_libc=${SDK_PATH}/SDKs/iPhoneOS3.1.sdk + alt_libc=${SDK_PATH}/SDKs/iPhoneOS4.2.sdk # Add the paths for the alternate libc # for d in usr/include usr/include/gcc/darwin/4.0/; do - for d in usr/include usr/include/gcc/darwin/4.0/ usr/lib/gcc/arm-apple-darwin9/4.0.1/include/; do + for d in usr/include usr/include/gcc/darwin/4.0/ usr/lib/gcc/arm-apple-darwin10/4.2.1/include/; do try_dir="${alt_libc}/${d}" [ -d "${try_dir}" ] && add_cflags -I"${try_dir}" done @@ -732,13 +758,9 @@ process_common_toolchain() { || die "Must supply --libc when targetting *-linux-rvct" # Set up compiler - add_cflags --gnu - add_cflags --enum_is_int add_cflags --library_interface=aeabi_glibc add_cflags --no_hide_all - add_cflags --wchar32 add_cflags --dwarf2 - add_cflags --gnu # Set up linker add_ldflags --sysv --no_startup --no_ref_cpp_init @@ -845,7 +867,7 @@ process_common_toolchain() { setup_gnu_toolchain add_cflags -use-msasm -use-asm add_ldflags -i-static - enabled x86_64 && add_cflags -ipo -no-prec-div -static -xSSE3 -axSSE3 + enabled x86_64 && add_cflags -ipo -no-prec-div -static -xSSE2 -axSSE2 enabled x86_64 && AR=xiar case ${tune_cpu} in atom*) @@ -880,7 +902,7 @@ process_common_toolchain() { case ${tgt_os} in win*) add_asflags -f win${bits} - enabled debug && add_asflags -g dwarf2 + enabled debug && add_asflags -g cv8 ;; linux*|solaris*) add_asflags -f elf${bits} @@ -935,7 +957,7 @@ process_common_toolchain() { enabled small && check_add_cflags -O2 || check_add_cflags -O3 fi - # Position Independant Code (PIC) support, for building relocatable + # Position Independent Code (PIC) support, for building relocatable # shared objects enabled gcc && enabled pic && check_add_cflags -fPIC @@ -962,6 +984,12 @@ EOF add_cflags -D_LARGEFILE_SOURCE add_cflags -D_FILE_OFFSET_BITS=64 fi + + # append any user defined extra cflags + if [ -n "${extra_cflags}" ] ; then + check_add_cflags ${extra_cflags} || \ + die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler" + fi } process_toolchain() { |