Merge "configure: add --extra-cxxflags option"
[platform/upstream/libvpx.git] / build / make / configure.sh
1 #!/bin/sh
2 ##
3 ##  configure.sh
4 ##
5 ##  This script is sourced by the main configure script and contains
6 ##  utility functions and other common bits that aren't strictly libvpx
7 ##  related.
8 ##
9 ##  This build system is based in part on the FFmpeg configure script.
10 ##
11
12
13 #
14 # Logging / Output Functions
15 #
16 die_unknown(){
17   echo "Unknown option \"$1\"."
18   echo "See $0 --help for available options."
19   clean_temp_files
20   exit 1
21 }
22
23 die() {
24   echo "$@"
25   echo
26   echo "Configuration failed. This could reflect a misconfiguration of your"
27   echo "toolchains, improper options selected, or another problem. If you"
28   echo "don't see any useful error messages above, the next step is to look"
29   echo "at the configure error log file ($logfile) to determine what"
30   echo "configure was trying to do when it died."
31   clean_temp_files
32   exit 1
33 }
34
35 log(){
36   echo "$@" >>$logfile
37 }
38
39 log_file(){
40   log BEGIN $1
41   cat -n $1 >>$logfile
42   log END $1
43 }
44
45 log_echo() {
46   echo "$@"
47   log "$@"
48 }
49
50 fwrite () {
51   outfile=$1
52   shift
53   echo "$@" >> ${outfile}
54 }
55
56 show_help_pre(){
57   for opt in ${CMDLINE_SELECT}; do
58     opt2=`echo $opt | sed -e 's;_;-;g'`
59     if enabled $opt; then
60       eval "toggle_${opt}=\"--disable-${opt2}\""
61     else
62       eval "toggle_${opt}=\"--enable-${opt2} \""
63     fi
64   done
65
66   cat <<EOF
67 Usage: configure [options]
68 Options:
69
70 Build options:
71   --help                      print this message
72   --log=yes|no|FILE           file configure log is written to [config.log]
73   --target=TARGET             target platform tuple [generic-gnu]
74   --cpu=CPU                   optimize for a specific cpu rather than a family
75   --extra-cflags=ECFLAGS      add ECFLAGS to CFLAGS [$CFLAGS]
76   --extra-cxxflags=ECXXFLAGS  add ECXXFLAGS to CXXFLAGS [$CXXFLAGS]
77   ${toggle_extra_warnings}    emit harmless warnings (always non-fatal)
78   ${toggle_werror}            treat warnings as errors, if possible
79                               (not available with all compilers)
80   ${toggle_optimizations}     turn on/off compiler optimization flags
81   ${toggle_pic}               turn on/off Position Independent Code
82   ${toggle_ccache}            turn on/off compiler cache
83   ${toggle_debug}             enable/disable debug mode
84   ${toggle_gprof}             enable/disable gprof profiling instrumentation
85   ${toggle_gcov}              enable/disable gcov coverage instrumentation
86   ${toggle_thumb}             enable/disable building arm assembly in thumb mode
87   ${toggle_dependency_tracking}
88                               disable to speed up one-time build
89
90 Install options:
91   ${toggle_install_docs}      control whether docs are installed
92   ${toggle_install_bins}      control whether binaries are installed
93   ${toggle_install_libs}      control whether libraries are installed
94   ${toggle_install_srcs}      control whether sources are installed
95
96
97 EOF
98 }
99
100 show_help_post(){
101   cat <<EOF
102
103
104 NOTES:
105     Object files are built at the place where configure is launched.
106
107     All boolean options can be negated. The default value is the opposite
108     of that shown above. If the option --disable-foo is listed, then
109     the default value for foo is enabled.
110
111 Supported targets:
112 EOF
113   show_targets ${all_platforms}
114   echo
115   exit 1
116 }
117
118 show_targets() {
119   while [ -n "$*" ]; do
120     if [ "${1%%-*}" = "${2%%-*}" ]; then
121       if [ "${2%%-*}" = "${3%%-*}" ]; then
122         printf "    %-24s %-24s %-24s\n" "$1" "$2" "$3"
123         shift; shift; shift
124       else
125         printf "    %-24s %-24s\n" "$1" "$2"
126         shift; shift
127       fi
128     else
129       printf "    %-24s\n" "$1"
130       shift
131     fi
132   done
133 }
134
135 show_help() {
136   show_help_pre
137   show_help_post
138 }
139
140 #
141 # List Processing Functions
142 #
143 set_all(){
144   value=$1
145   shift
146   for var in $*; do
147     eval $var=$value
148   done
149 }
150
151 is_in(){
152   value=$1
153   shift
154   for var in $*; do
155     [ $var = $value ] && return 0
156   done
157   return 1
158 }
159
160 add_cflags() {
161   CFLAGS="${CFLAGS} $@"
162   CXXFLAGS="${CXXFLAGS} $@"
163 }
164
165 add_cflags_only() {
166   CFLAGS="${CFLAGS} $@"
167 }
168
169 add_cxxflags_only() {
170   CXXFLAGS="${CXXFLAGS} $@"
171 }
172
173 add_ldflags() {
174   LDFLAGS="${LDFLAGS} $@"
175 }
176
177 add_asflags() {
178   ASFLAGS="${ASFLAGS} $@"
179 }
180
181 add_extralibs() {
182   extralibs="${extralibs} $@"
183 }
184
185 #
186 # Boolean Manipulation Functions
187 #
188 enable_feature(){
189   set_all yes $*
190 }
191
192 disable_feature(){
193   set_all no $*
194 }
195
196 enabled(){
197   eval test "x\$$1" = "xyes"
198 }
199
200 disabled(){
201   eval test "x\$$1" = "xno"
202 }
203
204 soft_enable() {
205   for var in $*; do
206     if ! disabled $var; then
207       enabled $var || log_echo "  enabling $var"
208       enable_feature $var
209     fi
210   done
211 }
212
213 soft_disable() {
214   for var in $*; do
215     if ! enabled $var; then
216       disabled $var || log_echo "  disabling $var"
217       disable_feature $var
218     fi
219   done
220 }
221
222 #
223 # Text Processing Functions
224 #
225 toupper(){
226   echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
227 }
228
229 tolower(){
230   echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
231 }
232
233 #
234 # Temporary File Functions
235 #
236 source_path=${0%/*}
237 enable_feature source_path_used
238 if [ -z "$source_path" ] || [ "$source_path" = "." ]; then
239   source_path="`pwd`"
240   disable_feature source_path_used
241 fi
242
243 if test ! -z "$TMPDIR" ; then
244   TMPDIRx="${TMPDIR}"
245 elif test ! -z "$TEMPDIR" ; then
246   TMPDIRx="${TEMPDIR}"
247 else
248   TMPDIRx="/tmp"
249 fi
250 RAND=$(awk 'BEGIN { srand(); printf "%d\n",(rand() * 32768)}')
251 TMP_H="${TMPDIRx}/vpx-conf-$$-${RAND}.h"
252 TMP_C="${TMPDIRx}/vpx-conf-$$-${RAND}.c"
253 TMP_CC="${TMPDIRx}/vpx-conf-$$-${RAND}.cc"
254 TMP_O="${TMPDIRx}/vpx-conf-$$-${RAND}.o"
255 TMP_X="${TMPDIRx}/vpx-conf-$$-${RAND}.x"
256 TMP_ASM="${TMPDIRx}/vpx-conf-$$-${RAND}.asm"
257
258 clean_temp_files() {
259   rm -f ${TMP_C} ${TMP_CC} ${TMP_H} ${TMP_O} ${TMP_X} ${TMP_ASM}
260   enabled gcov && rm -f ${TMP_C%.c}.gcno ${TMP_CC%.cc}.gcno
261 }
262
263 #
264 # Toolchain Check Functions
265 #
266 check_cmd() {
267   enabled external_build && return
268   log "$@"
269   "$@" >>${logfile} 2>&1
270 }
271
272 check_cc() {
273   log check_cc "$@"
274   cat >${TMP_C}
275   log_file ${TMP_C}
276   check_cmd ${CC} ${CFLAGS} "$@" -c -o ${TMP_O} ${TMP_C}
277 }
278
279 check_cxx() {
280   log check_cxx "$@"
281   cat >${TMP_CC}
282   log_file ${TMP_CC}
283   check_cmd ${CXX} ${CXXFLAGS} "$@" -c -o ${TMP_O} ${TMP_CC}
284 }
285
286 check_cpp() {
287   log check_cpp "$@"
288   cat > ${TMP_C}
289   log_file ${TMP_C}
290   check_cmd ${CC} ${CFLAGS} "$@" -E -o ${TMP_O} ${TMP_C}
291 }
292
293 check_ld() {
294   log check_ld "$@"
295   check_cc $@ \
296     && check_cmd ${LD} ${LDFLAGS} "$@" -o ${TMP_X} ${TMP_O} ${extralibs}
297 }
298
299 check_header(){
300   log check_header "$@"
301   header=$1
302   shift
303   var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
304   disable_feature $var
305   check_cpp "$@" <<EOF && enable_feature $var
306 #include "$header"
307 int x;
308 EOF
309 }
310
311 check_cflags() {
312  log check_cflags "$@"
313  check_cc -Werror "$@" <<EOF
314 int x;
315 EOF
316 }
317
318 check_cxxflags() {
319   log check_cxxflags "$@"
320
321   # Catch CFLAGS that trigger CXX warnings
322   case "$CXX" in
323     *c++-analyzer|*clang++|*g++*)
324       check_cxx -Werror "$@" <<EOF
325 int x;
326 EOF
327       ;;
328     *)
329       check_cxx -Werror "$@" <<EOF
330 int x;
331 EOF
332       ;;
333     esac
334 }
335
336 check_add_cflags() {
337   check_cxxflags "$@" && add_cxxflags_only "$@"
338   check_cflags "$@" && add_cflags_only "$@"
339 }
340
341 check_add_cxxflags() {
342   check_cxxflags "$@" && add_cxxflags_only "$@"
343 }
344
345 check_add_asflags() {
346   log add_asflags "$@"
347   add_asflags "$@"
348 }
349
350 check_add_ldflags() {
351   log add_ldflags "$@"
352   add_ldflags "$@"
353 }
354
355 check_asm_align() {
356   log check_asm_align "$@"
357   cat >${TMP_ASM} <<EOF
358 section .rodata
359 align 16
360 EOF
361   log_file ${TMP_ASM}
362   check_cmd ${AS} ${ASFLAGS} -o ${TMP_O} ${TMP_ASM}
363   readelf -WS ${TMP_O} >${TMP_X}
364   log_file ${TMP_X}
365   if ! grep -q '\.rodata .* 16$' ${TMP_X}; then
366     die "${AS} ${ASFLAGS} does not support section alignment (nasm <=2.08?)"
367   fi
368 }
369
370 # tests for -m$1 toggling the feature given in $2. If $2 is empty $1 is used.
371 check_gcc_machine_option() {
372   opt="$1"
373   feature="$2"
374   [ -n "$feature" ] || feature="$opt"
375
376   if enabled gcc && ! disabled "$feature" && ! check_cflags "-m$opt"; then
377     RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature "
378   else
379     soft_enable "$feature"
380   fi
381 }
382
383 write_common_config_banner() {
384   print_webm_license config.mk "##" ""
385   echo '# This file automatically generated by configure. Do not edit!' >> config.mk
386   echo "TOOLCHAIN := ${toolchain}" >> config.mk
387
388   case ${toolchain} in
389     *-linux-rvct)
390       echo "ALT_LIBC := ${alt_libc}" >> config.mk
391       ;;
392   esac
393 }
394
395 write_common_config_targets() {
396   for t in ${all_targets}; do
397     if enabled ${t}; then
398       if enabled child; then
399         fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}"
400       else
401         fwrite config.mk "ALL_TARGETS += ${t}"
402       fi
403     fi
404     true;
405   done
406   true
407 }
408
409 write_common_target_config_mk() {
410   saved_CC="${CC}"
411   saved_CXX="${CXX}"
412   enabled ccache && CC="ccache ${CC}"
413   enabled ccache && CXX="ccache ${CXX}"
414   print_webm_license $1 "##" ""
415
416   cat >> $1 << EOF
417 # This file automatically generated by configure. Do not edit!
418 SRC_PATH="$source_path"
419 SRC_PATH_BARE=$source_path
420 BUILD_PFX=${BUILD_PFX}
421 TOOLCHAIN=${toolchain}
422 ASM_CONVERSION=${asm_conversion_cmd:-${source_path}/build/make/ads2gas.pl}
423 GEN_VCPROJ=${gen_vcproj_cmd}
424 MSVS_ARCH_DIR=${msvs_arch_dir}
425
426 CC=${CC}
427 CXX=${CXX}
428 AR=${AR}
429 LD=${LD}
430 AS=${AS}
431 STRIP=${STRIP}
432 NM=${NM}
433
434 CFLAGS  = ${CFLAGS}
435 CXXFLAGS  = ${CXXFLAGS}
436 ARFLAGS = -crs\$(if \$(quiet),,v)
437 LDFLAGS = ${LDFLAGS}
438 ASFLAGS = ${ASFLAGS}
439 extralibs = ${extralibs}
440 AS_SFX    = ${AS_SFX:-.asm}
441 EXE_SFX   = ${EXE_SFX}
442 VCPROJ_SFX = ${VCPROJ_SFX}
443 RTCD_OPTIONS = ${RTCD_OPTIONS}
444 EOF
445
446   if enabled rvct; then cat >> $1 << EOF
447 fmt_deps = sed -e 's;^__image.axf;\${@:.d=.o} \$@;' #hide
448 EOF
449   else cat >> $1 << EOF
450 fmt_deps = sed -e 's;^\([a-zA-Z0-9_]*\)\.o;\${@:.d=.o} \$@;'
451 EOF
452   fi
453
454   print_config_mk ARCH   "${1}" ${ARCH_LIST}
455   print_config_mk HAVE   "${1}" ${HAVE_LIST}
456   print_config_mk CONFIG "${1}" ${CONFIG_LIST}
457   print_config_mk HAVE   "${1}" gnu_strip
458
459   enabled msvs && echo "CONFIG_VS_VERSION=${vs_version}" >> "${1}"
460
461   CC="${saved_CC}"
462   CXX="${saved_CXX}"
463 }
464
465 write_common_target_config_h() {
466   print_webm_license ${TMP_H} "/*" " */"
467   cat >> ${TMP_H} << EOF
468 /* This file automatically generated by configure. Do not edit! */
469 #ifndef VPX_CONFIG_H
470 #define VPX_CONFIG_H
471 #define RESTRICT    ${RESTRICT}
472 #define INLINE      ${INLINE}
473 EOF
474   print_config_h ARCH   "${TMP_H}" ${ARCH_LIST}
475   print_config_h HAVE   "${TMP_H}" ${HAVE_LIST}
476   print_config_h CONFIG "${TMP_H}" ${CONFIG_LIST}
477   print_config_vars_h   "${TMP_H}" ${VAR_LIST}
478   echo "#endif /* VPX_CONFIG_H */" >> ${TMP_H}
479   mkdir -p `dirname "$1"`
480   cmp "$1" ${TMP_H} >/dev/null 2>&1 || mv ${TMP_H} "$1"
481 }
482
483 process_common_cmdline() {
484   for opt in "$@"; do
485     optval="${opt#*=}"
486     case "$opt" in
487       --child)
488         enable_feature child
489         ;;
490       --log*)
491         logging="$optval"
492         if ! disabled logging ; then
493           enabled logging || logfile="$logging"
494         else
495           logfile=/dev/null
496         fi
497         ;;
498       --target=*)
499         toolchain="${toolchain:-${optval}}"
500         ;;
501       --force-target=*)
502         toolchain="${toolchain:-${optval}}"
503         enable_feature force_toolchain
504         ;;
505       --cpu=*)
506         tune_cpu="$optval"
507         ;;
508       --extra-cflags=*)
509         extra_cflags="${optval}"
510         ;;
511       --extra-cxxflags=*)
512         extra_cxxflags="${optval}"
513         ;;
514       --enable-?*|--disable-?*)
515         eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
516         if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
517           [ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${option} "
518         elif [ $action = "disable" ] && ! disabled $option ; then
519           echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
520             die_unknown $opt
521           log_echo "  disabling $option"
522         elif [ $action = "enable" ] && ! enabled $option ; then
523           echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
524             die_unknown $opt
525           log_echo "  enabling $option"
526         fi
527         ${action}_feature $option
528         ;;
529       --require-?*)
530         eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
531         if echo "${ARCH_EXT_LIST}" none | grep "^ *$option\$" >/dev/null; then
532             RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
533         else
534             die_unknown $opt
535         fi
536         ;;
537       --force-enable-?*|--force-disable-?*)
538         eval `echo "$opt" | sed 's/--force-/action=/;s/-/ option=/;s/-/_/g'`
539         ${action}_feature $option
540         ;;
541       --libc=*)
542         [ -d "${optval}" ] || die "Not a directory: ${optval}"
543         disable_feature builtin_libc
544         alt_libc="${optval}"
545         ;;
546       --as=*)
547         [ "${optval}" = yasm ] || [ "${optval}" = nasm ] \
548           || [ "${optval}" = auto ] \
549           || die "Must be yasm, nasm or auto: ${optval}"
550         alt_as="${optval}"
551         ;;
552       --size-limit=*)
553         w="${optval%%x*}"
554         h="${optval##*x}"
555         VAR_LIST="DECODE_WIDTH_LIMIT ${w} DECODE_HEIGHT_LIMIT ${h}"
556         [ ${w} -gt 0 ] && [ ${h} -gt 0 ] || die "Invalid size-limit: too small."
557         [ ${w} -lt 65536 ] && [ ${h} -lt 65536 ] \
558             || die "Invalid size-limit: too big."
559         enable_feature size_limit
560         ;;
561       --prefix=*)
562         prefix="${optval}"
563         ;;
564       --libdir=*)
565         libdir="${optval}"
566         ;;
567       --sdk-path=*)
568         [ -d "${optval}" ] || die "Not a directory: ${optval}"
569         sdk_path="${optval}"
570         ;;
571       --libc|--as|--prefix|--libdir|--sdk-path)
572         die "Option ${opt} requires argument"
573         ;;
574       --help|-h)
575         show_help
576         ;;
577       *)
578         die_unknown $opt
579         ;;
580     esac
581   done
582 }
583
584 process_cmdline() {
585   for opt do
586     optval="${opt#*=}"
587     case "$opt" in
588       *)
589         process_common_cmdline $opt
590         ;;
591     esac
592   done
593 }
594
595 post_process_common_cmdline() {
596   prefix="${prefix:-/usr/local}"
597   prefix="${prefix%/}"
598   libdir="${libdir:-${prefix}/lib}"
599   libdir="${libdir%/}"
600   if [ "${libdir#${prefix}}" = "${libdir}" ]; then
601     die "Libdir ${libdir} must be a subdirectory of ${prefix}"
602   fi
603 }
604
605 post_process_cmdline() {
606   true;
607 }
608
609 setup_gnu_toolchain() {
610   CC=${CC:-${CROSS}gcc}
611   CXX=${CXX:-${CROSS}g++}
612   AR=${AR:-${CROSS}ar}
613   LD=${LD:-${CROSS}${link_with_cc:-ld}}
614   AS=${AS:-${CROSS}as}
615   STRIP=${STRIP:-${CROSS}strip}
616   NM=${NM:-${CROSS}nm}
617   AS_SFX=.s
618   EXE_SFX=
619 }
620
621 # Reliably find the newest available Darwin SDKs. (Older versions of
622 # xcrun don't support --show-sdk-path.)
623 show_darwin_sdk_path() {
624   xcrun --sdk $1 --show-sdk-path 2>/dev/null ||
625     xcodebuild -sdk $1 -version Path 2>/dev/null
626 }
627
628 process_common_toolchain() {
629   if [ -z "$toolchain" ]; then
630     gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
631
632     # detect tgt_isa
633     case "$gcctarget" in
634       armv6*)
635         tgt_isa=armv6
636         ;;
637       armv7*-hardfloat*)
638         tgt_isa=armv7
639         float_abi=hard
640         ;;
641       armv7*)
642         tgt_isa=armv7
643         float_abi=softfp
644         ;;
645       *x86_64*|*amd64*)
646         tgt_isa=x86_64
647         ;;
648       *i[3456]86*)
649         tgt_isa=x86
650         ;;
651       *sparc*)
652         tgt_isa=sparc
653         ;;
654     esac
655
656     # detect tgt_os
657     case "$gcctarget" in
658       *darwin10*)
659         tgt_isa=x86_64
660         tgt_os=darwin10
661         ;;
662       *darwin11*)
663         tgt_isa=x86_64
664         tgt_os=darwin11
665         ;;
666       *darwin12*)
667         tgt_isa=x86_64
668         tgt_os=darwin12
669         ;;
670       *darwin13*)
671         tgt_isa=x86_64
672         tgt_os=darwin13
673         ;;
674       *darwin14*)
675         tgt_isa=x86_64
676         tgt_os=darwin14
677         ;;
678       x86_64*mingw32*)
679         tgt_os=win64
680         ;;
681       *mingw32*|*cygwin*)
682         [ -z "$tgt_isa" ] && tgt_isa=x86
683         tgt_os=win32
684         ;;
685       *linux*|*bsd*)
686         tgt_os=linux
687         ;;
688       *solaris2.10)
689         tgt_os=solaris
690         ;;
691       *os2*)
692         tgt_os=os2
693         ;;
694     esac
695
696     if [ -n "$tgt_isa" ] && [ -n "$tgt_os" ]; then
697       toolchain=${tgt_isa}-${tgt_os}-gcc
698     fi
699   fi
700
701   toolchain=${toolchain:-generic-gnu}
702
703   is_in ${toolchain} ${all_platforms} || enabled force_toolchain \
704     || die "Unrecognized toolchain '${toolchain}'"
705
706   enabled child || log_echo "Configuring for target '${toolchain}'"
707
708   #
709   # Set up toolchain variables
710   #
711   tgt_isa=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $1}')
712   tgt_os=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $2}')
713   tgt_cc=$(echo ${toolchain} | awk 'BEGIN{FS="-"}{print $3}')
714
715   # Mark the specific ISA requested as enabled
716   soft_enable ${tgt_isa}
717   enable_feature ${tgt_os}
718   enable_feature ${tgt_cc}
719
720   # Enable the architecture family
721   case ${tgt_isa} in
722     arm*)
723       enable_feature arm
724       ;;
725     mips*)
726       enable_feature mips
727       ;;
728   esac
729
730   # PIC is probably what we want when building shared libs
731   enabled shared && soft_enable pic
732
733   # Minimum iOS version for all target platforms (darwin and iphonesimulator).
734   IOS_VERSION_MIN="6.0"
735
736   # Handle darwin variants. Newer SDKs allow targeting older
737   # platforms, so use the newest one available.
738   case ${toolchain} in
739     *-darwin*)
740       osx_sdk_dir="$(show_darwin_sdk_path macosx)"
741       if [ -d "${osx_sdk_dir}" ]; then
742         add_cflags  "-isysroot ${osx_sdk_dir}"
743         add_ldflags "-isysroot ${osx_sdk_dir}"
744       fi
745       ;;
746   esac
747
748   case ${toolchain} in
749     *-darwin8-*)
750       add_cflags  "-mmacosx-version-min=10.4"
751       add_ldflags "-mmacosx-version-min=10.4"
752       ;;
753     *-darwin9-*)
754       add_cflags  "-mmacosx-version-min=10.5"
755       add_ldflags "-mmacosx-version-min=10.5"
756       ;;
757     *-darwin10-*)
758       add_cflags  "-mmacosx-version-min=10.6"
759       add_ldflags "-mmacosx-version-min=10.6"
760       ;;
761     *-darwin11-*)
762       add_cflags  "-mmacosx-version-min=10.7"
763       add_ldflags "-mmacosx-version-min=10.7"
764       ;;
765     *-darwin12-*)
766       add_cflags  "-mmacosx-version-min=10.8"
767       add_ldflags "-mmacosx-version-min=10.8"
768       ;;
769     *-darwin13-*)
770       add_cflags  "-mmacosx-version-min=10.9"
771       add_ldflags "-mmacosx-version-min=10.9"
772       ;;
773     *-darwin14-*)
774       add_cflags  "-mmacosx-version-min=10.10"
775       add_ldflags "-mmacosx-version-min=10.10"
776       ;;
777     *-iphonesimulator-*)
778       add_cflags  "-miphoneos-version-min=${IOS_VERSION_MIN}"
779       add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
780       iossim_sdk_dir="$(show_darwin_sdk_path iphonesimulator)"
781       if [ -d "${iossim_sdk_dir}" ]; then
782         add_cflags  "-isysroot ${iossim_sdk_dir}"
783         add_ldflags "-isysroot ${iossim_sdk_dir}"
784       fi
785       ;;
786   esac
787
788   # Handle Solaris variants. Solaris 10 needs -lposix4
789   case ${toolchain} in
790     sparc-solaris-*)
791       add_extralibs -lposix4
792       ;;
793     *-solaris-*)
794       add_extralibs -lposix4
795       ;;
796   esac
797
798   # Process ARM architecture variants
799   case ${toolchain} in
800     arm*)
801       # on arm, isa versions are supersets
802       case ${tgt_isa} in
803         arm64|armv8)
804           soft_enable neon
805           ;;
806         armv7|armv7s)
807           soft_enable neon
808           # Only enable neon_asm when neon is also enabled.
809           enabled neon && soft_enable neon_asm
810           # If someone tries to force it through, die.
811           if disabled neon && enabled neon_asm; then
812             die "Disabling neon while keeping neon-asm is not supported"
813           fi
814           soft_enable media
815           ;;
816         armv6)
817           soft_enable media
818           ;;
819       esac
820
821       asm_conversion_cmd="cat"
822
823       case ${tgt_cc} in
824         gcc)
825           CROSS=${CROSS:-arm-none-linux-gnueabi-}
826           link_with_cc=gcc
827           setup_gnu_toolchain
828           arch_int=${tgt_isa##armv}
829           arch_int=${arch_int%%te}
830           check_add_asflags --defsym ARCHITECTURE=${arch_int}
831           tune_cflags="-mtune="
832           if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then
833             if [ -z "${float_abi}" ]; then
834               check_cpp <<EOF && float_abi=hard || float_abi=softfp
835 #ifndef __ARM_PCS_VFP
836 #error "not hardfp"
837 #endif
838 EOF
839             fi
840             check_add_cflags  -march=armv7-a -mfloat-abi=${float_abi}
841             check_add_asflags -march=armv7-a -mfloat-abi=${float_abi}
842
843             if enabled neon || enabled neon_asm; then
844               check_add_cflags -mfpu=neon #-ftree-vectorize
845               check_add_asflags -mfpu=neon
846             fi
847           else
848             check_add_cflags -march=${tgt_isa}
849             check_add_asflags -march=${tgt_isa}
850           fi
851
852           enabled debug && add_asflags -g
853           asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
854           if enabled thumb; then
855             asm_conversion_cmd="$asm_conversion_cmd -thumb"
856             check_add_cflags -mthumb
857             check_add_asflags -mthumb -mimplicit-it=always
858           fi
859           ;;
860         vs*)
861           asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
862           AS_SFX=.s
863           msvs_arch_dir=arm-msvs
864           disable_feature multithread
865           disable_feature unit_tests
866           vs_version=${tgt_cc##vs}
867           if [ $vs_version -ge 12 ]; then
868             # MSVC 2013 doesn't allow doing plain .exe projects for ARM,
869             # only "AppContainerApplication" which requires an AppxManifest.
870             # Therefore disable the examples, just build the library.
871             disable_feature examples
872           fi
873           ;;
874         rvct)
875           CC=armcc
876           AR=armar
877           AS=armasm
878           LD="${source_path}/build/make/armlink_adapter.sh"
879           STRIP=arm-none-linux-gnueabi-strip
880           NM=arm-none-linux-gnueabi-nm
881           tune_cflags="--cpu="
882           tune_asflags="--cpu="
883           if [ -z "${tune_cpu}" ]; then
884             if [ ${tgt_isa} = "armv7" ]; then
885               if enabled neon || enabled neon_asm
886               then
887                 check_add_cflags --fpu=softvfp+vfpv3
888                 check_add_asflags --fpu=softvfp+vfpv3
889               fi
890               check_add_cflags --cpu=Cortex-A8
891               check_add_asflags --cpu=Cortex-A8
892             else
893               check_add_cflags --cpu=${tgt_isa##armv}
894               check_add_asflags --cpu=${tgt_isa##armv}
895             fi
896           fi
897           arch_int=${tgt_isa##armv}
898           arch_int=${arch_int%%te}
899           check_add_asflags --pd "\"ARCHITECTURE SETA ${arch_int}\""
900           enabled debug && add_asflags -g
901           add_cflags --gnu
902           add_cflags --enum_is_int
903           add_cflags --wchar32
904           ;;
905       esac
906
907       case ${tgt_os} in
908         none*)
909           disable_feature multithread
910           disable_feature os_support
911           ;;
912
913         android*)
914           SDK_PATH=${sdk_path}
915           COMPILER_LOCATION=`find "${SDK_PATH}" \
916                              -name "arm-linux-androideabi-gcc*" -print -quit`
917           TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
918           CC=${TOOLCHAIN_PATH}gcc
919           CXX=${TOOLCHAIN_PATH}g++
920           AR=${TOOLCHAIN_PATH}ar
921           LD=${TOOLCHAIN_PATH}gcc
922           AS=${TOOLCHAIN_PATH}as
923           STRIP=${TOOLCHAIN_PATH}strip
924           NM=${TOOLCHAIN_PATH}nm
925
926           if [ -z "${alt_libc}" ]; then
927             alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
928               awk '{n = split($0,a,"/"); \
929                 split(a[n-1],b,"-"); \
930                 print $0 " " b[2]}' | \
931                 sort -g -k 2 | \
932                 awk '{ print $1 }' | tail -1`
933           fi
934
935           add_cflags "--sysroot=${alt_libc}"
936           add_ldflags "--sysroot=${alt_libc}"
937
938           # linker flag that routes around a CPU bug in some
939           # Cortex-A8 implementations (NDK Dev Guide)
940           add_ldflags "-Wl,--fix-cortex-a8"
941
942           enable_feature pic
943           soft_enable realtime_only
944           if [ ${tgt_isa} = "armv7" ]; then
945             soft_enable runtime_cpu_detect
946           fi
947           if enabled runtime_cpu_detect; then
948             add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
949           fi
950           ;;
951
952         darwin*)
953           XCRUN_FIND="xcrun --sdk iphoneos --find"
954           CXX="$(${XCRUN_FIND} clang++)"
955           CC="$(${XCRUN_FIND} clang)"
956           AR="$(${XCRUN_FIND} ar)"
957           AS="$(${XCRUN_FIND} as)"
958           STRIP="$(${XCRUN_FIND} strip)"
959           NM="$(${XCRUN_FIND} nm)"
960           RANLIB="$(${XCRUN_FIND} ranlib)"
961           AS_SFX=.s
962
963           # Special handling of ld for armv6 because libclang_rt.ios.a does
964           # not contain armv6 support in Apple's clang package:
965           #   Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn).
966           # TODO(tomfinegan): Remove this. Our minimum iOS version (6.0)
967           # renders support for armv6 unnecessary because the 3GS and up
968           # support neon.
969           if [ "${tgt_isa}" = "armv6" ]; then
970             LD="$(${XCRUN_FIND} ld)"
971           else
972             LD="${CXX:-$(${XCRUN_FIND} ld)}"
973           fi
974
975           # ASFLAGS is written here instead of using check_add_asflags
976           # because we need to overwrite all of ASFLAGS and purge the
977           # options that were put in above
978           ASFLAGS="-arch ${tgt_isa} -g"
979
980           add_cflags -arch ${tgt_isa}
981           add_ldflags -arch ${tgt_isa}
982
983           alt_libc="$(show_darwin_sdk_path iphoneos)"
984           if [ -d "${alt_libc}" ]; then
985             add_cflags -isysroot ${alt_libc}
986           fi
987
988           if [ "${LD}" = "${CXX}" ]; then
989             add_ldflags -miphoneos-version-min="${IOS_VERSION_MIN}"
990           else
991             add_ldflags -ios_version_min "${IOS_VERSION_MIN}"
992           fi
993
994           for d in lib usr/lib usr/lib/system; do
995             try_dir="${alt_libc}/${d}"
996             [ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
997           done
998
999           asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
1000           ;;
1001
1002         linux*)
1003           enable_feature linux
1004           if enabled rvct; then
1005             # Check if we have CodeSourcery GCC in PATH. Needed for
1006             # libraries
1007             hash arm-none-linux-gnueabi-gcc 2>&- || \
1008               die "Couldn't find CodeSourcery GCC from PATH"
1009
1010             # Use armcc as a linker to enable translation of
1011             # some gcc specific options such as -lm and -lpthread.
1012             LD="armcc --translate_gcc"
1013
1014             # create configuration file (uses path to CodeSourcery GCC)
1015             armcc --arm_linux_configure --arm_linux_config_file=arm_linux.cfg
1016
1017             add_cflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
1018             add_asflags --no_hide_all --apcs=/interwork
1019             add_ldflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
1020             enabled pic && add_cflags --apcs=/fpic
1021             enabled pic && add_asflags --apcs=/fpic
1022             enabled shared && add_cflags --shared
1023           fi
1024           ;;
1025       esac
1026       ;;
1027     mips*)
1028       link_with_cc=gcc
1029       setup_gnu_toolchain
1030       tune_cflags="-mtune="
1031       if enabled dspr2; then
1032         check_add_cflags -mips32r2 -mdspr2
1033       fi
1034
1035       if enabled runtime_cpu_detect; then
1036         disable_feature runtime_cpu_detect
1037       fi
1038
1039       if [ -n "${tune_cpu}" ]; then
1040         case ${tune_cpu} in
1041           p5600)
1042             check_add_cflags -mips32r5 -funroll-loops -mload-store-pairs
1043             check_add_cflags -msched-weight -mhard-float -mfp64
1044             check_add_asflags -mips32r5 -mhard-float -mfp64
1045             check_add_ldflags -mfp64
1046             ;;
1047           i6400)
1048             check_add_cflags -mips64r6 -mabi=64 -funroll-loops -msched-weight 
1049             check_add_cflags  -mload-store-pairs -mhard-float -mfp64
1050             check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
1051             check_add_ldflags -mips64r6 -mabi=64 -mfp64
1052             ;;
1053         esac
1054
1055         if enabled msa; then
1056           add_cflags -mmsa
1057           add_asflags -mmsa
1058           add_ldflags -mmsa
1059         fi
1060       fi
1061
1062       check_add_cflags -march=${tgt_isa}
1063       check_add_asflags -march=${tgt_isa}
1064       check_add_asflags -KPIC
1065       ;;
1066     x86*)
1067       case  ${tgt_os} in
1068         win*)
1069           enabled gcc && add_cflags -fno-common
1070           ;;
1071         solaris*)
1072           CC=${CC:-${CROSS}gcc}
1073           CXX=${CXX:-${CROSS}g++}
1074           LD=${LD:-${CROSS}gcc}
1075           CROSS=${CROSS:-g}
1076           ;;
1077         os2)
1078           disable_feature pic
1079           AS=${AS:-nasm}
1080           add_ldflags -Zhigh-mem
1081           ;;
1082       esac
1083
1084       AS="${alt_as:-${AS:-auto}}"
1085       case  ${tgt_cc} in
1086         icc*)
1087           CC=${CC:-icc}
1088           LD=${LD:-icc}
1089           setup_gnu_toolchain
1090           add_cflags -use-msasm  # remove -use-msasm too?
1091           # add -no-intel-extensions to suppress warning #10237
1092           # refer to http://software.intel.com/en-us/forums/topic/280199
1093           add_ldflags -i-static -no-intel-extensions
1094           enabled x86_64 && add_cflags -ipo -static -O3 -no-prec-div
1095           enabled x86_64 && AR=xiar
1096           case ${tune_cpu} in
1097             atom*)
1098               tune_cflags="-x"
1099               tune_cpu="SSE3_ATOM"
1100               ;;
1101             *)
1102               tune_cflags="-march="
1103               ;;
1104           esac
1105           ;;
1106         gcc*)
1107           link_with_cc=gcc
1108           tune_cflags="-march="
1109           setup_gnu_toolchain
1110           #for 32 bit x86 builds, -O3 did not turn on this flag
1111           enabled optimizations && disabled gprof && check_add_cflags -fomit-frame-pointer
1112           ;;
1113         vs*)
1114           # When building with Microsoft Visual Studio the assembler is
1115           # invoked directly. Checking at configure time is unnecessary.
1116           # Skip the check by setting AS arbitrarily
1117           AS=msvs
1118           msvs_arch_dir=x86-msvs
1119           vc_version=${tgt_cc##vs}
1120           case $vc_version in
1121             7|8|9|10)
1122               echo "${tgt_cc} does not support avx/avx2, disabling....."
1123               RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 "
1124               soft_disable avx
1125               soft_disable avx2
1126               ;;
1127           esac
1128           ;;
1129       esac
1130
1131       bits=32
1132       enabled x86_64 && bits=64
1133       check_cpp <<EOF && bits=x32
1134 #if !defined(__ILP32__) || !defined(__x86_64__)
1135 #error "not x32"
1136 #endif
1137 EOF
1138       case ${tgt_cc} in
1139         gcc*)
1140           add_cflags -m${bits}
1141           add_ldflags -m${bits}
1142           ;;
1143       esac
1144
1145       soft_enable runtime_cpu_detect
1146       # We can't use 'check_cflags' until the compiler is configured and CC is
1147       # populated.
1148       check_gcc_machine_option mmx
1149       check_gcc_machine_option sse
1150       check_gcc_machine_option sse2
1151       check_gcc_machine_option sse3
1152       check_gcc_machine_option ssse3
1153       check_gcc_machine_option sse4 sse4_1
1154       check_gcc_machine_option avx
1155       check_gcc_machine_option avx2
1156
1157       case "${AS}" in
1158         auto|"")
1159           which nasm >/dev/null 2>&1 && AS=nasm
1160           which yasm >/dev/null 2>&1 && AS=yasm
1161           if [ "${AS}" = nasm ] ; then
1162             # Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
1163             # this check if they start shipping a compatible version.
1164             apple=`nasm -v | grep "Apple"`
1165             [ -n "${apple}" ] \
1166               && echo "Unsupported version of nasm: ${apple}" \
1167               && AS=""
1168           fi
1169           [ "${AS}" = auto ] || [ -z "${AS}" ] \
1170             && die "Neither yasm nor nasm have been found"
1171           ;;
1172       esac
1173       log_echo "  using $AS"
1174       [ "${AS##*/}" = nasm ] && add_asflags -Ox
1175       AS_SFX=.asm
1176       case  ${tgt_os} in
1177         win32)
1178           add_asflags -f win32
1179           enabled debug && add_asflags -g cv8
1180           EXE_SFX=.exe
1181           ;;
1182         win64)
1183           add_asflags -f x64
1184           enabled debug && add_asflags -g cv8
1185           EXE_SFX=.exe
1186           ;;
1187         linux*|solaris*|android*)
1188           add_asflags -f elf${bits}
1189           enabled debug && [ "${AS}" = yasm ] && add_asflags -g dwarf2
1190           enabled debug && [ "${AS}" = nasm ] && add_asflags -g
1191           [ "${AS##*/}" = nasm ] && check_asm_align
1192           ;;
1193         darwin*)
1194           add_asflags -f macho${bits}
1195           enabled x86 && darwin_arch="-arch i386" || darwin_arch="-arch x86_64"
1196           add_cflags  ${darwin_arch}
1197           add_ldflags ${darwin_arch}
1198           # -mdynamic-no-pic is still a bit of voodoo -- it was required at
1199           # one time, but does not seem to be now, and it breaks some of the
1200           # code that still relies on inline assembly.
1201           # enabled icc && ! enabled pic && add_cflags -fno-pic -mdynamic-no-pic
1202           enabled icc && ! enabled pic && add_cflags -fno-pic
1203           ;;
1204         iphonesimulator)
1205           add_asflags -f macho${bits}
1206           enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
1207           add_cflags  ${sim_arch}
1208           add_ldflags ${sim_arch}
1209           ;;
1210         os2)
1211           add_asflags -f aout
1212           enabled debug && add_asflags -g
1213           EXE_SFX=.exe
1214           ;;
1215         *)
1216           log "Warning: Unknown os $tgt_os while setting up $AS flags"
1217           ;;
1218       esac
1219       ;;
1220     *-gcc|generic-gnu)
1221       link_with_cc=gcc
1222       enable_feature gcc
1223       setup_gnu_toolchain
1224       ;;
1225   esac
1226
1227   # Try to enable CPU specific tuning
1228   if [ -n "${tune_cpu}" ]; then
1229     if [ -n "${tune_cflags}" ]; then
1230       check_add_cflags ${tune_cflags}${tune_cpu} || \
1231         die "Requested CPU '${tune_cpu}' not supported by compiler"
1232     fi
1233     if [ -n "${tune_asflags}" ]; then
1234       check_add_asflags ${tune_asflags}${tune_cpu} || \
1235         die "Requested CPU '${tune_cpu}' not supported by assembler"
1236     fi
1237     if [ -z "${tune_cflags}${tune_asflags}" ]; then
1238       log_echo "Warning: CPU tuning not supported by this toolchain"
1239     fi
1240   fi
1241
1242   if enabled debug; then
1243     check_add_cflags -g && check_add_ldflags -g
1244   else
1245     check_add_cflags -DNDEBUG
1246   fi
1247
1248   enabled gprof && check_add_cflags -pg && check_add_ldflags -pg
1249   enabled gcov &&
1250     check_add_cflags -fprofile-arcs -ftest-coverage &&
1251     check_add_ldflags -fprofile-arcs -ftest-coverage
1252
1253   if enabled optimizations; then
1254     if enabled rvct; then
1255       enabled small && check_add_cflags -Ospace || check_add_cflags -Otime
1256     else
1257       enabled small && check_add_cflags -O2 ||  check_add_cflags -O3
1258     fi
1259   fi
1260
1261   if [ "${tgt_isa}" = "x86_64" ] || [ "${tgt_isa}" = "x86" ]; then
1262     soft_enable use_x86inc
1263   fi
1264
1265   # Position Independent Code (PIC) support, for building relocatable
1266   # shared objects
1267   enabled gcc && enabled pic && check_add_cflags -fPIC
1268
1269   # Work around longjmp interception on glibc >= 2.11, to improve binary
1270   # compatibility. See http://code.google.com/p/webm/issues/detail?id=166
1271   enabled linux && check_add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
1272
1273   # Check for strip utility variant
1274   ${STRIP} -V 2>/dev/null | grep GNU >/dev/null && enable_feature gnu_strip
1275
1276   # Try to determine target endianness
1277   check_cc <<EOF
1278 unsigned int e = 'O'<<24 | '2'<<16 | 'B'<<8 | 'E';
1279 EOF
1280     [ -f "${TMP_O}" ] && od -A n -t x1 "${TMP_O}" | tr -d '\n' |
1281         grep '4f *32 *42 *45' >/dev/null 2>&1 && enable_feature big_endian
1282
1283     # Try to find which inline keywords are supported
1284     check_cc <<EOF && INLINE="inline"
1285 static inline function() {}
1286 EOF
1287
1288   # Almost every platform uses pthreads.
1289   if enabled multithread; then
1290     case ${toolchain} in
1291       *-win*-vs*)
1292         ;;
1293       *-android-gcc)
1294         ;;
1295       *)
1296         check_header pthread.h && add_extralibs -lpthread
1297         ;;
1298     esac
1299   fi
1300
1301   # only for MIPS platforms
1302   case ${toolchain} in
1303     mips*)
1304       if enabled big_endian; then
1305         if enabled dspr2; then
1306           echo "dspr2 optimizations are available only for little endian platforms"
1307           disable_feature dspr2
1308         fi
1309         if enabled msa; then
1310           echo "msa optimizations are available only for little endian platforms"
1311           disable_feature msa
1312         fi
1313       fi
1314       ;;
1315   esac
1316
1317   # glibc needs these
1318   if enabled linux; then
1319     add_cflags -D_LARGEFILE_SOURCE
1320     add_cflags -D_FILE_OFFSET_BITS=64
1321   fi
1322 }
1323
1324 process_toolchain() {
1325   process_common_toolchain
1326 }
1327
1328 print_config_mk() {
1329   saved_prefix="${prefix}"
1330   prefix=$1
1331   makefile=$2
1332   shift 2
1333   for cfg; do
1334     if enabled $cfg; then
1335       upname="`toupper $cfg`"
1336       echo "${prefix}_${upname}=yes" >> $makefile
1337     fi
1338   done
1339   prefix="${saved_prefix}"
1340 }
1341
1342 print_config_h() {
1343   saved_prefix="${prefix}"
1344   prefix=$1
1345   header=$2
1346   shift 2
1347   for cfg; do
1348     upname="`toupper $cfg`"
1349     if enabled $cfg; then
1350       echo "#define ${prefix}_${upname} 1" >> $header
1351     else
1352       echo "#define ${prefix}_${upname} 0" >> $header
1353     fi
1354   done
1355   prefix="${saved_prefix}"
1356 }
1357
1358 print_config_vars_h() {
1359   header=$1
1360   shift
1361   while [ $# -gt 0 ]; do
1362     upname="`toupper $1`"
1363     echo "#define ${upname} $2" >> $header
1364     shift 2
1365   done
1366 }
1367
1368 print_webm_license() {
1369   saved_prefix="${prefix}"
1370   destination=$1
1371   prefix="$2"
1372   suffix="$3"
1373   shift 3
1374   cat <<EOF > ${destination}
1375 ${prefix} Copyright (c) 2011 The WebM project authors. All Rights Reserved.${suffix}
1376 ${prefix} ${suffix}
1377 ${prefix} Use of this source code is governed by a BSD-style license${suffix}
1378 ${prefix} that can be found in the LICENSE file in the root of the source${suffix}
1379 ${prefix} tree. An additional intellectual property rights grant can be found${suffix}
1380 ${prefix} in the file PATENTS.  All contributing project authors may${suffix}
1381 ${prefix} be found in the AUTHORS file in the root of the source tree.${suffix}
1382 EOF
1383   prefix="${saved_prefix}"
1384 }
1385
1386 process_targets() {
1387   true;
1388 }
1389
1390 process_detect() {
1391   true;
1392 }
1393
1394 enable_feature logging
1395 logfile="config.log"
1396 self=$0
1397 process() {
1398   cmdline_args="$@"
1399   process_cmdline "$@"
1400   if enabled child; then
1401     echo "# ${self} $@" >> ${logfile}
1402   else
1403     echo "# ${self} $@" > ${logfile}
1404   fi
1405   post_process_common_cmdline
1406   post_process_cmdline
1407   process_toolchain
1408   process_detect
1409   process_targets
1410
1411   OOT_INSTALLS="${OOT_INSTALLS}"
1412   if enabled source_path_used; then
1413   # Prepare the PWD for building.
1414   for f in ${OOT_INSTALLS}; do
1415     install -D "${source_path}/$f" "$f"
1416   done
1417   fi
1418   cp "${source_path}/build/make/Makefile" .
1419
1420   clean_temp_files
1421   true
1422 }