ifneq ($(HAVE_GETOPT_LONG),1)
SRCS += extras/getopt.c
-CFLAGS += -DHAVE_GETOPT_LONG=0
-else
-CFLAGS += -DHAVE_GETOPT_LONG=1
endif
OBJS = $(SRCS:%.c=%.o)
rm -f conftest*
cat > conftest.c << EOF
#include <$1>
-int main () { return 0; }
+int main () { $3 return 0; }
EOF
$CC $CFLAGS $LDFLAGS $2 conftest.c -o conftest 2>$DEVNULL
TMP="$?"
return $TMP
}
+rm -f config.h config.mak x264.pc
+
prefix='/usr/local'
exec_prefix='${prefix}'
bindir='${exec_prefix}/bin'
cc_check gpac/isomedia.h "$MP4_LDFLAGS" && mp4_output="yes"
fi
if [ "$mp4_output" = "yes" ] ; then
- CFLAGS="$CFLAGS -DMP4_OUTPUT"
+ echo "#define MP4_OUTPUT" >> config.h
LDFLAGS="$LDFLAGS $MP4_LDFLAGS"
fi
fi
fi
if [ "$avis_input" = "yes" ] ; then
- CFLAGS="$CFLAGS -DAVIS_INPUT"
+ echo "#define AVIS_INPUT" >> config.h
LDFLAGS="$LDFLAGS -lvfw32"
fi
VFW_LDFLAGS="$VFW_LDFLAGS -s"
fi
+if cc_check "stdio.h" "" "fseeko(stdin,0,0);" ; then
+ echo "#define fseek fseeko" >> config.h
+ echo "#define ftell ftello" >> config.h
+elif cc_check "stdio.h" "" "fseeko64(stdin,0,0);" ; then
+ echo "#define fseek fseeko64" >> config.h
+ echo "#define ftell ftello64" >> config.h
+fi
+
# generate config files
-rm -f config.mak
cat > config.mak << EOF
prefix=$prefix
exec_prefix=$exec_prefix
./version.sh
-rm -f x264.pc
cat > x264.pc << EOF
prefix=$prefix
exec_prefix=$exec_prefix
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#define _LARGEFILE_SOURCE
+#define _FILE_OFFSET_BITS 64
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
VER=`svnversion .`
if [ "x$VER" != x -a "$VER" != exported ]
then
- echo "#define X264_VERSION \" svn-$VER\"" > config.h
+ echo "#define X264_VERSION \" svn-$VER\"" >> config.h
VER=`echo $VER | sed -e 's/[^0-9].*//'`
else
- echo "#define X264_VERSION \"\"" > config.h
+ echo "#define X264_VERSION \"\"" >> config.h
VER="x"
fi
API=`grep '#define X264_BUILD' < x264.h | sed -e 's/.* \([1-9][0-9]*\).*/\1/'`
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+#define _LARGEFILE_SOURCE
+#define _FILE_OFFSET_BITS 64
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h> /* _O_BINARY */
#endif
+#ifndef _MSC_VER
+#include "config.h"
+#endif
+
#ifdef AVIS_INPUT
#include <windows.h>
#include <vfw.h>
#include "common/common.h"
#include "x264.h"
-#ifndef _MSC_VER
-#include "config.h"
-#endif
-
#include "matroska.h"
#define DATA_MAX 3000000
if( !fseek( f, 0, SEEK_END ) )
{
- int64_t i_size = ftell( f );
+ off_t i_size = ftell( f );
fseek( f, 0, SEEK_SET );
i_frame_total = (int)(i_size / ( i_width * i_height * 3 / 2 ));
}
FILE *f = (FILE *)handle;
if( i_frame != prev_frame+1 )
- if( fseek( f, i_frame * i_width * i_height * 3 / 2, SEEK_SET ) )
+ if( fseek( f, (off_t)i_frame * i_width * i_height * 3 / 2, SEEK_SET ) )
return -1;
if( fread( p_pic->img.plane[0], 1, i_width * i_height, f ) <= 0