diff options
author | konablend <[email protected]> | 2009-03-01 17:03:11 +0000 |
---|---|---|
committer | konablend <[email protected]> | 2009-03-01 17:03:11 +0000 |
commit | 4dbce6b69967c1e14092637aa95b6c31855a81fc (patch) | |
tree | 516c17095967698eeb419c70ce72dbd2c11bf754 /libhb | |
parent | c47939541ccec1e5e57753b16b28baed2613f586 (diff) |
BuildSystem: conversion from jam-based to make-based system.
KNOWN ISSUES:
1. OSX + Xcode builds do not support parallel builds; attempting to
use them may cause unbounded number of jobs. However, disabling
via configure --disable-xcode avoids the issue.
2. OSX ppc binary produces binary which has audio-scan problems.
3. OSX ppc64 binary has not been runtime tested.
ADDED:
00-BuildUserGuide.txt
contrib/*/module.*
doc/
make/
libhb/module.*
test/module.*
macos/module.*
gtk/module.*
DROPPED:
BUILD
BuildContribDarwin.sh
DownloadMacOsXContribBinaries.sh
Jamfile
Jamrules
MacOsXContribBinariesVersion.txt
Makefile
Makefile.config
jam
libhb/Jamefile
libhb/Makefile
test/BUILDSHARED
test/Makefile
contrib/Jamfile
contrib/Makefile
contrib/patch-ffmpeg.patch
contrib/patch-x264-idr.patch
contrib/patch-x264-linux.patch
RENAMED:
contrib/*.patch -> contrib/MODULE/[AP]??-*.patch
macosx/HandBrake.plist -> macosx/Info.plist
MODIFIED: libhb/decavcodec.c
Patched to use cleaner include "libavcodec/audioconvert".
Second part to support this cleanup is ffmpeg A02-audioconvert.patch .
MODIFIED: libhb/hb.c
MODIFIED: libhb/hb.h
MODIFIED: libhb/muxmkv.c
MODIFIED: libhb/muxmp4.c
MODIFIED: libhb/update.c
Patched to use "project.h" for project metadata.
Renamed HB_BUILD -> HB_PROJECT_BUILD.
Renamed HB_VERSION -> HB_PROJECT_VERSION.
MODIFIED: test/test.c:
Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems.
Reference r1803 as similar patch for HandBrake.app .
Unpatched behavior is crash/buserror when using ZFS.
MODIFIED: macosx/Growl.framework/
Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64).
New architectures facilitate x86_64 and ppc64 builds.
MODIFIED: macosx/HandBrake.xcodeproj/
Bumped compatibilty mode from 2.4 -> 3.1 .
Dumped old configurations Deployment, Developer.
Added configurations standard, sebug as replacements.
Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 .
for explicit architecture build.
All configurations settings cleaned up and normalized.
Build output directories adjusted to support new build system.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/Jamfile | 40 | ||||
-rw-r--r-- | libhb/Makefile | 101 | ||||
-rw-r--r-- | libhb/decavcodec.c | 4 | ||||
-rw-r--r-- | libhb/hb.c | 4 | ||||
-rw-r--r-- | libhb/hb.h | 2 | ||||
-rw-r--r-- | libhb/module.defs | 47 | ||||
-rw-r--r-- | libhb/module.rules | 28 | ||||
-rw-r--r-- | libhb/muxmkv.c | 2 | ||||
-rw-r--r-- | libhb/muxmp4.c | 2 | ||||
-rw-r--r-- | libhb/project.h.m4 | 33 | ||||
-rw-r--r--[-rwxr-xr-x] | libhb/stream.c | 0 | ||||
-rw-r--r-- | libhb/update.c | 12 |
12 files changed, 120 insertions, 155 deletions
diff --git a/libhb/Jamfile b/libhb/Jamfile deleted file mode 100644 index 364e17ff2..000000000 --- a/libhb/Jamfile +++ /dev/null @@ -1,40 +0,0 @@ -# $Id: Jamfile,v 1.34 2005/10/15 18:05:03 titer Exp $ -# -# This file is part of the HandBrake source code. -# Homepage: <http://handbrake.fr/>. -# It may be used under the terms of the GNU General Public License. - -SubDir TOP libhb : hbversion.h ; - -LIBHB_SRC = -common.c hb.c ports.c scan.c work.c decmpeg2.c encavcodec.c update.c -demuxmpeg.c fifo.c render.c reader.c muxcommon.c muxmp4.c sync.c stream.c -decsub.c deca52.c decdca.c encfaac.c declpcm.c encx264.c decavcodec.c encxvid.c -muxavi.c enclame.c muxogm.c encvorbis.c dvd.c muxmkv.c deblock.c deinterlace.c -denoise.c detelecine.c decomb.c lang.c enctheora.c decmetadata.c ; - -Library libhb : $(LIBHB_SRC) ; - -ObjectCcFlags $(LIBHB_SRC) : -I$(TOP)/contrib/include ; -ObjectDefines $(LIBHB_SRC) : __LIBHB__ ; -ObjectC++Flags $(LIBHB_SRC) : -I$(TOP)/contrib/include ; - -# turn the version number, etc., into an include file for cretinous build -# systems (XCode) that can't run shell commands -rule HBVersion -{ - Clean clean : $(TOP)/libhb/$(1) ; -} -actions HBVersion -{ - echo "#ifndef HB_BUILD" > $(TOP)/libhb/$(1) - echo "#define HB_BUILD $(HB_BUILD)" >> $(TOP)/libhb/$(1) - echo "#endif" >> $(TOP)/libhb/$(1) - echo "#ifndef HB_VERSION" >> $(TOP)/libhb/$(1) - echo "#define HB_VERSION \"$(HB_VERSION)\"" >> $(TOP)/libhb/$(1) - echo "#endif" >> $(TOP)/libhb/$(1) - echo "#ifndef HB_APPCAST_URL" >> $(TOP)/libhb/$(1) - echo "#define APPCAST_URL \"$(APPCAST_URL)\"" >> $(TOP)/libhb/$(1) - echo "#endif" >> $(TOP)/libhb/$(1) -} -HBVersion hbversion.h ; diff --git a/libhb/Makefile b/libhb/Makefile deleted file mode 100644 index 9992d7cd5..000000000 --- a/libhb/Makefile +++ /dev/null @@ -1,101 +0,0 @@ -include ../Makefile.config - -SYSTEM = $(shell uname -s) - -ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) - SYSDEF=-DSYS_CYGWIN -endif - -ifeq ($(SYSTEM),FreeBSD) - SYSDEF = -DSYS_FREEBSD - LDFLAGS += -pthread -lm -endif - -ifeq ($(SYSTEM),NetBSD) - SYSDEF = -DSYS_NETBSD - LDFLAGS += -lpthread -lm -endif - -ifeq ($(SYSTEM),Linux) - SYSDEF = -DSYS_LINUX $(HB_DEFPPC) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 - LDFLAGS += -lpthread -lm -ldl -endif - -SRCS = common.c hb.c ports.c scan.c work.c decmpeg2.c encavcodec.c enctheora.c \ - update.c demuxmpeg.c fifo.c render.c reader.c muxcommon.c stream.c \ - muxmp4.c sync.c decsub.c deca52.c decdca.c encfaac.c declpcm.c encx264.c \ - decavcodec.c encxvid.c muxmkv.c muxavi.c enclame.c muxogm.c encvorbis.c \ - dvd.c deblock.c deinterlace.c denoise.c detelecine.c decomb.c lang.c \ - decmetadata.c -OTMP = $(SRCS:%.c=%.o) -OBJS = $(OTMP:%.cpp=%.o) - -CONTRIBS = ../contrib/lib/liba52.a ../contrib/lib/libavformat.a \ - ../contrib/lib/libavcodec.a ../contrib/lib/libavutil.a \ - ../contrib/lib/libdca.a ../contrib/lib/libdvdread.a \ - ../contrib/lib/libfaac.a ../contrib/lib/libmp3lame.a \ - ../contrib/lib/libmpeg2.a ../contrib/lib/libmpeg2convert.a \ - ../contrib/lib/libvorbis.a ../contrib/lib/libvorbisenc.a \ - ../contrib/lib/libvorbisfile.a ../contrib/lib/libogg.a \ - ../contrib/lib/libsamplerate.a ../contrib/lib/libx264.a \ - ../contrib/lib/libxvidcore.a ../contrib/lib/libmp4v2.a \ - ../contrib/lib/libmkv.a ../contrib/lib/libswscale.a \ - ../contrib/lib/libtheora.a ../contrib/lib/libfaad.a - -ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) - CONTRIBS += ../contrib/lib/libz.a ../contrib/lib/libbz2.a -endif - -CFLAGS += -I../contrib/include -D__LIBHB__ -DUSE_PTHREAD $(SYSDEF) -Wall -g -O3 -funroll-loops - -CXXFLAGS += -I../contrib/include -D__LIBHB__ -DUSE_PTHREAD $(SYSDEF) - -ifeq ($(findstring CYGWIN_NT,$(SYSTEM)),CYGWIN_NT) -all: libhb.a libhb.dll -else -all: libhb.a - -endif - -libhb.a: $(OBJS) - @echo "Library $@" - @ar ru $@ $(OBJS) - @ranlib $@ - -libhb.so: $(OBJS) - @echo "Shared library $@" - @g++ -o $@ $(OBJS) $(CONTRIBS) -shared $(CFLAGS) || \ - ( echo "Compile line for $@ was:"; echo $$CMD; false ) - -libhb.dll: $(OBJS) - @echo "Shared library $@" - @g++ -o $@ $(OBJS) $(CONTRIBS) -shared $(CFLAGS) || \ - ( echo "Compile line for $@ was:"; echo $$CMD; false ) - -%.o: %.c - @echo "Cc $@" - echo $(CC) $(CFLAGS) - @CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \ - ( echo "Compile line for $@ was:"; echo $$CMD; false ) - -%.o: %.cpp - @echo "Cc $@" - @CMD="$(CC) $(CFLAGS) -o $@ -c $<"; $$CMD || \ - ( echo "Compile line for $@ was:"; echo $$CMD; false ) - - -clean: - @echo "Clean libhb.a" - @$(RM) libhb.* - @echo "Clean libhb.so" - @$(RM) libhb.so - @echo "Clean $(OBJS)" - @$(RM) $(OBJS) - -.depend: $(SRCS) - @echo "Checking dependencies..." - @$(RM) .depend - @$(foreach SRC, $(SRCS), $(CC) -MM $(SRC) $(CFLAGS) >> .depend;) - --include .depend - diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c index 5dd22244c..e5c8fd10c 100644 --- a/libhb/decavcodec.c +++ b/libhb/decavcodec.c @@ -61,9 +61,7 @@ #include "hb.h" #include "hbffmpeg.h" - -//#include "libavcodec/audioconvert.h" -#include "../contrib/ffmpeg/libavcodec/audioconvert.h" +#include "libavcodec/audioconvert.h" static int decavcodecInit( hb_work_object_t *, hb_job_t * ); static int decavcodecWork( hb_work_object_t *, hb_buffer_t **, hb_buffer_t ** ); diff --git a/libhb/hb.c b/libhb/hb.c index 08bea4bf2..0e36465fd 100644 --- a/libhb/hb.c +++ b/libhb/hb.c @@ -257,7 +257,7 @@ hb_handle_t * hb_init_dl( int verbose, int update_check ) */ char * hb_get_version( hb_handle_t * h ) { - return HB_VERSION; + return HB_PROJECT_VERSION; } /** @@ -267,7 +267,7 @@ char * hb_get_version( hb_handle_t * h ) */ int hb_get_build( hb_handle_t * h ) { - return HB_BUILD; + return HB_PROJECT_BUILD; } /** diff --git a/libhb/hb.h b/libhb/hb.h index 4ea050975..5d517d3d8 100644 --- a/libhb/hb.h +++ b/libhb/hb.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include "hbversion.h" +#include "project.h" #include "common.h" /* hb_init() diff --git a/libhb/module.defs b/libhb/module.defs new file mode 100644 index 000000000..4015ae1dc --- /dev/null +++ b/libhb/module.defs @@ -0,0 +1,47 @@ +$(eval $(call import.MODULE.defs,LIBHB,libhb,A52DEC BZIP2 FAAC FAAD2 FFMPEG LAME LIBDCA LIBDVDREAD LIBMKV LIBMP4V2 LIBOGG LIBSAMPLERATE LIBTHEORA LIBVORBIS MPEG2DEC X264 XVIDCORE ZLIB LIBHB TEST DOC)) +$(eval $(call import.GCC,LIBHB)) + +LIBHB.src/ = $(PROJECT/)libhb/ +LIBHB.build/ = $(BUILD/)libhb/ + +LIBHB.m4.in = $(wildcard $(LIBHB.src/)*.m4) +LIBHB.m4.out = $(patsubst $(LIBHB.src/)%.m4,$(LIBHB.build/)%,$(LIBHB.m4.in)) + +LIBHB.c = $(wildcard $(LIBHB.src/)*.c) +LIBHB.c.o = $(patsubst $(PROJECT/)%.c,$(BUILD/)%.o,$(LIBHB.c)) +LIBHB.d = $(LIBHB.m4.out) $(LIBHB.h.out) \ + $(foreach n, \ + A52DEC BZIP2 FAAC FAAD2 FFMPEG LAME LIBDCA LIBDVDREAD LIBMKV LIBMP4V2 LIBOGG \ + LIBSAMPLERATE LIBTHEORA LIBVORBIS MPEG2DEC X264 XVIDCORE ZLIB, \ + $($n.INSTALL.target) ) + +LIBHB.h.in = $(wildcard $(LIBHB.src/)*.h) +LIBHB.h.out = $(patsubst $(PROJECT/)%,$(BUILD/)%,$(LIBHB.h.in)) + +############################################################################### + +LIBHB.a = $(LIBHB.build/)$(call TARGET.archive,hb) + +############################################################################### + +LIBHB.out += $(LIBHB.m4.out) +LIBHB.out += $(LIBHB.c.o) +LIBHB.out += $(LIBHB.h.out) +LIBHB.out += $(LIBHB.a) + +BUILD.out += $(LIBHB.out) + +############################################################################### + +LIBHB.GCC.D += __LIBHB__ USE_PTHREAD +LIBHB.GCC.I += $(LIBHB.build/) $(CONTRIB.build/)include + +ifeq ($(BUILD.system),cygwin) + LIBHB.GCC.D += SYS_CYGWIN +else ifeq ($(BUILD.system),darwin) + LIBHB.GCC.D += SYS_DARWIN +else ifeq ($(BUILD.system),linux) + LIBHB.GCC.D += SYS_LINUX _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 +else + LIBHB.platform.D = SYS_UNKNOWN +endif diff --git a/libhb/module.rules b/libhb/module.rules new file mode 100644 index 000000000..91e47a46a --- /dev/null +++ b/libhb/module.rules @@ -0,0 +1,28 @@ +$(eval $(call import.MODULE.rules,LIBHB)) + +libhb.build: $(LIBHB.a) + +$(LIBHB.a): | $(dir $(LIBHB.a)) +$(LIBHB.a): $(LIBHB.c.o) + $(AR.exe) rsu $@ $^ + +$(LIBHB.c.o): $(LIBHB.d) +$(LIBHB.c.o): | $(dir $(LIBHB.c.o)) +$(LIBHB.c.o): $(BUILD/)%.o: $(PROJECT/)%.c + $(call LIBHB.GCC.C_O,$@,$<) + +$(LIBHB.m4.out): $(BUILD/)project/handbrake.m4 +$(LIBHB.m4.out): | $(dir $(LIBHB.m4.out)) +$(LIBHB.m4.out): $(LIBHB.build/)%: $(LIBHB.src/)%.m4 + $(M4.exe) -Iproject $< > $@ + +$(LIBHB.h.out): | $(dir $(LIBHB.h.out)) +$(LIBHB.h.out): $(BUILD/)%: $(PROJECT/)% + $(CP.exe) $< $@ + +libhb.clean: + $(RM.exe) -f $(LIBHB.out) + +############################################################################### + +clean: libhb.clean diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c index 79d8f2356..83a7daa45 100644 --- a/libhb/muxmkv.c +++ b/libhb/muxmkv.c @@ -228,7 +228,7 @@ static int MKVInit( hb_mux_object_t * m ) free(track->codecPrivate); } - if( mk_writeHeader( m->file, "HandBrake " HB_VERSION) < 0 ) + if( mk_writeHeader( m->file, "HandBrake " HB_PROJECT_VERSION) < 0 ) { hb_error( "Failed to write to output file, disk full?"); *job->die = 1; diff --git a/libhb/muxmp4.c b/libhb/muxmp4.c index 1c82211d9..3f9b2314f 100644 --- a/libhb/muxmp4.c +++ b/libhb/muxmp4.c @@ -390,7 +390,7 @@ static int MP4Init( hb_mux_object_t * m ) /* Add encoded-by metadata listing version and build date */ char *tool_string; tool_string = (char *)malloc(80); - snprintf( tool_string, 80, "HandBrake %s %i", HB_VERSION, HB_BUILD); + snprintf( tool_string, 80, "HandBrake %s %i", HB_PROJECT_VERSION, HB_PROJECT_BUILD); MP4SetMetadataTool(m->file, tool_string); free(tool_string); diff --git a/libhb/project.h.m4 b/libhb/project.h.m4 new file mode 100644 index 000000000..7889afb45 --- /dev/null +++ b/libhb/project.h.m4 @@ -0,0 +1,33 @@ +changequote(<<, >>)dnl +include(<<handbrake.m4>>)dnl +dnl +dnl +dnl +#ifndef HB_PROJECT_H +#define HB_PROJECT_H + +<<#>>define HB_PROJECT_TITLE "__HB_title" +<<#>>define HB_PROJECT_NAME "__HB_name" +<<#>>define HB_PROJECT_NAME_LOWER "__HB_name_lower" +<<#>>define HB_PROJECT_NAME_UPPER "__HB_name_upper" +<<#>>define HB_PROJECT_URL_WEBSITE "__HB_url_website" +<<#>>define HB_PROJECT_URL_COMMUNITY "__HB_url_community" +<<#>>define HB_PROJECT_URL_IRC "__HB_url_irc" +<<#>>define HB_PROJECT_URL_APPCAST "__HB_url_appcast" +<<#>>define HB_PROJECT_VERSION_MAJOR __HB_version_major +<<#>>define HB_PROJECT_VERSION_MINOR __HB_version_minor +<<#>>define HB_PROJECT_VERSION_POINT __HB_version_point +<<#>>define HB_PROJECT_VERSION "__HB_version" +<<#>>define HB_PROJECT_VERSION_FORMAL "__HB_version_formal" +<<#>>define HB_PROJECT_VERSION_HEX 0x<<>>__HB_version_hex<<>>LL +<<#>>define HB_PROJECT_BUILD __HB_build +<<#>>define HB_PROJECT_REPO_URL "__HB_repo_url" +<<#>>define HB_PROJECT_REPO_ROOT "__HB_repo_root" +<<#>>define HB_PROJECT_REPO_UUID "__HB_repo_uuid" +<<#>>define HB_PROJECT_REPO_REV __HB_repo_rev +<<#>>define HB_PROJECT_REPO_DATE "__HB_repo_date" +<<#>>define HB_PROJECT_REPO_WCVERSION "__HB_repo_wcversion" +<<#>>define HB_PROJECT_REPO_OFFICIAL __HB_repo_official +<<#>>define HB_PROJECT_REPO_TYPE "__HB_repo_type" + +#endif /* HB_PROJECT_PROJECT_H */ diff --git a/libhb/stream.c b/libhb/stream.c index b50dff15e..b50dff15e 100755..100644 --- a/libhb/stream.c +++ b/libhb/stream.c diff --git a/libhb/update.c b/libhb/update.c index 599d82ece..6b0d7af92 100644 --- a/libhb/update.c +++ b/libhb/update.c @@ -42,7 +42,7 @@ static void UpdateFunc( void * _data ) int i; /* Setup hb_query and hb_query_two with the correct appcast file */ - if( HB_BUILD % 100 ) + if( HB_PROJECT_BUILD % 100 ) { hb_log("Using http://handbrake.fr/appcast_unstable.xml (primary)"); hb_log("Using http://handbrake.fr/appcast.xml (secondary)"); @@ -148,7 +148,7 @@ static void UpdateFunc( void * _data ) goto error; } - /* Stable HB_BUILD */ + /* Stable HB_PROJECT_BUILD */ stable = strtol( cur, &cur, 10 ); if( cur >= end ) @@ -280,7 +280,7 @@ static void UpdateFunc( void * _data ) goto error; } - /* UnStable HB_BUILD */ + /* UnStable HB_PROJECT_BUILD */ unstable = strtol( cur, &cur, 10 ); if( cur >= end ) @@ -323,10 +323,10 @@ static void UpdateFunc( void * _data ) hb_log( "latest unstable: %s, build %d", unstable_str, unstable ); /* Return the build information */ - if( HB_BUILD % 100 ) + if( HB_PROJECT_BUILD % 100 ) { /* We are runnning an unstable build */ - if( unstable > HB_BUILD ) + if( unstable > HB_PROJECT_BUILD ) { memcpy( data->version, unstable_str, sizeof( unstable_str ) ); *(data->build) = unstable; @@ -335,7 +335,7 @@ static void UpdateFunc( void * _data ) else { /* We are runnning an stable build */ - if( stable > HB_BUILD ) + if( stable > HB_PROJECT_BUILD ) { memcpy( data->version, stable_str, sizeof( stable_str ) ); *(data->build) = stable; |