⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cygwin-compile.txt

📁 这是一个很好的文档
💻 TXT
📖 第 1 页 / 共 4 页
字号:
make clean
make distclean

(this will haved remove everything except code related stuff, VLC uses a "toolbox" script
which can clean a bit more)

./configure

make

If the make proceeded without errors you will have compiled a new library file:

C:\cygwin\home\Administrator\x64-trunk\libx264.a            (example)

Copy this file into the Cygwin usr/win32 folder:

C:\cygwin\usr\win32\lib          (example)

Also take the following file .h file:

C:\cygwin\home\Administrator\x264-trunk\x264.h            (example)

Copy this file into the usr/win32/include folder:

C:\cygwin\usr\win32\include        (example)

NOTE: This will overwrite the x264.h and libx264.a from the precompiled
"contrib" package!


8.1.2    live555
================

This section is only required if you want to compile the latest version of live555.

Copy the live555 project packagee from your download/install location to the home
directory:

C:\cygwin\home\Administrator

Start Cygwin and enter the following command in your shell:

tar xvf live.2006.05.17.tar.gz          (example)

Replace with your version of the source package.

This will extract the contents of the file into a subfolder within your
Cygwin environment with the naming convention something like:

live        (example)


8.1.3    Compiling FFmpeg (OPTIONAL)
====================================

This section is only required for FFmpeg compiling.

Change to the appropriate FFmpeg folder

cd ffmpeg-trunk          (example)

NOTE: the following line is optional, only use that if you have problems compiling.

make distclean

(this will haved remove everything except code related stuff, VLC uses a "toolbox" script
which can clean a bit more)

../configure-ffmpeg     


8.1.3.1  Preparations for AMR support
=====================================

If you included the AMR reference codec sources in FFmpeg you should see that
AMR-NB and WB "float support" should be working:

AMR-NB float support yes
AMR-NB fixed support no
AMR-WB float support yes
AMR-WB IF2 support no
network support      no
License: GPL


AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204
V5.1.0 from
http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip
and extracted the source to libavcodec/amrwb_float

AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104
REL-5 V5.1.0 from
http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip
and extracted the source to libavcodec/amr_float
If you try this on alpha, you may need to change Word32 to int in amr/typedef.h

NOTE: These warnings/notices can be ignored since we are using more recent versions.


8.1.3.2  Building FFmpeg
========================

Now build FFmpeg with the following command:

make       

If the make proceeded without errors you will have compiled two new "library" files:

C:\cygwin\home\Administrator\ffmpeg-trunk\libavcodec\libavcodec.a            (example)
C:\cygwin\home\Administrator\ffmpeg-trunk\libavformat\libavformat.a          (example)

To copy the appropriate libs and header files to the (extracted) contrib
folder use:

make install-libs install-headers

For historical reasons the "old" method is still described here as well:

Copy the library files (with the .a extension) into the Cygwin usr/win32 folder:

C:\cygwin\usr\win32\lib          (example)

NOTE: This will overwrite libavcodec.a and libavformat.a from the precompiled
"contrib" package!

For backup reasons you can first copy or rename the original files in the
"contrib" package (so you won't have to reinstall the complete contrib package
but can simply copy these again)

C:\cygwin\usr\win32\lib\libavcodec.a to libavcodec.a.org
C:\cygwin\usr\win32\lib\libavformat.a to libavformat.a.org

In older versions of ffmpeg the libraries had other names:

C:\cygwin\home\Administrator\ffmpeg-20050624\libavcodec\avcodec.lib            (example)
C:\cygwin\home\Administrator\ffmpeg-20050624\libavformat\avformat.lib          (example)

Rename those files (in Windows Explorer):

avcodec.lib to libavcodec.a
avformat.lib to libavformat.a

Then copy those library files into the Cygwin usr/win32 folder.


8.1.4    Compiling live555
==========================

How to configure and build the code on a Linux enviroment is explained on the
following live555 page:

http://www.live555.com/liveMedia/#config-unix

Some options need to be changed/added to the config.cygwin file in the live
folder so open this file with a text-editor.

Add the -Wno-deprecated option:

CPLUSPLUS_FLAGS =	$(COMPILE_OPTS) -Wall -DBSD=1 -Wno-deprecated

Save the file under its current name config.cygwin

Enter the following commands in your Cygwin shell:

cd live

make clean

./genMakefiles cygwin

make

TODO: Fix live555 compilation. It still fails with the following errors:

GroupsockHelper.cpp:477: error: aggregate `ip_mreq_source imr' has incomplete ty
pe and cannot be defined
GroupsockHelper.cpp:482: error: invalid application of `sizeof' to incomplete ty
pe `ip_mreq_source'
GroupsockHelper.cpp: In function `Boolean socketLeaveGroupSSM(UsageEnvironment&,
 int, netAddressBits, netAddressBits)':
GroupsockHelper.cpp:495: error: aggregate `ip_mreq_source imr' has incomplete ty
pe and cannot be defined
GroupsockHelper.cpp:500: error: invalid application of `sizeof' to incomplete ty
pe `ip_mreq_source'
make[1]: *** [GroupsockHelper.o] Error 1



8.2      Compiling VLC
======================

Enter the following commands in your Cygwin shell:

cd vlc-trunk

(you can check with the pwd command to see in which folder you are and with just the cd
command without any additional parameters you can change back to your home directory).

NOTE: the following line is optional, only use that if you have problems compiling

./toolbox --distclean

(this will have removed everything except code related stuff)

../configure-vlc

make

(cross your fingers)

NOTE: ./ means you run an application/script from the "current folder"
(which is vlc-trunk) and ../ points to "one directory up" (which is where
configure-vlc is).


8.3      Creating self contained packages
=========================================

Once the compilation is done, you can either run VLC directly from the source
tree or you can build self-contained VLC packages with the following
"make" commands:

make package-win32-base

(this will create a subdirectory named vlc-x.x.x with all the binaries "stripped"
without any debugging symbols).

make package-win32-zip

(Same as above but will package the directory in a zip file).

make package-win32

(Same as above but will also create an auto-installer package. You will need
to have NSIS installed in its default location for this to work).


9        Advanced usage
=======================


9.1      Updating Cygwin package versions
=========================================

If you need to update or install additional packages you can just run the
Cygwin setup.exe from your download location:

C:\Downloads\cygwin\setup.exe          (example)


9.1.1    Using older GCC and MINGW version
==========================================

You should be aware that Cygwin automatically selects the latest versions
for gcc-g++ and gcc-mingw so if you are using older versions of those 
(like 3.3.3-3 and the accompanied 20040810-1 packages for mingw) and wish
to continue to use them you need to CHANGE those versions to KEEP for
EVERY TIME YOU USE THE UPDATE PROCESS.

NOTE: You can click on the "View" button a few times until you see "Partial"
next to it. This will give you an overview of some "Current" packages that
will be updated to "New" versions.

select the View button until it reaches: Partial

3.3.3.3 	gcc-core 	-> change the new version 3.4.4-1 to KEEP
3.3.3.3 	gcc-g++  	-> change the new version 3.4.4-1 to KEEP
20040810-1	gcc-mingw-core 	-> change the new version 20050522-1 to KEEP
20040810-1	gcc-mingw-g++  	-> change the new version 20050522-1 to KEEP

Selecting the 3.4.4-1 version automatically changes the gcc-mingw-core and
gcc-mingw-g++ to the 20050522-1 (or newer) versions as well.


9.1.2     Downgrading Cygwin GCC packages
=========================================

If your Cygwin gcc versions are already the latest and you wish to downgrade
to gcc 3.3.3-3 then it's not possible to downgrade the gcc-core/g++ and the
mingw packages all at the same time, it has to be done in two steps.

select the View button until it reaches: Up To Date

gcc-core -> change to 3.3.3-3
gcc-g++  -> change to 3.3.3-3

Install, OK

Restart Cygwin update process.

Select the View button until it reaches: Partial

gcc-core -> change to Keep
gcc-g++  -> change to Keep

select the View button until it reaches: Up To Date

gcc-mingw-core -> change to 20040810-1
gcc-mingw-g++  -> change to 20040810-1

Install, OK.

Again, for any new update process remember to change back those versions!


9.2      GDB (Gnu Debugger)
===========================

This section requires that you installed the gdb (Gnu Debugger) in Cygwin.

This is a typical example of creating a crashlog

cd vlc-trunk
gdb vlc.exe

In the debugger mode run the program and make sure you reset the preferences!

(gdb) run --fast-mutex --reset-config --reset-plugins-cache

NOTE: the (gdb) is just a prompt which means you are in the debugger mode

It will now take a lot longer than usual for VLC to start :)

Now operate VLC as you would normally do. As soon as a crash issue occurs
you'll notice a line like this:

Program received signal SIGSEGV, Segmentation fault.
0x0041394c in playlist_ItemGetById (p_playlist=0x19ec4f8, i_id=29)
    at src/playlist/item-ext.c:459
---Type <return> to continue, or q <return> to quit---
459             i = i_bottom + ( i_top - i_bottom ) / 2;

Now you can do a "backtrace" by using the bt command:

(gdb) bt

And output similar to this will be created:

#0  0x0041394c in playlist_ItemGetById (p_playlist=0x19ec4f8, i_id=29)
    at src/playlist/item-ext.c:459
#1  0x0b26bbf7 in wxvlc::Playlist::CountItems (this=0x1822e288, root=
      {m_pItem = 0x29fef8}) at playlist.cpp:695
#2  0x0b26bc83 in wxvlc::Playlist::CountItems (this=0x1822e288, root=
      {m_pItem = 0x29e8b0}) at playlist.cpp:689
#3  0x0b26bc83 in wxvlc::Playlist::CountItems (this=0x1822e288, root=
      {m_pItem = 0x29a818}) at playlist.cpp:689
#4  0x0b26bc83 in wxvlc::Playlist::CountItems (this=0x1822e288, root=
      {m_pItem = 0x299718}) at playlist.cpp:689
#5  0x0b26bc83 in wxvlc::Playlist::CountItems (this=0x1822e288, root=
      {m_pItem = 0xffff0000}) at playlist.cpp:689
#6  0x0b26bf49 in wxvlc::Playlist::AppendItem (this=0x1822e288,
    event=@0x1827afd0) at playlist.cpp:564
#7  0x0b2757fc in wxvlc::Playlist::OnPlaylistEvent (this=0x1822e288,
    event=@0x1827afd0) at playlist.cpp:1438
#8  0x0b3771b8 in wxEvtHandler::ProcessEventIfMatches ()
    at /usr/win32/include/wx-2.6/wx/event.h:2183
#9  0x0b376a1c in wxEventHashTable::HandleEvent ()
    at /usr/win32/include/wx-2.6/wx/event.h:2183
#10 0x0b37730d in wxEvtHandler::ProcessEvent ()
    at /usr/win32/include/wx-2.6/wx/event.h:2183
#11 0x0b37711b in wxEvtHandler::ProcessPendingEvents ()
    at /usr/win32/include/wx-2.6/wx/event.h:2183
---Type <return> to continue, or q <return> to quit---
#12 0x0b376017 in wxAppConsole::ProcessPendingEvents ()
    at /usr/win32/include/wx-2.6/wx/event.h:2183
#13 0x0b3ec75a in wxIdleWakeUpModule::MsgHookProc ()
    at /usr/win32/include/wx-2.6/wx/bmpbuttn.h:81
#14 0x773aca2d in USER32!GetScrollRange ()
   from /cygdrive/c/WINDOWS/system32/user32.dll
#15 0x00000000 in ?? () from
(gdb)

These are the log outputs that are more usefull to developers than just
mentioning "it crashes"!

NOTE: In GDB mode there are sometimes situations where GDB initially "crashes"
on certain network activity (opening network shares, network traffic) which in
normal operation does not occur. Just select c for continue until "normal"
operation continues.


9.3       .diff files
=====================

Frequently patches to source code are presented or discussed in forums or
in mailing lists in so called .diff format (these are "differences" to the
source code).

You can apply those patches yourself to the source code or create .diff
files. This requires the patchutils package in Cygwin.


9.3.1     Patching source code
==============================

Download a so called .diff file:

sse2-pixel-routines-v3.diff          (example)

NOTE: make sure the file doesn't get a .txt extension, so Save as type "All Files"
instead of "Text Document" (IE has a habit of renaming to .txt. If that happens
just simply rename to .diff)

Copy the .diff file into the appropriate source folder

x264-trunk          (example)

Apply the patch as follows

patch -p0 < sse2-pixel-routines-v3.diff          (example)

NOTE: replace sse2-pixel-routines-v3.diff with your "patch"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -