LDFLAGS="$LDFLAGS -lm"
;;
cygwin*)
- SYS="WINDOWS"
EXE=".exe"
- DEVNULL="NUL"
if cc_check "" -mno-cygwin; then
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
fi
+ if cpp_check "" "" "defined(__CYGWIN32__)" ; then
+ define HAVE_MALLOC_H
+ SYS="CYGWIN"
+ else
+ SYS="WINDOWS"
+ DEVNULL="NUL"
+ fi
;;
mingw*)
SYS="WINDOWS"
fi
if [ "$SYS" = MACOSX ]; then
ASFLAGS="$ASFLAGS -f macho -DPREFIX"
- elif [ "$SYS" = WINDOWS ]; then
+ elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
ASFLAGS="$ASFLAGS -f win32 -DPREFIX"
LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
else
if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
if ! as_check "vpaddw xmm0, xmm0, xmm0" ; then
- VER=`($AS --version || echo no assembler) 2>$DEVNULL | head -n 1`
+ VER=`($AS --version || echo no assembler) 2>/dev/null | head -n 1`
echo "Found $VER"
echo "Minimum version is yasm-0.7.0"
echo "If you really want to compile without asm, configure with --disable-asm."
exit 1
fi
if ! cc_check '' '' '__asm__("pabsw %xmm0, %xmm0");' ; then
- VER=`(${cross_prefix}as --version || echo no gnu as) 2>$DEVNULL | head -n 1`
+ VER=`(${cross_prefix}as --version || echo no gnu as) 2>/dev/null | head -n 1`
echo "Found $VER"
echo "Minimum version is binutils-2.17"
echo "Your compiler can't handle inline SSSE3 asm."
# skip endianness check for Intel Compiler, as all supported platforms are little. the -ipo flag will also cause the check to fail
if [ $compiler = GNU ]; then
echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
- $CC $CFLAGS conftest.c -c -o conftest.o 2>$DEVNULL || die "endian test failed"
+ $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
define WORDS_BIGENDIAN
elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then
define HAVE_POSIXTHREAD
fi
if [ "$thread" = "win32" ]; then
+ # cygwin does not support win32 threads
if [ "$SYS" = "WINDOWS" ]; then
define HAVE_WIN32THREAD
else
if [ "$swscale" = "auto" ] ; then
swscale="no"
- if ${cross_prefix}pkg-config --exists libswscale 2>$DEVNULL; then
+ if ${cross_prefix}pkg-config --exists libswscale 2>/dev/null; then
SWSCALE_LIBS="$SWSCALE_LIBS $(${cross_prefix}pkg-config --libs libswscale)"
SWSCALE_CFLAGS="$SWSCALE_CFLAGS $(${cross_prefix}pkg-config --cflags libswscale)"
fi
if [ "$lavf" = "auto" ] ; then
lavf="no"
- if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>$DEVNULL; then
+ if ${cross_prefix}pkg-config --exists libavformat libavcodec libswscale 2>/dev/null; then
LAVF_LIBS="$LAVF_LIBS $(${cross_prefix}pkg-config --libs libavformat libavcodec libavutil libswscale)"
LAVF_CFLAGS="$LAVF_CFLAGS $(${cross_prefix}pkg-config --cflags libavformat libavcodec libavutil libswscale)"
fi
ffms_major="2"; ffms_minor="14"; ffms_micro="0"; ffms_bump="0"
ffms="no"
- if ${cross_prefix}pkg-config --exists ffms2 2>$DEVNULL; then
+ if ${cross_prefix}pkg-config --exists ffms2 2>/dev/null; then
FFMS2_LIBS="$FFMS2_LIBS $(${cross_prefix}pkg-config --libs ffms2)"
FFMS2_CFLAGS="$FFMS2_CFLAGS $(${cross_prefix}pkg-config --cflags ffms2)"
fi
if [ "$avs" = "auto" ] ; then
avs="no"
- if [ $SYS = WINDOWS ] && cc_check extras/avisynth_c.h ; then
+ # cygwin can use avisynth if it can use LoadLibrary
+ if [ $SYS = WINDOWS ] || ([ $SYS = CYGWIN ] && cc_check windows.h "" "LoadLibrary(0);") ; then
avs="yes"
define HAVE_AVS
fi
if [ "$shared" = "yes" ]; then
API=$(grep '#define X264_BUILD' < x264.h | cut -f 3 -d ' ')
- if [ "$SYS" = "WINDOWS" ]; then
+ if [ "$SYS" = "WINDOWS" -o "$SYS" = "CYGWIN" ]; then
echo "SONAME=libx264-$API.dll" >> config.mak
if [ $compiler = ICL ]; then
echo 'IMPLIBNAME=libx264.dll.lib' >> config.mak