Commit 5100f0cd authored by Felix Paul Kühne's avatar Felix Paul Kühne

Updated x264 to use Git

parent 56354a01
...@@ -170,3 +170,9 @@ elif svn help >/dev/null 2>&1; then ...@@ -170,3 +170,9 @@ elif svn help >/dev/null 2>&1; then
else else
echo "You do not have a subversion client installed." >&2 echo "You do not have a subversion client installed." >&2
fi fi
if git help >/dev/null 2>&1; then
echo "GIT = `which git`" >> config.mak
else
echo "You do not have a Git client in your PATH." >&2
fi
...@@ -1185,33 +1185,54 @@ CLEAN_PKG += libdca ...@@ -1185,33 +1185,54 @@ CLEAN_PKG += libdca
# libx264 # libx264
# *************************************************************************** # ***************************************************************************
ifdef SVN x264-$(X264_VERSION).tar.gz:
x264: $(WGET) $(X264_URL)
$(SVN) co svn://svn.videolan.org/x264/trunk/ -r 736 x264
ifdef GIT
x264:
$(GIT) clone git://git.videolan.org/x264.git
patch -p0 < Patches/x264-svn-info-threads.patch
ifdef HAVE_WIN32 ifdef HAVE_WIN32
(cd $@; patch -p 0 < ../Patches/x264-svn-win32.patch ) (cd x264; patch -p0 < ../Patches/x264-svn-win32.patch )
endif endif
ifdef HAVE_DARWIN_OS ifdef HAVE_DARWIN_OS
(cd $@; patch -p 0 < ../Patches/x264-svn-darwin.patch ) (cd $@; patch -p0 < ../Patches/x264-svn-darwin.patch )
endif endif
else else
x264-$(X264_VERSION).tar.gz:
$(WGET) $(X264_URL)
x264: x264-$(X264_VERSION).tar.gz x264: x264-$(X264_VERSION).tar.gz
$(EXTRACT_GZ) $(EXTRACT_GZ)
ifdef HAVE_WIN32 ifdef HAVE_WIN32
(cd x264;patch -p 0 <../Patches/x264-20050624-win32.patch) ifndef HAVE_CYGWIN
(cd x264;patch -p0 <../Patches/x264-20050624-win32.patch)
endif
else else
patch -p 0 < Patches/x264.patch patch -p0 < Patches/x264.patch
rm x264/x264.c rm x264/x264.c
endif endif
endif endif
ifdef HAVE_WIN32
.x264: x264 .pthreads
ifdef HAVE_CYGWIN
(cd $<; $(HOSTCC) RANLIB="ranlib" AR="ar" STRIP="strip" ./configure $(X264CONF) --prefix="$(PREFIX)" --extra-cflags="-I$(PREFIX)/include" --extra-ldflags="-L$(PREFIX)/lib" && make && make install)
else
(cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
endif
else
.x264: x264 .x264: x264
(cd $<; ./configure $(X264CONF) --prefix="$(PREFIX)" --enable-pic && make && make install) (cd $<; $(HOSTCC) ./configure $(X264CONF) --prefix="$(PREFIX)" && make && make install)
endif
touch $@ touch $@
ifdef SVN
x264-source: x264
tar cfvz x264-$(DATE).tar.gz x264
SOURCE += x264-source
endif
CLEAN_FILE += .x264 CLEAN_FILE += .x264
CLEAN_PKG += x264 CLEAN_PKG += x264
DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz DISTCLEAN_PKG += x264-$(X264_VERSION).tar.gz
......
Index: x264/encoder/encoder.c
===================================================================
--- x264/encoder/encoder.c (revision 736)
+++ x264/encoder/encoder.c (working copy)
@@ -360,6 +360,7 @@
h->param.b_pre_scenecut = 1;
#endif
}
+ x264_log( h, X264_LOG_INFO, "using threads=%d\n", h->param.i_threads );
if( h->param.b_interlaced )
{
Index: configure Index: configure
=================================================================== ===================================================================
--- configure (rvision 547) --- configure (revision 736)
+++ configure (copie de travail) +++ configure (working copy)
@@ -66,43 +66,142 @@ @@ -338,6 +338,7 @@
EXE=""
-UNAMES="`uname -s`"
+AR="ar"
+AROPTS="rc"
+RANLIB="ranlib"
+
+UNAMES="`uname -s |tr A-Z a-z`"
+UNAMEM="`uname -m |tr A-Z a-z`"
+
+# parse options
+
+for opt do
+ optarg="${opt#*=}"
+ case "$opt" in
+ --crosscompile=*)
+ CROSS="$optarg"
+ CC="$CROSS-gcc"
+ AR="$CROSS-ar"
+ RANLIB="$CROSS-ranlib"
+ UNAMES="`echo $CROSS | cut -d- -f2`"
+ UNAMEM="`echo $CROSS | cut -d- -f1`"
+ ;;
+ --prefix=*)
+ prefix="$optarg"
+ ;;
+ --exec-prefix=*)
+ eprefix="$optarg"
+ ;;
+ --bindir=*)
+ bindir="$optarg"
+ ;;
+ --libdir=*)
+ libdir="$optarg"
+ ;;
+ --includedir=*)
+ includedir="$optarg"
+ ;;
+ --enable-avis-input)
+ if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
+ CFLAGS="$CFLAGS -DAVIS_INPUT"
+ LDFLAGS="$LDFLAGS -lvfw32"
+ avis_input="yes"
+ fi
+ ;;
+ --enable-mp4-output)
+ CFLAGS="$CFLAGS -DMP4_OUTPUT"
+ LDFLAGS="$LDFLAGS -lgpac_static"
+ if [ $SYS = CYGWIN -o $SYS = MINGW ]; then
+ LDFLAGS="$LDFLAGS -lwinmm"
+ fi
+ mp4_output="yes"
+ ;;
+ --extra-asflags=*)
+ ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
+ ;;
+ --extra-cflags=*)
+ CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
+ VFW_CFLAGS="${opt#--extra-cflags=}"
+ ;;
+ --extra-ldflags=*)
+ LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
+ VFW_LDFLAGS="${opt#--extra-ldflags=}"
+ ;;
+ --enable-pthread)
+ CFLAGS="$CFLAGS -DHAVE_PTHREAD=1"
+ pthread="yes"
+ case $SYS in
+ MINGW|CYGWIN|BEOS)
+ ;;
+ *)
+ LDFLAGS="$LDFLAGS -lpthread"
+ ;;
+ esac
+ ;;
+ --enable-debug)
+ CFLAGS="$CFLAGS -g"
+ debug="yes"
+ ;;
+ --enable-gprof)
+ CFLAGS="$CFLAGS -pg"
+ LDFLAGS="$LDFLAGS -pg"
+ gprof="yes"
+ ;;
+ --enable-pic)
+ CFLAGS="$CFLAGS -fPIC"
+ ASFLAGS="$ASFLAGS -D__PIC__"
+ pic="yes"
+ ;;
+ --enable-vfw)
+ vfw="yes"
+ ;;
+ --enable-visualize)
+ LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
+ CFLAGS="$CFLAGS -DVISUALIZE=1"
+ vis="yes"
+ ;;
+ *)
+ echo "Unknown option $opt, ignored"
+ ;;
+ esac
+done
+
case "$UNAMES" in
- BeOS)
+ beos)
SYS="BEOS"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
;;
- Darwin)
+ darwin)
SYS="MACOSX"
CFLAGS="$CFLAGS -falign-loops=16"
LDFLAGS="$LDFLAGS -lm -lmx"
;;
- FreeBSD)
+ freebsd)
SYS="FREEBSD"
LDFLAGS="$LDFLAGS -lm"
;;
- NetBSD)
+ netbsd)
SYS="NETBSD"
LDFLAGS="$LDFLAGS -lm"
;;
- Linux)
+ linux)
SYS="LINUX"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
LDFLAGS="$LDFLAGS -lm"
;;
- CYGWIN*)
+ cygwin*)
SYS="CYGWIN"
CFLAGS="$CFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
EXE=".exe"
DEVNULL="NUL"
;;
- MINGW*)
+ mingw*)
SYS="MINGW"
EXE=".exe"
DEVNULL="NUL"
;;
- SunOS)
+ sunos)
SYS="SunOS"
CFLAGS="$CFLAGS -DHAVE_MALLOC_H"
LDFLAGS="$LDFLAGS -lm"
@@ -114,9 +213,8 @@
;;
esac
-UNAMEM="`uname -m`"
case "$UNAMEM" in
- i386|i486|i586|i686|BePC)
+ i386|i486|i586|i686|bepc)
ARCH="X86"
CFLAGS="$CFLAGS -DHAVE_MMXEXT -DHAVE_SSE2"
AS="nasm"
@@ -137,7 +235,7 @@
AS="yasm"
ASFLAGS="-f elf -m amd64"
;;
- "Power Macintosh"|ppc|ppc64)
+ "power macintosh"|ppc|ppc64)
ARCH="PPC"
if [ $SYS = MACOSX ]
then
@@ -186,89 +282,6 @@
CFLAGS="$CFLAGS -DARCH_$ARCH -DSYS_$SYS"
# parse options
-
-for opt do
- optarg="${opt#*=}"
- case "$opt" in
- --prefix=*)
- prefix="$optarg"
- ;;
- --exec-prefix=*)
- exec_prefix="$optarg"
- ;;
- --bindir=*)
- bindir="$optarg"
- ;;
- --libdir=*)
- libdir="$optarg"
- ;;
- --includedir=*)
- includedir="$optarg"
- ;;
- --enable-avis-input)
- avis_input="yes"
- ;;
- --disable-avis-input)
- avis_input="no"
- ;;
- --enable-mp4-output)
- mp4_output="yes"
- ;;
- --disable-mp4-output)
- mp4_output="no"
- ;;
- --extra-asflags=*)
- ASFLAGS="$ASFLAGS ${opt#--extra-asflags=}"
- ;;
- --extra-cflags=*)
- CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
- VFW_CFLAGS="${opt#--extra-cflags=}"
- ;;
- --extra-ldflags=*)
- LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
- VFW_LDFLAGS="${opt#--extra-ldflags=}"
- ;;
- --enable-pthread)
- pthread="yes"
- ;;
- --disable-pthread)
- pthread="no"
- ;;
- --enable-debug)
- CFLAGS="$CFLAGS -g"
- debug="yes"
- ;;
- --enable-gprof)
- CFLAGS="$CFLAGS -pg"
- LDFLAGS="$LDFLAGS -pg"
- gprof="yes"
- ;;
- --enable-pic)
- pic="yes"
- ;;
- --enable-vfw)
- vfw="yes"
- ;;
- --disable-vfw)
- vfw="no"
- ;;
- --enable-shared)
- shared="yes"
- if [ $ARCH = "X86_64" -o $ARCH = "PPC" -o $ARCH = "ALPHA" ] ; then
- pic="yes"
- fi
- ;;
- --enable-visualize)
- LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11"
- CFLAGS="$CFLAGS -DVISUALIZE=1"
- vis="yes"
- ;;
- *)
- echo "Unknown option $opt, ignored"
- ;;
- esac
-done
-
# autodetect options that weren't forced nor disabled # autodetect options that weren't forced nor disabled
libpthread=""
+extradef=""
if test "$pthread" = "auto" ; then if test "$pthread" = "auto" ; then
@@ -360,5 +363,8 @@ pthread="no"
VFW=$vfw case $SYS in
@@ -345,16 +346,18 @@
pthread="yes"
;;
MINGW|CYGWIN)
- if cc_check pthread.h -lpthread "pthread_create(0,0,0,0);" ; then
+ if cc_check pthread.h -lpthread "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
pthread="yes"
libpthread="-lpthread"
- elif cc_check pthread.h -lpthreadGC2 "pthread_create(0,0,0,0);" ; then
+ elif cc_check pthread.h -lpthreadGC2 "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
pthread="yes"
libpthread="-lpthreadGC2"
- elif cc_check pthread.h "-lpthreadGC2 -lwsock32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0);" ; then
+ elif cc_check pthread.h "-lpthreadGC2 -lwsock32 -DPTW32_STATIC_LIB" "pthread_create(0,0,0,0); pthread_num_processors_np();" ; then
pthread="yes"
libpthread="-lpthreadGC2 -lwsock32"
CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
+ extradef="-DPTW32_STATIC_LIB"
+
fi
;;
*)
@@ -438,6 +441,10 @@
ASFLAGS=$ASFLAGS
GTK=$gtk
EXE=$EXE EXE=$EXE
+AR=$AR +AR=$AR
+STRIP=$STRIP
+AROPTS=$AROPTS +AROPTS=$AROPTS
+RANLIB=$RANLIB +RANLIB=$RANLIB
VIS=$vis VIS=$vis
HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG HAVE_GETOPT_LONG=$HAVE_GETOPT_LONG
DEVNULL=$DEVNULL DEVNULL=$DEVNULL
@@ -480,7 +487,7 @@
Description: H.264 (MPEG4 AVC) encoder library
Version: $(grep POINTVER < config.h | sed -e 's/.* "//; s/".*//')
Libs: $pclibs
-Cflags: -I$includedir
+Cflags: -I$includedir $extradef
EOF
Index: Makefile Index: Makefile
=================================================================== ===================================================================
--- Makefile (rvision 547) --- Makefile (revision 736)
+++ Makefile (copie de travail) +++ Makefile (working copy)
@@ -64,8 +64,8 @@ @@ -74,8 +74,8 @@
default: $(DEP) x264$(EXE) default: $(DEP) x264$(EXE)
libx264.a: .depend $(OBJS) $(OBJASM) libx264.a: .depend $(OBJS) $(OBJASM)
...@@ -288,8 +67,18 @@ Index: Makefile ...@@ -288,8 +67,18 @@ Index: Makefile
$(SONAME): .depend $(OBJS) $(OBJASM) $(SONAME): .depend $(OBJS) $(OBJASM)
$(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS) $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,-soname,$(SONAME) $(LDFLAGS)
@@ -135,14 +135,14 @@ @@ -94,7 +94,7 @@
rm -f config.mak config.h vfw/build/cygwin/config.mak gtk/config.mak x264.pc %.o: %.asm
$(AS) $(ASFLAGS) -o $@ $<
# delete local/anonymous symbols, so they don't show up in oprofile
- -@ strip -x $@
+ -@ $(STRIP) -x $@
.depend: config.mak
rm -f .depend
@@ -149,14 +149,14 @@
rm -rf test/
$(MAKE) -C gtk distclean
-install: x264 $(SONAME) -install: x264 $(SONAME)
+install: x264$(EXE) +install: x264$(EXE)
...@@ -300,8 +89,8 @@ Index: Makefile ...@@ -300,8 +89,8 @@ Index: Makefile
install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
- install x264 $(DESTDIR)$(bindir) - install x264 $(DESTDIR)$(bindir)
- ranlib $(DESTDIR)$(libdir)/libx264.a - ranlib $(DESTDIR)$(libdir)/libx264.a
+ install x264$(EXE) $(DESTDIR)$(bindir) + install x264$(EXE) $(DESTDIR)$(bindir)
+ $(RANLIB) $(DESTDIR)$(libdir)/libx264.a + $(RANLIB) $(DESTDIR)$(libdir)/libx264.a
$(if $(SONAME), ln -sf $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.so) $(if $(SONAME), ln -sf $(SONAME) $(DESTDIR)$(libdir)/libx264.so)
$(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir)) $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
...@@ -175,8 +175,8 @@ UPNP_URL=$(SF)/upnp/libupnp-$(UPNP_VERSION).tar.gz ...@@ -175,8 +175,8 @@ UPNP_URL=$(SF)/upnp/libupnp-$(UPNP_VERSION).tar.gz
EXPAT_VERSION=1.95.8 EXPAT_VERSION=1.95.8
EXPAT_URL=$(SF)/expat/expat-$(EXPAT_VERSION).tar.gz EXPAT_URL=$(SF)/expat/expat-$(EXPAT_VERSION).tar.gz
NASM_CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nasm NASM_CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/nasm
NASM_VERSION=0.98.40-20060130 NASM_VERSION=2.02
NASM_URL=$(VIDEOLAN)/testing/contrib/nasm-0.98.40-20060130.tar.bz2 NASM_URL=$(SF)/nasm/nasm-$(NASM_VERSION).tar.bz2
PTHREADS_VERSION=2-7-0 PTHREADS_VERSION=2-7-0
PTHREADS_URL=ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz PTHREADS_URL=ftp://sources.redhat.com/pub/pthreads-win32/pthreads-w32-$(PTHREADS_VERSION)-release.tar.gz
UNICOWS_VERSION=1.1.1 UNICOWS_VERSION=1.1.1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment