TMP_C="${TMPDIRx}/vpx-conf-$$-${RANDOM}.c"
TMP_O="${TMPDIRx}/vpx-conf-$$-${RANDOM}.o"
TMP_X="${TMPDIRx}/vpx-conf-$$-${RANDOM}.x"
+TMP_ASM="${TMPDIRx}/vpx-conf-$$-${RANDOM}.asm"
clean_temp_files() {
- rm -f ${TMP_C} ${TMP_H} ${TMP_O} ${TMP_X}
+ rm -f ${TMP_C} ${TMP_H} ${TMP_O} ${TMP_X} ${TMP_ASM}
}
#
add_ldflags "$@"
}
+check_asm_align() {
+ log check_asm_align "$@"
+ cat >${TMP_ASM} <<EOF
+section .rodata
+align 16
+EOF
+ log_file ${TMP_ASM}
+ check_cmd ${AS} ${ASFLAGS} -o ${TMP_O} ${TMP_ASM}
+ readelf -WS ${TMP_O} >${TMP_X}
+ log_file ${TMP_X}
+ if ! grep -q '\.rodata .* 16$' ${TMP_X}; then
+ die "${AS} ${ASFLAGS} does not support section alignment (nasm <=2.08?)"
+ fi
+}
+
write_common_config_banner() {
echo '# This file automatically generated by configure. Do not edit!' > config.mk
echo "TOOLCHAIN := ${toolchain}" >> config.mk
disable builtin_libc
alt_libc="${optval}"
;;
+ --as=*)
+ [ "${optval}" = yasm -o "${optval}" = nasm -o "${optval}" = auto ] \
+ || die "Must be yasm, nasm or auto: ${optval}"
+ alt_as="${optval}"
+ ;;
--prefix=*)
prefix="${optval}"
;;
--libdir=*)
libdir="${optval}"
;;
- --libc|--prefix|--libdir)
+ --libc|--as|--prefix|--libdir)
die "Option ${opt} requires argument"
;;
--help|-h) show_help
;;
esac
+ AS="${alt_as:-${AS:-auto}}"
case ${tgt_cc} in
icc*)
CC=${CC:-icc}
;;
esac
- AS=yasm
+ case "${AS}" in
+ auto|"")
+ which nasm >/dev/null 2>&1 && AS=nasm
+ which yasm >/dev/null 2>&1 && AS=yasm
+ [ "${AS}" = auto -o -z "${AS}" ] \
+ && die "Neither yasm nor nasm have been found"
+ ;;
+ esac
+ log_echo " using $AS"
+ [ "${AS##*/}" = nasm ] && add_asflags -Ox
AS_SFX=.asm
case ${tgt_os} in
win*)
;;
linux*|solaris*)
add_asflags -f elf${bits}
- enabled debug && add_asflags -g dwarf2
+ enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2
+ enabled debug && [ "${AS}" = nasm ] && add_asflags -g
+ [ "${AS##*/}" = nasm ] && check_asm_align
;;
darwin*)
add_asflags -f macho${bits}
# enabled icc && ! enabled pic && add_cflags -fno-pic -mdynamic-no-pic
enabled icc && ! enabled pic && add_cflags -fno-pic
;;
- *) log "Warning: Unknown os $tgt_os while setting up yasm flags"
+ *) log "Warning: Unknown os $tgt_os while setting up $AS flags"
;;
esac
;;
${toggle_libs} don't build libraries
${toggle_examples} don't build examples
--libc=PATH path to alternate libc
+ --as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
${toggle_fast_unaligned} don't use unaligned accesses, even when
supported by hardware [auto]
${toggle_codec_srcs} in/exclude codec library source code
libs
examples
libc
+ as
fast_unaligned
codec_srcs
debug_libs