]> granicus.if.org Git - libvpx/blob - configure
Merge "partial_idct_test: add _add_ test"
[libvpx] / configure
1 #!/bin/sh
2 ##
3 ##  configure
4 ##
5 ##  This script is the front-end to the build system. It provides a similar
6 ##  interface to standard configure scripts with some extra bits for dealing
7 ##  with toolchains that differ from the standard POSIX interface and
8 ##  for extracting subsets of the source tree. In theory, reusable parts
9 ##  of this script were intended to live in build/make/configure.sh,
10 ##  but in practice, the line is pretty blurry.
11 ##
12 ##  This build system is based in part on the FFmpeg configure script.
13 ##
14
15 #source_path="`dirname \"$0\"`"
16 source_path=${0%/*}
17 . "${source_path}/build/make/configure.sh"
18
19 show_help(){
20     show_help_pre
21     cat << EOF
22 Advanced options:
23   ${toggle_libs}                  libraries
24   ${toggle_examples}              examples
25   ${toggle_tools}                 tools
26   ${toggle_docs}                  documentation
27   ${toggle_unit_tests}            unit tests
28   ${toggle_decode_perf_tests}     build decoder perf tests with unit tests
29   ${toggle_encode_perf_tests}     build encoder perf tests with unit tests
30   --cpu=CPU                       tune for the specified CPU (ARM: cortex-a8, X86: sse3)
31   --libc=PATH                     path to alternate libc
32   --size-limit=WxH                max size to allow in the decoder
33   --as={yasm|nasm|auto}           use specified assembler [auto, yasm preferred]
34   --sdk-path=PATH                 path to root of sdk (android builds only)
35   ${toggle_codec_srcs}            in/exclude codec library source code
36   ${toggle_debug_libs}            in/exclude debug version of libraries
37   ${toggle_static_msvcrt}         use static MSVCRT (VS builds only)
38   ${toggle_vp9_highbitdepth}      use VP9 high bit depth (10/12) profiles
39   ${toggle_better_hw_compatibility}
40                                   enable encoder to produce streams with better
41                                   hardware decoder compatibility
42   ${toggle_vp8}                   VP8 codec support
43   ${toggle_vp9}                   VP9 codec support
44   ${toggle_internal_stats}        output of encoder internal stats for debug, if supported (encoders)
45   ${toggle_postproc}              postprocessing
46   ${toggle_vp9_postproc}          vp9 specific postprocessing
47   ${toggle_multithread}           multithreaded encoding and decoding
48   ${toggle_spatial_resampling}    spatial sampling (scaling) support
49   ${toggle_realtime_only}         enable this option while building for real-time encoding
50   ${toggle_onthefly_bitpacking}   enable on-the-fly bitpacking in real-time encoding
51   ${toggle_error_concealment}     enable this option to get a decoder which is able to conceal losses
52   ${toggle_coefficient_range_checking}
53                                   enable decoder to check if intermediate
54                                   transform coefficients are in valid range
55   ${toggle_runtime_cpu_detect}    runtime cpu detection
56   ${toggle_shared}                shared library support
57   ${toggle_static}                static library support
58   ${toggle_small}                 favor smaller size over speed
59   ${toggle_postproc_visualizer}   macro block / block level visualizers
60   ${toggle_multi_res_encoding}    enable multiple-resolution encoding
61   ${toggle_temporal_denoising}    enable temporal denoising and disable the spatial denoiser
62   ${toggle_vp9_temporal_denoising}
63                                   enable vp9 temporal denoising
64   ${toggle_webm_io}               enable input from and output to WebM container
65   ${toggle_libyuv}                enable libyuv
66
67 Codecs:
68   Codecs can be selectively enabled or disabled individually, or by family:
69       --disable-<codec>
70   is equivalent to:
71       --disable-<codec>-encoder
72       --disable-<codec>-decoder
73
74   Codecs available in this distribution:
75 EOF
76 #restore editor state '
77
78     family="";
79     last_family="";
80     c="";
81     str="";
82     for c in ${CODECS}; do
83         family=${c%_*}
84         if [ "${family}" != "${last_family}" ]; then
85             [ -z "${str}" ] || echo "${str}"
86             str="$(printf '    %10s:' ${family})"
87         fi
88         str="${str} $(printf '%10s' ${c#*_})"
89         last_family=${family}
90     done
91     echo "${str}"
92     show_help_post
93 }
94
95 ##
96 ## BEGIN APPLICATION SPECIFIC CONFIGURATION
97 ##
98
99 # all_platforms is a list of all supported target platforms. Maintain
100 # alphabetically by architecture, generic-gnu last.
101 all_platforms="${all_platforms} arm64-android-gcc"
102 all_platforms="${all_platforms} arm64-darwin-gcc"
103 all_platforms="${all_platforms} arm64-linux-gcc"
104 all_platforms="${all_platforms} armv7-android-gcc"   #neon Cortex-A8
105 all_platforms="${all_platforms} armv7-darwin-gcc"    #neon Cortex-A8
106 all_platforms="${all_platforms} armv7-linux-rvct"    #neon Cortex-A8
107 all_platforms="${all_platforms} armv7-linux-gcc"     #neon Cortex-A8
108 all_platforms="${all_platforms} armv7-none-rvct"     #neon Cortex-A8
109 all_platforms="${all_platforms} armv7-win32-vs11"
110 all_platforms="${all_platforms} armv7-win32-vs12"
111 all_platforms="${all_platforms} armv7-win32-vs14"
112 all_platforms="${all_platforms} armv7s-darwin-gcc"
113 all_platforms="${all_platforms} armv8-linux-gcc"
114 all_platforms="${all_platforms} mips32-linux-gcc"
115 all_platforms="${all_platforms} mips64-linux-gcc"
116 all_platforms="${all_platforms} sparc-solaris-gcc"
117 all_platforms="${all_platforms} x86-android-gcc"
118 all_platforms="${all_platforms} x86-darwin8-gcc"
119 all_platforms="${all_platforms} x86-darwin8-icc"
120 all_platforms="${all_platforms} x86-darwin9-gcc"
121 all_platforms="${all_platforms} x86-darwin9-icc"
122 all_platforms="${all_platforms} x86-darwin10-gcc"
123 all_platforms="${all_platforms} x86-darwin11-gcc"
124 all_platforms="${all_platforms} x86-darwin12-gcc"
125 all_platforms="${all_platforms} x86-darwin13-gcc"
126 all_platforms="${all_platforms} x86-darwin14-gcc"
127 all_platforms="${all_platforms} x86-darwin15-gcc"
128 all_platforms="${all_platforms} x86-iphonesimulator-gcc"
129 all_platforms="${all_platforms} x86-linux-gcc"
130 all_platforms="${all_platforms} x86-linux-icc"
131 all_platforms="${all_platforms} x86-os2-gcc"
132 all_platforms="${all_platforms} x86-solaris-gcc"
133 all_platforms="${all_platforms} x86-win32-gcc"
134 all_platforms="${all_platforms} x86-win32-vs10"
135 all_platforms="${all_platforms} x86-win32-vs11"
136 all_platforms="${all_platforms} x86-win32-vs12"
137 all_platforms="${all_platforms} x86-win32-vs14"
138 all_platforms="${all_platforms} x86_64-android-gcc"
139 all_platforms="${all_platforms} x86_64-darwin9-gcc"
140 all_platforms="${all_platforms} x86_64-darwin10-gcc"
141 all_platforms="${all_platforms} x86_64-darwin11-gcc"
142 all_platforms="${all_platforms} x86_64-darwin12-gcc"
143 all_platforms="${all_platforms} x86_64-darwin13-gcc"
144 all_platforms="${all_platforms} x86_64-darwin14-gcc"
145 all_platforms="${all_platforms} x86_64-darwin15-gcc"
146 all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
147 all_platforms="${all_platforms} x86_64-linux-gcc"
148 all_platforms="${all_platforms} x86_64-linux-icc"
149 all_platforms="${all_platforms} x86_64-solaris-gcc"
150 all_platforms="${all_platforms} x86_64-win64-gcc"
151 all_platforms="${all_platforms} x86_64-win64-vs10"
152 all_platforms="${all_platforms} x86_64-win64-vs11"
153 all_platforms="${all_platforms} x86_64-win64-vs12"
154 all_platforms="${all_platforms} x86_64-win64-vs14"
155 all_platforms="${all_platforms} generic-gnu"
156
157 # all_targets is a list of all targets that can be configured
158 # note that these should be in dependency order for now.
159 all_targets="libs examples tools docs"
160
161 # all targets available are enabled, by default.
162 for t in ${all_targets}; do
163     [ -f "${source_path}/${t}.mk" ] && enable_feature ${t}
164 done
165
166 if ! perl --version >/dev/null; then
167     die "Perl is required to build"
168 fi
169
170
171 if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; then
172   # test to see if source_path already configured
173   if [ -f "${source_path}/vpx_config.h" ]; then
174     die "source directory already configured; run 'make distclean' there first"
175   fi
176 fi
177
178 # check installed doxygen version
179 doxy_version=$(doxygen --version 2>/dev/null)
180 doxy_major=${doxy_version%%.*}
181 if [ ${doxy_major:-0} -ge 1 ]; then
182     doxy_version=${doxy_version#*.}
183     doxy_minor=${doxy_version%%.*}
184     doxy_patch=${doxy_version##*.}
185
186     [ $doxy_major -gt 1 ] && enable_feature doxygen
187     [ $doxy_minor -gt 5 ] && enable_feature doxygen
188     [ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen
189 fi
190
191 # disable codecs when their source directory does not exist
192 [ -d "${source_path}/vp8" ] || disable_codec vp8
193 [ -d "${source_path}/vp9" ] || disable_codec vp9
194
195 # install everything except the sources, by default. sources will have
196 # to be enabled when doing dist builds, since that's no longer a common
197 # case.
198 enabled doxygen && enable_feature install_docs
199 enable_feature install_bins
200 enable_feature install_libs
201
202 enable_feature static
203 enable_feature optimizations
204 enable_feature dependency_tracking
205 enable_feature spatial_resampling
206 enable_feature multithread
207 enable_feature os_support
208 enable_feature temporal_denoising
209
210 CODECS="
211     vp8_encoder
212     vp8_decoder
213     vp9_encoder
214     vp9_decoder
215 "
216 CODEC_FAMILIES="
217     vp8
218     vp9
219 "
220
221 ARCH_LIST="
222     arm
223     mips
224     x86
225     x86_64
226 "
227 ARCH_EXT_LIST_X86="
228     mmx
229     sse
230     sse2
231     sse3
232     ssse3
233     sse4_1
234     avx
235     avx2
236 "
237 ARCH_EXT_LIST="
238     neon
239     neon_asm
240
241     mips32
242     dspr2
243     msa
244     mips64
245
246     ${ARCH_EXT_LIST_X86}
247 "
248 HAVE_LIST="
249     ${ARCH_EXT_LIST}
250     vpx_ports
251     pthread_h
252     unistd_h
253 "
254 EXPERIMENT_LIST="
255     spatial_svc
256     fp_mb_stats
257     emulate_hardware
258     misc_fixes
259 "
260 CONFIG_LIST="
261     dependency_tracking
262     external_build
263     install_docs
264     install_bins
265     install_libs
266     install_srcs
267     debug
268     gprof
269     gcov
270     rvct
271     gcc
272     msvs
273     pic
274     big_endian
275
276     codec_srcs
277     debug_libs
278
279     dequant_tokens
280     dc_recon
281     runtime_cpu_detect
282     postproc
283     vp9_postproc
284     multithread
285     internal_stats
286     ${CODECS}
287     ${CODEC_FAMILIES}
288     encoders
289     decoders
290     static_msvcrt
291     spatial_resampling
292     realtime_only
293     onthefly_bitpacking
294     error_concealment
295     shared
296     static
297     small
298     postproc_visualizer
299     os_support
300     unit_tests
301     webm_io
302     libyuv
303     decode_perf_tests
304     encode_perf_tests
305     multi_res_encoding
306     temporal_denoising
307     vp9_temporal_denoising
308     coefficient_range_checking
309     vp9_highbitdepth
310     better_hw_compatibility
311     experimental
312     size_limit
313     ${EXPERIMENT_LIST}
314 "
315 CMDLINE_SELECT="
316     dependency_tracking
317     external_build
318     extra_warnings
319     werror
320     install_docs
321     install_bins
322     install_libs
323     install_srcs
324     debug
325     gprof
326     gcov
327     pic
328     optimizations
329     ccache
330     runtime_cpu_detect
331     thumb
332
333     libs
334     examples
335     tools
336     docs
337     libc
338     as
339     size_limit
340     codec_srcs
341     debug_libs
342
343     dequant_tokens
344     dc_recon
345     postproc
346     vp9_postproc
347     multithread
348     internal_stats
349     ${CODECS}
350     ${CODEC_FAMILIES}
351     static_msvcrt
352     spatial_resampling
353     realtime_only
354     onthefly_bitpacking
355     error_concealment
356     shared
357     static
358     small
359     postproc_visualizer
360     unit_tests
361     webm_io
362     libyuv
363     decode_perf_tests
364     encode_perf_tests
365     multi_res_encoding
366     temporal_denoising
367     vp9_temporal_denoising
368     coefficient_range_checking
369     better_hw_compatibility
370     vp9_highbitdepth
371     experimental
372 "
373
374 process_cmdline() {
375     for opt do
376         optval="${opt#*=}"
377         case "$opt" in
378         --disable-codecs)
379           for c in ${CODEC_FAMILIES}; do disable_codec $c; done
380           ;;
381         --enable-?*|--disable-?*)
382         eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
383         if is_in ${option} ${EXPERIMENT_LIST}; then
384             if enabled experimental; then
385                 ${action}_feature $option
386             else
387                 log_echo "Ignoring $opt -- not in experimental mode."
388             fi
389         elif is_in ${option} "${CODECS} ${CODEC_FAMILIES}"; then
390             ${action}_codec ${option}
391         else
392             process_common_cmdline $opt
393         fi
394         ;;
395         *) process_common_cmdline "$opt"
396         ;;
397         esac
398     done
399 }
400
401 post_process_cmdline() {
402     c=""
403
404     # Enable all detected codecs, if they haven't been disabled
405     for c in ${CODECS}; do soft_enable $c; done
406
407     # Enable the codec family if any component of that family is enabled
408     for c in ${CODECS}; do
409         enabled $c && enable_feature ${c%_*}
410     done
411
412     # Set the {en,de}coders variable if any algorithm in that class is enabled
413     for c in ${CODECS}; do
414         enabled ${c} && enable_feature ${c##*_}s
415     done
416 }
417
418
419 process_targets() {
420     enabled child || write_common_config_banner
421     write_common_target_config_h ${BUILD_PFX}vpx_config.h
422     write_common_config_targets
423
424     # Calculate the default distribution name, based on the enabled features
425     cf=""
426     DIST_DIR=vpx
427     for cf in $CODEC_FAMILIES; do
428         if enabled ${cf}_encoder && enabled ${cf}_decoder; then
429             DIST_DIR="${DIST_DIR}-${cf}"
430         elif enabled ${cf}_encoder; then
431             DIST_DIR="${DIST_DIR}-${cf}cx"
432         elif enabled ${cf}_decoder; then
433             DIST_DIR="${DIST_DIR}-${cf}dx"
434         fi
435     done
436     enabled debug_libs && DIST_DIR="${DIST_DIR}-debug"
437     enabled codec_srcs && DIST_DIR="${DIST_DIR}-src"
438     ! enabled postproc && ! enabled vp9_postproc && DIST_DIR="${DIST_DIR}-nopost"
439     ! enabled multithread && DIST_DIR="${DIST_DIR}-nomt"
440     ! enabled install_docs && DIST_DIR="${DIST_DIR}-nodocs"
441     DIST_DIR="${DIST_DIR}-${tgt_isa}-${tgt_os}"
442     case "${tgt_os}" in
443     win*) enabled static_msvcrt && DIST_DIR="${DIST_DIR}mt" || DIST_DIR="${DIST_DIR}md"
444           DIST_DIR="${DIST_DIR}-${tgt_cc}"
445           ;;
446     esac
447     if [ -f "${source_path}/build/make/version.sh" ]; then
448         ver=`"$source_path/build/make/version.sh" --bare "$source_path"`
449         DIST_DIR="${DIST_DIR}-${ver}"
450         VERSION_STRING=${ver}
451         ver=${ver%%-*}
452         VERSION_PATCH=${ver##*.}
453         ver=${ver%.*}
454         VERSION_MINOR=${ver##*.}
455         ver=${ver#v}
456         VERSION_MAJOR=${ver%.*}
457     fi
458     enabled child || cat <<EOF >> config.mk
459
460 PREFIX=${prefix}
461 ifeq (\$(MAKECMDGOALS),dist)
462 DIST_DIR?=${DIST_DIR}
463 else
464 DIST_DIR?=\$(DESTDIR)${prefix}
465 endif
466 LIBSUBDIR=${libdir##${prefix}/}
467
468 VERSION_STRING=${VERSION_STRING}
469
470 VERSION_MAJOR=${VERSION_MAJOR}
471 VERSION_MINOR=${VERSION_MINOR}
472 VERSION_PATCH=${VERSION_PATCH}
473
474 CONFIGURE_ARGS=${CONFIGURE_ARGS}
475 EOF
476     enabled child || echo "CONFIGURE_ARGS?=${CONFIGURE_ARGS}" >> config.mk
477
478     #
479     # Write makefiles for all enabled targets
480     #
481     for tgt in libs examples tools docs solution; do
482         tgt_fn="$tgt-$toolchain.mk"
483
484         if enabled $tgt; then
485             echo "Creating makefiles for ${toolchain} ${tgt}"
486             write_common_target_config_mk $tgt_fn ${BUILD_PFX}vpx_config.h
487             #write_${tgt}_config
488         fi
489     done
490
491 }
492
493 process_detect() {
494     if enabled shared; then
495         # Can only build shared libs on a subset of platforms. Doing this check
496         # here rather than at option parse time because the target auto-detect
497         # magic happens after the command line has been parsed.
498         case "${tgt_os}" in
499         linux|os2|darwin*|iphonesimulator*)
500             # Supported platforms
501             ;;
502         *)
503             if enabled gnu; then
504                 echo "--enable-shared is only supported on ELF; assuming this is OK"
505             else
506                 die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
507             fi
508             ;;
509         esac
510     fi
511     if [ -z "$CC" ] || enabled external_build; then
512         echo "Bypassing toolchain for environment detection."
513         enable_feature external_build
514         check_header() {
515             log fake_check_header "$@"
516             header=$1
517             shift
518             var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
519             disable_feature $var
520             # Headers common to all environments
521             case $header in
522                 stdio.h)
523                     true;
524                 ;;
525                 *)
526                     result=false
527                     for d in "$@"; do
528                         [ -f "${d##-I}/$header" ] && result=true && break
529                     done
530                     ${result:-true}
531             esac && enable_feature $var
532
533             # Specialize windows and POSIX environments.
534             case $toolchain in
535                 *-win*-*)
536                     # Don't check for any headers in Windows builds.
537                     false
538                 ;;
539                 *)
540                     case $header in
541                         pthread.h) true;;
542                         unistd.h) true;;
543                         *) false;;
544                     esac && enable_feature $var
545             esac
546             enabled $var
547         }
548         check_ld() {
549             true
550         }
551     fi
552     check_header stdio.h || die "Unable to invoke compiler: ${CC} ${CFLAGS}"
553     check_ld <<EOF || die "Toolchain is unable to link executables"
554 int main(void) {return 0;}
555 EOF
556     # check system headers
557     check_header pthread.h
558     check_header unistd.h # for sysconf(3) and friends.
559
560     check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
561 }
562
563 process_toolchain() {
564     process_common_toolchain
565
566     # Enable some useful compiler flags
567     if enabled gcc; then
568         enabled werror && check_add_cflags -Werror
569         check_add_cflags -Wall
570         check_add_cflags -Wdeclaration-after-statement
571         check_add_cflags -Wdisabled-optimization
572         check_add_cflags -Wfloat-conversion
573         check_add_cflags -Wpointer-arith
574         check_add_cflags -Wtype-limits
575         check_add_cflags -Wcast-qual
576         check_add_cflags -Wvla
577         check_add_cflags -Wimplicit-function-declaration
578         check_add_cflags -Wuninitialized
579         check_add_cflags -Wunused
580         # -Wextra has some tricky cases. Rather than fix them all now, get the
581         # flag for as many files as possible and fix the remaining issues
582         # piecemeal.
583         # https://bugs.chromium.org/p/webm/issues/detail?id=1069
584         check_add_cflags -Wextra
585         # check_add_cflags also adds to cxxflags. gtest does not do well with
586         # -Wundef so add it explicitly to CFLAGS only.
587         check_cflags -Wundef && add_cflags_only -Wundef
588         if enabled mips || [ -z "${INLINE}" ]; then
589           enabled extra_warnings || check_add_cflags -Wno-unused-function
590         fi
591         if ! enabled vp9_highbitdepth; then
592           # Avoid this warning for third_party C++ sources. Some reorganization
593           # would be needed to apply this only to test/*.cc.
594           check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32
595         fi
596     fi
597
598     if enabled icc; then
599         enabled werror && check_add_cflags -Werror
600         check_add_cflags -Wall
601         check_add_cflags -Wpointer-arith
602
603         # ICC has a number of floating point optimizations that we disable
604         # in favor of deterministic output WRT to other compilers
605         add_cflags -fp-model precise
606     fi
607
608     # Enable extra, harmless warnings. These might provide additional insight
609     # to what the compiler is doing and why, but in general, but they shouldn't
610     # be treated as fatal, even if we're treating warnings as errors.
611     GCC_EXTRA_WARNINGS="
612         -Wdisabled-optimization
613         -Winline
614     "
615     enabled gcc && EXTRA_WARNINGS="${GCC_EXTRA_WARNINGS}"
616     RVCT_EXTRA_WARNINGS="
617         --remarks
618     "
619     enabled rvct && EXTRA_WARNINGS="${RVCT_EXTRA_WARNINGS}"
620     if enabled extra_warnings; then
621         for w in ${EXTRA_WARNINGS}; do
622             check_add_cflags ${w}
623             enabled gcc && enabled werror && check_add_cflags -Wno-error=${w}
624         done
625     fi
626
627     # ccache only really works on gcc toolchains
628     enabled gcc || soft_disable ccache
629     if enabled mips; then
630         enable_feature dequant_tokens
631         enable_feature dc_recon
632     fi
633
634     if enabled internal_stats; then
635         enable_feature vp9_postproc
636     fi
637
638     # Enable the postbuild target if building for visual studio.
639     case "$tgt_cc" in
640         vs*) enable_feature msvs
641              enable_feature solution
642              vs_version=${tgt_cc##vs}
643              VCPROJ_SFX=vcxproj
644              gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
645              enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
646              all_targets="${all_targets} solution"
647              INLINE="__forceinline"
648         ;;
649     esac
650
651     # Other toolchain specific defaults
652     case $toolchain in x86*) soft_enable postproc;; esac
653
654     if enabled postproc_visualizer; then
655         enabled postproc || die "postproc_visualizer requires postproc to be enabled"
656     fi
657
658     # Enable unit tests by default if we have a working C++ compiler.
659     case "$toolchain" in
660         *-vs*)
661             soft_enable unit_tests
662             soft_enable webm_io
663             soft_enable libyuv
664         ;;
665         *-android-*)
666             soft_enable webm_io
667             soft_enable libyuv
668             # GTestLog must be modified to use Android logging utilities.
669         ;;
670         *-darwin-*)
671             # iOS/ARM builds do not work with gtest. This does not match
672             # x86 targets.
673         ;;
674         *-iphonesimulator-*)
675             soft_enable webm_io
676             soft_enable libyuv
677         ;;
678         *-win*)
679             # Some mingw toolchains don't have pthread available by default.
680             # Treat these more like visual studio where threading in gtest
681             # would be disabled for the same reason.
682             check_cxx "$@" <<EOF && soft_enable unit_tests
683 int z;
684 EOF
685             check_cxx "$@" <<EOF && soft_enable webm_io
686 int z;
687 EOF
688             check_cxx "$@" <<EOF && soft_enable libyuv
689 int z;
690 EOF
691         ;;
692         *)
693             enabled pthread_h && check_cxx "$@" <<EOF && soft_enable unit_tests
694 int z;
695 EOF
696             check_cxx "$@" <<EOF && soft_enable webm_io
697 int z;
698 EOF
699             check_cxx "$@" <<EOF && soft_enable libyuv
700 int z;
701 EOF
702         ;;
703     esac
704     # libwebm needs to be linked with C++ standard library
705     enabled webm_io && LD=${CXX}
706
707     # append any user defined extra cflags
708     if [ -n "${extra_cflags}" ] ; then
709         check_add_cflags ${extra_cflags} || \
710         die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
711     fi
712     if [ -n "${extra_cxxflags}" ]; then
713         check_add_cxxflags ${extra_cxxflags} || \
714         die "Requested extra CXXFLAGS '${extra_cxxflags}' not supported by compiler"
715     fi
716 }
717
718
719 ##
720 ## END APPLICATION SPECIFIC CONFIGURATION
721 ##
722 CONFIGURE_ARGS="$@"
723 process "$@"
724 print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */"
725 cat <<EOF >> ${BUILD_PFX}vpx_config.c
726 #include "vpx/vpx_codec.h"
727 static const char* const cfg = "$CONFIGURE_ARGS";
728 const char *vpx_codec_build_config(void) {return cfg;}
729 EOF