1 diff --git a/configure b/configure-posix
2 index 3cf63e0..1e1fce5 100755
9 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
11 @@ -59,7 +59,7 @@ exit 1
15 - echo -n "checking $1... " >> config.log
16 + echo "checking $1... " >> config.log
20 @@ -78,13 +78,12 @@ cc_cflags() {
21 # several non gcc compilers issue an incredibly large number of warnings on high warning levels,
22 # suppress them by reducing the warning level rather than having to use #pragmas
24 - [[ "$arg" = -falign-loops* ]] && arg=
26 + -falign-loops*|-mpreferred-stack-boundary*|-l*|-L*) arg=
28 [ "$arg" = -fno-tree-vectorize ] && arg=
29 [ "$arg" = -Wshadow ] && arg=
30 [ "$arg" = -Wno-maybe-uninitialized ] && arg=
31 - [[ "$arg" = -mpreferred-stack-boundary* ]] && arg=
32 - [[ "$arg" = -l* ]] && arg=
33 - [[ "$arg" = -L* ]] && arg=
34 if [ $compiler_style = MS ]; then
35 [ "$arg" = -ffast-math ] && arg="-fp:fast"
36 [ "$arg" = -Wall ] && arg=
37 @@ -100,14 +99,14 @@ cc_cflags() {
39 [ $compiler = CL -a "$arg" = -O3 ] && arg=-O2
41 - [ -n "$arg" ] && echo -n "$arg "
42 + [ -n "$arg" ] && printf %s "$arg "
48 - arg=${arg/LIBPATH/libpath}
49 - [ "${arg#-libpath:}" == "$arg" -a "${arg#-l}" != "$arg" ] && arg=${arg#-l}.lib
50 + arg=$(echo "$arg" | sed -e 's/LIBPATH/libpath/')
51 + [ "${arg#-libpath:}" = "$arg" -a "${arg#-l}" != "$arg" ] && arg=${arg#-l}.lib
52 [ "${arg#-L}" != "$arg" ] && arg=-libpath:${arg#-L}
53 [ "$arg" = -Wl,--large-address-aware ] && arg=-largeaddressaware
54 [ "$arg" = -s ] && arg=
55 @@ -116,14 +115,17 @@ cl_ldflags() {
56 [ "$arg" = -Werror ] && arg=
57 [ "$arg" = -Wshadow ] && arg=
58 [ "$arg" = -Wmaybe-uninitialized ] && arg=
59 - [[ "$arg" = -Qdiag-error* ]] && arg=
61 - arg=${arg/pthreadGC/pthreadVC}
66 + arg=$(echo "$arg" | sed -e 's/pthreadGC/pthreadVC/')
67 [ "$arg" = avifil32.lib ] && arg=vfw32.lib
68 [ "$arg" = gpac_static.lib ] && arg=libgpac_static.lib
69 [ "$arg" = x264.lib ] && arg=libx264.lib
71 - [ -n "$arg" ] && echo -n "$arg "
72 + [ -n "$arg" ] && printf %s "$arg "
76 @@ -180,7 +182,7 @@ cpp_check() {
78 echo "#include <$arg>" >> conftest.c
80 - echo -e "#if !($3) \n#error $4 \n#endif " >> conftest.c
81 + printf '%b\n' "#if !($3) \n#error $4 \n#endif " >> conftest.c
82 if [ $compiler_style = MS ]; then
83 cpp_cmd="$CC conftest.c $(cc_cflags $CFLAGS $2) -P"
85 @@ -329,11 +331,15 @@ rm -rf conftest*
87 # Construct a path to the specified directory relative to the working directory
89 - local base="${PWD%/}"
90 - local path="$(cd "$1" >/dev/null; printf '%s/.' "${PWD%/}")"
93 + path="$(cd "$1" >/dev/null; printf '%s/.' "${PWD%/}")"
101 - while [[ $path != "$base/"* ]]; do
105 @@ -564,48 +570,6 @@ trap 'rm -rf conftest*' EXIT
106 # test for use of compilers that require specific handling
107 cc_base="$(basename "$CC")"
109 -if [[ $host_os = mingw* || $host_os = cygwin* ]]; then
110 - if [[ "$cc_base" = icl || "$cc_base" = icl[\ .]* ]]; then
111 - # Windows Intel Compiler creates dependency generation with absolute Windows paths, Cygwin's make does not support Windows paths.
112 - [[ $host_os = cygwin* ]] && die "Windows Intel Compiler support requires MSYS"
115 - CFLAGS="$CFLAGS -Qstd=c99 -nologo -Qms0 -DHAVE_STRING_H -I\$(SRCPATH)/extras"
117 - cpp_check '' '' '_MSC_VER >= 1400' || die "Windows Intel Compiler support requires Visual Studio 2005 or newer"
118 - if cpp_check '' '' 'defined(_M_AMD64) || defined(_M_X64)' ; then
120 - elif cpp_check '' '' 'defined(_M_IX86)' ; then
123 - if cc_check '' -Qdiag-error:10006,10157 ; then
124 - CHECK_CFLAGS="$CHECK_CFLAGS -Qdiag-error:10006,10157"
126 - elif [[ "$cc_base" = cl || "$cc_base" = cl[\ .]* ]]; then
127 - # Standard Microsoft Visual Studio
130 - CFLAGS="$CFLAGS -nologo -GS- -DHAVE_STRING_H -I\$(SRCPATH)/extras"
131 - cpp_check '' '' '_MSC_VER > 1800 || (_MSC_VER == 1800 && _MSC_FULL_VER >= 180030324)' || die "Microsoft Visual Studio support requires Visual Studio 2013 Update 2 or newer"
132 - if cpp_check '' '' 'defined(_M_AMD64) || defined(_M_X64)' ; then
134 - elif cpp_check '' '' 'defined(_M_IX86)' ; then
136 - elif cpp_check '' '' 'defined(_M_ARM64)' ; then
138 - elif cpp_check '' '' 'defined(_M_ARM)' ; then
142 - # MinGW uses broken pre-VS2015 Microsoft printf functions unless it's told to use the POSIX ones.
143 - CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112L"
146 - if [[ "$cc_base" = icc || "$cc_base" = icc[\ .]* ]]; then
152 if [ $compiler = GNU ]; then
153 if cc_check '' -Werror=unknown-warning-option ; then
154 @@ -653,18 +617,6 @@ case $host_os in
158 - cygwin*|mingw*|msys*)
160 - if [[ $host_os = cygwin* ]] && cpp_check "" "" "defined(__CYGWIN__)" ; then
162 - define HAVE_MALLOC_H
166 - cc_check '' -lshell32 && LDFLAGSCLI="$LDFLAGSCLI -lshell32"
167 - [ $compiler = GNU ] && RC="${RC-${cross_prefix}windres}" || RC="${RC-rc.exe}"
173 @@ -705,30 +657,6 @@ LDFLAGS="$LDFLAGS $libm"
180 - ASFLAGS="$ASFLAGS -DARCH_X86_64=0 -I\$(SRCPATH)/common/x86/"
181 - if [ $compiler = GNU ]; then
182 - if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
183 - CFLAGS="$CFLAGS -march=i686"
185 - if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
186 - CFLAGS="$CFLAGS -mfpmath=sse -msse -msse2"
188 - CFLAGS="-m32 $CFLAGS"
189 - LDFLAGS="-m32 $LDFLAGS"
191 - if [ "$SYS" = MACOSX ]; then
192 - ASFLAGS="$ASFLAGS -f macho32 -DPREFIX"
193 - elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
194 - ASFLAGS="$ASFLAGS -f win32 -DPREFIX"
195 - LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
196 - [ $compiler = GNU ] && LDFLAGS="$LDFLAGS -Wl,--dynamicbase,--nxcompat,--tsaware"
197 - [ $compiler = GNU ] && RCFLAGS="--target=pe-i386 $RCFLAGS"
199 - ASFLAGS="$ASFLAGS -f elf32"
204 @@ -931,7 +859,7 @@ fi
206 if [ $asm = auto -a $ARCH = ARM ] ; then
207 # set flags so neon is built by default
208 - [ $compiler == CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
209 + [ $compiler = CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
211 cc_check '' '' '__asm__("add r0, r1, r2");' && define HAVE_ARM_INLINE_ASM
212 if [ $compiler = CL ] && cpp_check '' '' 'defined(_M_ARM) && _M_ARM >= 7' ; then
213 @@ -1576,7 +1504,8 @@ cat conftest.log >> config.log
216 [ "$SRCPATH" != "." ] && ln -sf ${SRCPATH}/Makefile ./Makefile
217 -mkdir -p common/{aarch64,arm,mips,ppc,x86} encoder extras filters/video input output tools
218 +mkdir -p common/aarch64 common/arm common/mips common/ppc common/x86
219 +mkdir -p encoder extras filters/video input output tools
222 echo "You can run 'make' or 'make fprofiled' now."