echo " --source-path=PATH path to source code [$source_path]"
echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
echo " --enable-cross-compile assume a cross-compiler is used"
+ echo " --sysroot=PATH root of cross-build tree"
+ echo " --sysinclude=PATH location of cross-build system headers"
echo " --target-os=OS compiler targets OS [$target_os]"
echo " --target-exec=CMD command to run executables on target"
echo " --target-path=DIR path to view of build directory on target"
logfile
nm
source_path
+ sysinclude
+ sysroot
target_exec
target_os
target_path
eac3_decoder_deps="gpl"
eac3_decoder_select="fft mdct"
eatgq_decoder_select="aandct"
+eatqi_decoder_select="aandct"
ffv1_decoder_select="golomb"
flac_decoder_select="golomb"
flac_encoder_select="golomb"
qdm2_decoder_select="fft mdct rdft"
rv10_encoder_select="aandct"
rv20_encoder_select="aandct"
+rv30_decoder_select="golomb"
+rv40_decoder_select="golomb"
shorten_decoder_select="golomb"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
# gcc stupidly only outputs the basename of targets with -MM, but we need the
# full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
# find source path
source_path="`dirname \"$0\"`"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
-set_default cc nm
+sysinclude_default="${sysroot}/usr/include"
+
+set_default cc nm sysinclude
enabled cross_compile || host_cc_default=$cc
set_default host_cc
fi
rm $TMPSH
+if $cc --version 2>/dev/null | grep -q '(GCC)'; then
+ cc_type=gcc
+elif $cc --version 2>/dev/null | grep -q Intel; then
+ cc_type=icc
+elif $cc -v 2>&1 | grep -q xlc; then
+ cc_type=xlc
+fi
+
+test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
+
+if test -n "$sysroot"; then
+ case "$cc_type" in
+ gcc)
+ add_cflags --sysroot="$sysroot"
+ add_ldflags --sysroot="$sysroot"
+ ;;
+ esac
+fi
+
# compiler sanity check
check_exec <<EOF
int main(void){ return 0; }
check_cflags -std=c99
case "$arch" in
- i386|i486|i586|i686|i86pc|BePC)
- arch="x86"
- subarch="x86_32"
- enable fast_unaligned
- ;;
- x86_64|amd64)
- arch="x86"
- subarch="x86_32"
- enable cmov
- enable fast_cmov
- enable fast_unaligned
- check_cc <<EOF && enable fast_64bit && subarch="x86_64"
- int test[sizeof(char*) - 7];
-EOF
- ;;
- arm|armv[4567]*l)
- arch="arm"
- ;;
alpha)
arch="alpha"
enable fast_64bit
check_cflags -mieee
;;
- "Power Macintosh"|ppc|powerpc)
- arch="ppc"
- enable fast_unaligned
+ arm|armv[4567]*l)
+ arch="arm"
;;
- ppc64)
- arch="ppc"
+ avr32)
+ ;;
+ bfin)
+ arch="bfin"
+ ;;
+ ia64)
+ arch="ia64"
enable fast_64bit
- enable fast_unaligned
+ ;;
+ m68k)
+ arch="m68k"
;;
mips|mipsel|IP*)
arch="mips"
arch="mips"
enable fast_64bit
;;
- sun4u|sparc64)
- arch="sparc"
- subarch="sparc64"
- enable fast_64bit
- ;;
- sparc)
- arch="sparc"
- ;;
- sh4|sh)
- arch="sh4"
- ;;
parisc|hppa)
arch="parisc"
;;
arch="parisc"
enable fast_64bit
;;
+ "Power Macintosh"|ppc|powerpc)
+ arch="ppc"
+ enable fast_unaligned
+ ;;
+ ppc64)
+ arch="ppc"
+ enable fast_64bit
+ enable fast_unaligned
+ ;;
s390|s390x)
arch="s390"
;;
- m68k)
- arch="m68k"
+ sh4|sh)
+ arch="sh4"
;;
- ia64)
- arch="ia64"
+ sparc)
+ arch="sparc"
+ ;;
+ sun4u|sparc64)
+ arch="sparc"
+ subarch="sparc64"
enable fast_64bit
;;
- bfin)
- arch="bfin"
+ i386|i486|i586|i686|i86pc|BePC)
+ arch="x86"
+ subarch="x86_32"
+ enable fast_unaligned
+ ;;
+ x86_64|amd64)
+ arch="x86"
+ subarch="x86_32"
+ enable cmov
+ enable fast_cmov
+ enable fast_unaligned
+ check_cc <<EOF && enable fast_64bit && subarch="x86_64"
+ int test[sizeof(char*) - 7];
+EOF
;;
*)
arch="unknown"
#Darwin CC versions
if test $target_os = darwin; then
- if $cc -v 2>&1 | grep -q xlc; then
+ if enabled xlc; then
add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto
else
add_cflags -pipe
check_cflags -Os # not all compilers support -Os
optimizations="small"
elif enabled optimizations; then
- if $cc -v 2>&1 | grep -q xlc; then
+ if enabled xlc; then
add_cflags -O5
add_ldflags -O5
else
check_cflags -fno-signed-zeros
# add some flags for Intel C Compiler
-if $cc --version 2> /dev/null | grep -q Intel; then
- # Just warnings, no remarks
- check_cflags -w1
- # -wd: Disable following warnings
- # 144, 167, 556: -Wno-pointer-sign
- # 10006: ignoring unknown option -fno-signed-zeros
- # 10156: ignoring option '-W'; no argument required
- check_cflags -wd144,167,556,10006,10156
- # 11030: Warning unknown option --as-needed
- # 10156: ignoring option '-export'; no argument required
- check_ldflags -wd10156,11030
- # Allow to compile with optimizations
- check_ldflags -march=$cpu
+if enabled icc; then
+ # Just warnings, no remarks
+ check_cflags -w1
+ # -wd: Disable following warnings
+ # 144, 167, 556: -Wno-pointer-sign
+ # 10006: ignoring unknown option -fno-signed-zeros
+ # 10156: ignoring option '-W'; no argument required
+ check_cflags -wd144,167,556,10006,10156
+ # 11030: Warning unknown option --as-needed
+ # 10156: ignoring option '-export'; no argument required
+ check_ldflags -wd10156,11030
+ # Allow to compile with optimizations
+ check_ldflags -march=$cpu
fi
# PIC flags for shared library objects where they are needed