Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 # | 2 # |
| 3 # FFmpeg configure script | 3 # FFmpeg configure script |
| 4 # | 4 # |
| 5 # Copyright (c) 2000-2002 Fabrice Bellard | 5 # Copyright (c) 2000-2002 Fabrice Bellard |
| 6 # Copyright (c) 2005-2008 Diego Biurrun | 6 # Copyright (c) 2005-2008 Diego Biurrun |
| 7 # Copyright (c) 2005-2008 Mans Rullgard | 7 # Copyright (c) 2005-2008 Mans Rullgard |
| 8 # | 8 # |
| 9 | 9 |
| 10 # Prevent locale nonsense from breaking basic text processing. | 10 # Prevent locale nonsense from breaking basic text processing. |
| (...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2145 cc_version=__VERSION__ | 2145 cc_version=__VERSION__ |
| 2146 gcc_version=$($cc --version | head -n1) | 2146 gcc_version=$($cc --version | head -n1) |
| 2147 gcc_basever=$($cc -dumpversion) | 2147 gcc_basever=$($cc -dumpversion) |
| 2148 gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)') | 2148 gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)') |
| 2149 gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)") | 2149 gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)") |
| 2150 cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver") | 2150 cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver") |
| 2151 if ! $cc -dumpversion | grep -q '^2\.'; then | 2151 if ! $cc -dumpversion | grep -q '^2\.'; then |
| 2152 CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' | 2152 CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' |
| 2153 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' | 2153 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' |
| 2154 fi | 2154 fi |
| 2155 speed_cflags='-O3' | 2155 speed_cflags='-O2' |
| 2156 size_cflags='-Os' | 2156 size_cflags='-Os' |
| 2157 elif $cc --version 2>/dev/null | grep -q Intel; then | 2157 elif $cc --version 2>/dev/null | grep -q Intel; then |
| 2158 cc_type=icc | 2158 cc_type=icc |
| 2159 cc_version="AV_STRINGIFY(__INTEL_COMPILER)" | 2159 cc_version="AV_STRINGIFY(__INTEL_COMPILER)" |
| 2160 cc_ident=$($cc --version | head -n1) | 2160 cc_ident=$($cc --version | head -n1) |
| 2161 icc_version=$($cc -dumpversion) | 2161 icc_version=$($cc -dumpversion) |
| 2162 CC_DEPFLAGS='-MMD' | 2162 CC_DEPFLAGS='-MMD' |
| 2163 AS_DEPFLAGS='-MMD' | 2163 AS_DEPFLAGS='-MMD' |
| 2164 speed_cflags='-O3' | 2164 speed_cflags='-O3' |
| 2165 size_cflags='-Os' | 2165 size_cflags='-Os' |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2298 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' | 2298 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' |
| 2299 speed_cflags='-O2' | 2299 speed_cflags='-O2' |
| 2300 size_cflags='-Os' | 2300 size_cflags='-Os' |
| 2301 filter_cflags='filter_out -Wdisabled-optimization' | 2301 filter_cflags='filter_out -Wdisabled-optimization' |
| 2302 elif $cc -v 2>&1 | grep -q Open64; then | 2302 elif $cc -v 2>&1 | grep -q Open64; then |
| 2303 cc_type=open64 | 2303 cc_type=open64 |
| 2304 cc_version=__OPEN64__ | 2304 cc_version=__OPEN64__ |
| 2305 cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) | 2305 cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :) |
| 2306 CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' | 2306 CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' |
| 2307 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' | 2307 AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@' |
| 2308 # O2 produces smaller/faster code on P4 and same performance on Core/Atom. | |
|
scherkus (not reviewing)
2012/02/06 17:46:29
this might be doable via configure script and buil
DaleCurtis
2012/02/06 18:59:01
Sounds right, I can specify --extra-cflags=-O2 and
scherkus (not reviewing)
2012/02/06 19:42:58
another sanity check: does the -O2 we specify here
DaleCurtis
2012/02/07 03:18:01
Yes, we're using -O2 inside the gyp.
| |
| 2308 speed_cflags='-O2' | 2309 speed_cflags='-O2' |
| 2309 size_cflags='-Os' | 2310 size_cflags='-Os' |
| 2310 filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed- zeros' | 2311 filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed- zeros' |
| 2311 fi | 2312 fi |
| 2312 | 2313 |
| 2313 test -n "$cc_type" && enable $cc_type || | 2314 test -n "$cc_type" && enable $cc_type || |
| 2314 warn "Unknown C compiler $cc, unable to select optimal CFLAGS" | 2315 warn "Unknown C compiler $cc, unable to select optimal CFLAGS" |
| 2315 | 2316 |
| 2316 : ${as_default:=$cc} | 2317 : ${as_default:=$cc} |
| 2317 : ${dep_cc_default:=$cc} | 2318 : ${dep_cc_default:=$cc} |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3091 if check_func pthread_create; then | 3092 if check_func pthread_create; then |
| 3092 : | 3093 : |
| 3093 elif check_func pthread_create -pthread; then | 3094 elif check_func pthread_create -pthread; then |
| 3094 add_cflags -pthread | 3095 add_cflags -pthread |
| 3095 add_extralibs -pthread | 3096 add_extralibs -pthread |
| 3096 elif check_func pthread_create -pthreads; then | 3097 elif check_func pthread_create -pthreads; then |
| 3097 add_cflags -pthreads | 3098 add_cflags -pthreads |
| 3098 add_extralibs -pthreads | 3099 add_extralibs -pthreads |
| 3099 elif check_func pthread_create -lpthreadGC2; then | 3100 elif check_func pthread_create -lpthreadGC2; then |
| 3100 add_extralibs -lpthreadGC2 | 3101 add_extralibs -lpthreadGC2 |
| 3102 # static pthreads improves startup time | |
| 3103 elif check_func pthread_create -lpthreadGC2 -lws2_32; then | |
| 3104 add_cflags -DPTW32_STATIC_LIB | |
| 3105 add_extralibs -lpthreadGC2 -lws2_32 | |
|
scherkus (not reviewing)
2012/02/06 17:46:29
this might be doable via configure script and buil
DaleCurtis
2012/02/06 18:59:01
Again, looks right. Here these would just be speci
| |
| 3101 elif ! check_lib pthread.h pthread_create -lpthread; then | 3106 elif ! check_lib pthread.h pthread_create -lpthread; then |
| 3102 disable pthreads | 3107 disable pthreads |
| 3103 fi | 3108 fi |
| 3104 fi | 3109 fi |
| 3105 | 3110 |
| 3106 for thread in $THREADS_LIST; do | 3111 for thread in $THREADS_LIST; do |
| 3107 if enabled $thread; then | 3112 if enabled $thread; then |
| 3108 test -n "$thread_type" && | 3113 test -n "$thread_type" && |
| 3109 die "ERROR: Only one thread type must be selected." || | 3114 die "ERROR: Only one thread type must be selected." || |
| 3110 thread_type="$thread" | 3115 thread_type="$thread" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3373 # disable some annoying warnings | 3378 # disable some annoying warnings |
| 3374 add_cflags -msg_disable cvtu32to64 | 3379 add_cflags -msg_disable cvtu32to64 |
| 3375 add_cflags -msg_disable embedcomment | 3380 add_cflags -msg_disable embedcomment |
| 3376 add_cflags -msg_disable needconstext | 3381 add_cflags -msg_disable needconstext |
| 3377 add_cflags -msg_disable nomainieee | 3382 add_cflags -msg_disable nomainieee |
| 3378 add_cflags -msg_disable ptrmismatch1 | 3383 add_cflags -msg_disable ptrmismatch1 |
| 3379 add_cflags -msg_disable unreachcode | 3384 add_cflags -msg_disable unreachcode |
| 3380 elif enabled gcc; then | 3385 elif enabled gcc; then |
| 3381 check_cflags -fno-tree-vectorize | 3386 check_cflags -fno-tree-vectorize |
| 3382 check_cflags -Werror=implicit-function-declaration | 3387 check_cflags -Werror=implicit-function-declaration |
| 3383 check_cflags -Werror=missing-prototypes | 3388 # Removed to allow msys gcc 4.2.1-sjlj to compile |
| 3389 # check_cflags -Werror=missing-prototypes | |
|
scherkus (not reviewing)
2012/02/06 17:46:29
we should see whether this is still valid w/ our c
DaleCurtis
2012/02/06 18:59:01
Will do, we're up to 4.5.0 on the current toolchai
| |
| 3384 elif enabled llvm_gcc; then | 3390 elif enabled llvm_gcc; then |
| 3385 check_cflags -mllvm -stack-alignment=16 | 3391 check_cflags -mllvm -stack-alignment=16 |
| 3386 elif enabled clang; then | 3392 elif enabled clang; then |
| 3387 check_cflags -mllvm -stack-alignment=16 | 3393 check_cflags -mllvm -stack-alignment=16 |
| 3388 check_cflags -Qunused-arguments | 3394 check_cflags -Qunused-arguments |
| 3389 elif enabled armcc; then | 3395 elif enabled armcc; then |
| 3390 # 2523: use of inline assembler is deprecated | 3396 # 2523: use of inline assembler is deprecated |
| 3391 add_cflags -W${armcc_opt},--diag_suppress=2523 | 3397 add_cflags -W${armcc_opt},--diag_suppress=2523 |
| 3392 add_cflags -W${armcc_opt},--diag_suppress=1207 | 3398 add_cflags -W${armcc_opt},--diag_suppress=1207 |
| 3393 add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition | 3399 add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3774 } | 3780 } |
| 3775 | 3781 |
| 3776 pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIB M" | 3782 pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIB M" |
| 3777 pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$ext ralibs" "libavutil = $LIBAVUTIL_VERSION" | 3783 pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$ext ralibs" "libavutil = $LIBAVUTIL_VERSION" |
| 3778 pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_V ERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" | 3784 pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_V ERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION" |
| 3779 pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VE RSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" | 3785 pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VE RSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" |
| 3780 pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VE RSION" "$extralibs" | 3786 pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VE RSION" "$extralibs" |
| 3781 pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VER SION" "" "libavutil = $LIBAVUTIL_VERSION" | 3787 pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VER SION" "" "libavutil = $LIBAVUTIL_VERSION" |
| 3782 pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERS ION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" | 3788 pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERS ION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" |
| 3783 pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPL E_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" | 3789 pkgconfig_generate libswresample "FFmpeg audio rescaling library" "$LIBSWRESAMPL E_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION" |
| OLD | NEW |