diff options
author | handbrake <[email protected]> | 2007-01-03 01:11:09 +0000 |
---|---|---|
committer | handbrake <[email protected]> | 2007-01-03 01:11:09 +0000 |
commit | 79de879241d42814c3db4f897ad6a632ebe42a7f (patch) | |
tree | 44ac1a61c3b493e5cc2f99322a4ade200a6c29e3 /contrib/patch-xvidcore-cygwin.patch | |
parent | 4a04f3ecd4d15ad7a47bc797e991f412c426b05f (diff) |
Changes to make HandBrake build on Windows using the Cygwin environment:
root configure file:
I added this to the "case $SYSTEM in" switch statement: CYGWIN_NT*) DEFINES="$DEFINES SYS_CYGWIN USE_PTHREAD" LINKLIBS="$LINKLIBS -lpthread" ;;
Also, for each existing OS type that is using -lpthread, I added USE_PTHREAD to their DEFINES. Then libhb/ports.c was changed to use pthread code based on the value of USE_PTHREAD, instead of checking each different OS value that used pthreading, so it's a bit easier to read and maintain.
root Jamfile:
Jam doesn't seem to understand CYGWIN, so $(OS) is defined as UNKNOWN. Check for this, and if this it true then set $(OS) to CYGWIN. Since CSS doesn't work (yet) on CYGWIN/Windows, I also changed Jamfile to not include libdvdcss.a in the library list for CYGWIN.
contrib/Jamfile:
For CYGWIN, don't build libdvdcss, and don't specify it's path for libdvdread. There are also a few changes to use new patchfiles for Cygwin for a few of the libraries.
x264:
Change configure script so that it doesn't include -mno-cygwin flags for CYGWIN platform. Created patchfile patch-x264-cygwin.patch for this, which is used by Jamfile. The -mno-cygwin flags cause the library not to link correctly with HBTest.exe. The -mno-cygwin flag is used to create an object file or library that doesn't depend on cygwin1.dll if you're using MinGW, but I'm not (yet).
libxvidcore:
Change configure script so that it doesn't include -mno-cygwin flags for CYGWIN platform. Change configure script so that it uses libxvidcore.a as the lib name instead of xvidcore.a for CYGWIN. Created patchfile patch-xvidcore-cygwin.patch that contains the 2 above changes and is used by Jamfile. Renamed patch-xvidcore.patch to patch-xvidcore-macosx.patch and updated Jamfile as appropriate -- an attempt to keep the patches being applied only when needed for a particular platform.
ffmpeg:
libavcodec/mpegaudiodec.c uses llrint(), which apparently isn't availble with Cygwin, so I changed the file to use lrint() which is available. llrint() returns a long long, lrint() returns a long. In the places where llrint() was being called, the return value of llrint() was being assigned to an element in an array of unsigned ints, so llrint() (long long) shouldn't be needed, and lrint() (long) should be fine. Created patchfile patch-ffmpeg-cygwin.patch that contains this change, and is used by Jamfile.
libhb/ports.c:
Commented out a number of things that were broken with the current SYS_CYGWIN code. The most notable change was to not use Windows threading for CYGWIN, and instead use pthreading. All the places where the OS type was being checked to determine whether or not to use pthreading were changed so that the USE_PTHREAD define is checked instead. There seems to be some problem with the Windows threading code in ports.c, because if I enable it then x264 encodes will either crash or lock-up HBTest.exe. Perhaps this is related to mixing threading models, since x264 is compiled with pthread support, and so maybe mixing pthread with Windows threading in the same process is a bad thing.
test/test.c:
Need to #include sys/time.h, time.h, unistd.h to compile.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@84 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'contrib/patch-xvidcore-cygwin.patch')
-rw-r--r-- | contrib/patch-xvidcore-cygwin.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/contrib/patch-xvidcore-cygwin.patch b/contrib/patch-xvidcore-cygwin.patch new file mode 100644 index 000000000..7b60510d0 --- /dev/null +++ b/contrib/patch-xvidcore-cygwin.patch @@ -0,0 +1,34 @@ +diff -Naur xvidcore/build/generic/configure xvidcore-patched/build/generic/configure +--- xvidcore/build/generic/configure 2005-12-30 09:45:30.000000000 -0500 ++++ xvidcore-patched/build/generic/configure 2007-01-01 18:43:27.953125000 -0500 +@@ -3844,10 +3844,9 @@ + [cC][yY][gG][wW][iI][nN]*|mingw32*|mks*) + echo "$as_me:$LINENO: result: ok" >&5 + echo "${ECHO_T}ok" >&6 +- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" +- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" +- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\[email protected] libxvidcore.def" +- SPECIFIC_CFLAGS="-mno-cygwin" ++ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" ++ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" ++ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\[email protected] libxvidcore.def" + ;; + darwin*|raphsody*) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" +diff -Naur xvidcore/build/generic/configure.in xvidcore-patched/build/generic/configure.in +--- xvidcore/build/generic/configure.in 2005-12-30 09:45:30.000000000 -0500 ++++ xvidcore-patched/build/generic/configure.in 2007-01-01 18:43:11.453125000 -0500 +@@ -281,10 +281,9 @@ + ;; + [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*) + AC_MSG_RESULT([ok]) +- STATIC_LIB="xvidcore.\$(STATIC_EXTENSION)" +- SHARED_LIB="xvidcore.\$(SHARED_EXTENSION)" +- SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\[email protected] libxvidcore.def" +- SPECIFIC_CFLAGS="-mno-cygwin" ++ STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" ++ SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" ++ SPECIFIC_LDFLAGS="-shared -Wl,--dll,--out-implib,\[email protected] libxvidcore.def" + ;; + darwin*|raphsody*) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" |