User Tools

Site Tools


build:compiling_avidemux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
build:compiling_avidemux [2010/04/14 03:09]
j.m
build:compiling_avidemux [2012/11/11 08:51] (current)
Line 63: Line 63:
   - <​code>​cmake .</​code>​ (the dot is required)   - <​code>​cmake .</​code>​ (the dot is required)
   - <​code>​make</​code>​   - <​code>​make</​code>​
- 
-For more information,​ see the [[http://​www.avidemux.org/​admForum/​viewtopic.php?​id=3281|Switch to CMAKE in progress]] thread in the Avidemux forum. 
  
 === Old method (Avidemux 2.3 and older) === === Old method (Avidemux 2.3 and older) ===
Line 240: Line 238:
  
 === Download components === === Download components ===
- 
-These components are necessary to build Avidemux on Microsoft Windows. 
- 
-===Build environment=== 
- 
-====Download components==== 
  
 These components are necessary to build Avidemux on Microsoft Windows. These components are necessary to build Avidemux on Microsoft Windows.
Line 279: Line 271:
 == MinGW == == MinGW ==
  
-  - Extract the contents of each MinGW tarball (binutils, gcc-core, gcc-g++, mingw-runtime,​ mingw-utils,​ w32api) to a folder on your hard-drive, e.g. C:DevMinGW.+  - Extract the contents of each MinGW tarball (binutils, gcc-core, gcc-g++, mingw-runtime,​ mingw-utils,​ w32api) to a folder on your hard-drive, e.g. <​nowiki>​C:\Dev\MinGW</​nowiki>​.
  
 == MSYS == == MSYS ==
  
-  - Run the MSYS installer (e.g. MSYS-1.0.11-2004.04.30-1.exe) and follow the install wizard. ​ Choose an appropriate destination folder, e.g. C:Devmsys.+  - Run the MSYS installer (e.g. MSYS-1.0.11-2004.04.30-1.exe) and follow the install wizard. ​ Choose an appropriate destination folder, e.g. <​nowiki>​C:\Dev\msys</​nowiki>​.
   - Agree to the post install process.   - Agree to the post install process.
   - State that MinGW is installed.   - State that MinGW is installed.
Line 305: Line 297:
 == Netwide Assembler == == Netwide Assembler ==
  
-  - Extract the contents of the NASM zip file to an appropriate folder, e.g. C:​Program ​FilesNasm.+  - Extract the contents of the NASM zip file to an appropriate folder, e.g. <​nowiki>​C:\Program ​Files\Nasm</​nowiki>​.
   - Make a copy of **nasmw.exe** and rename it to **nasm.exe** in the Nasm folder. ​ (The optional components expect the filename to be nasm.exe but the Win32 version of NASM has a filename of nasmw.exe)   - Make a copy of **nasmw.exe** and rename it to **nasm.exe** in the Nasm folder. ​ (The optional components expect the filename to be nasm.exe but the Win32 version of NASM has a filename of nasmw.exe)
   - Copy **nasm.exe** to the MinGW **bin** folder.   - Copy **nasm.exe** to the MinGW **bin** folder.
Line 322: Line 314:
   - Choose the **Directories** tab.   - Choose the **Directories** tab.
   - Select **Executable Files** from the **Show Directories For** dropdown box.   - Select **Executable Files** from the **Show Directories For** dropdown box.
-  - Add the path for NASM, e.g. C:​Program ​FilesNasm.+  - Add the path for NASM, e.g. <​nowiki>​C:\Program ​Files\Nasm</​nowiki>​. 
 + 
 +=== Downloading source code from SVN === 
 + 
 +The source code for Avidemux and some of its dependencies must be downloaded from subversion repositories. ​ TortoiseSVN supports all subversion protocols. Follow these steps to download code from an SVN URL: 
 + 
 +  - Open **Windows Explorer** and click on the C: drive with the right mouse button. 
 +  - Choose **SVN Checkout** from the popup menu. 
 +  - Enter the **URL of repository**,​ e.g. svn:<​nowiki>//​svn.berlios.de/​avidemux/​branches/​avidemux_2.3_branch/</​nowiki>​. 
 +  - Enter a **Checkout directory**,​ e.g. <​nowiki>​c:​\Dev\avidemux</​nowiki>​. 
 +  - Click **OK** to download the source code. 
 + 
 +==== Avidemux dependencies ==== 
 + 
 +=== Download Dependencies === 
 + 
 +These dependencies are necessary to successfully build Avidemux. 
 + 
 +^Dependency ​                ​^Component(s) ​   ^Example Filename ​                      ​^URL ​                                                                                                   ^ 
 +|Expat v1                   ​|expat ​          ​|Expat.zip ​                             |[[http://​www.jclark.com/​xml/​expat.html|expat website]] ​                                                | 
 +|GTK+                       ​|atk ​            ​|atk-1.12.3.zip ​                        ​|[[http://​www.gimp.org/​~tml/​gimp/​win32/​downloads.html|Tor Lillqvist'​s GTK+ for Windows website]] ​       | 
 +|:::                        |atk-dev ​        ​|atk-dev-1.12.3.zip ​                    ​|::: ​                                                                                                   | 
 +|:::                        |cairo ​          ​|cairo-1.2.6.zip ​                       |:::                                                                                                    | 
 +|:::                        |cairo-dev ​      ​|cairo-dev-1.2.6.zip ​                   |:::                                                                                                    | 
 +|:::                        |fontconfig ​     |fontconfig-2.3.2-tml-20060825.zip ​     |:::                                                                                                    | 
 +|:::                        |fontconfig-dev ​ |fontconfig-dev-2.3.2-tml-20060825.zip ​ |:::                                                                                                    | 
 +|:::                        |freetype ​       |freetype-2.1.10-bin.zip ​               |:::                                                                                                    | 
 +|:::                        |freetype-lib ​   |freetype-2.1.10-lib.zip ​               |:::                                                                                                    | 
 +|:::                        |gettext ​        ​|gettext-0.14.5.zip ​                    ​|::: ​                                                                                                   | 
 +|:::                        |gettext-dev ​    ​|gettext-dev-0.14.5.zip ​                ​|::: ​                                                                                                   | 
 +|:::                        |glib            |glib-2.12.6.zip ​                       |:::                                                                                                    | 
 +|:::                        |glib-dev ​       |glib-dev-2.12.6.zip ​                   |:::                                                                                                    | 
 +|:::                        |gtk+            |gtk+-2.10.6.zip ​                       |:::                                                                                                    | 
 +|:::                        |gtk+-dev ​       |gtk+-dev-2.10.6.zip ​                   |:::                                                                                                    | 
 +|:::                        |libiconv ​       |libiconv-1.9.1.bin.woe32.zip ​          ​|::: ​                                                                                                   | 
 +|:::                        |libpng ​         |libpng-1.2.8-bin.zip ​                  ​|::: ​                                                                                                   | 
 +|:::                        |libpng-lib ​     |libpng-1.2.8-lib.zip ​                  ​|::: ​                                                                                                   | 
 +|:::                        |pango ​          ​|pango-1.14.8.zip ​                      ​|::: ​                                                                                                   | 
 +|:::                        |pango-dev ​      ​|pango-dev-1.14.8.zip ​                  ​|::: ​                                                                                                   | 
 +|Libxml v2                  |libxml2 ​        ​|libxml2-2.6.27.win32.zip ​              ​|[[http://​www.zlatkovic.com/​libxml.en.html|Libxml website]] ​                                            | 
 +|Netscape Portable Runtime ​ |nspr            |nspr-4.4.1.zip ​                        ​|[[ftp://​ftp.mozilla.org/​pub/​mozilla.org/​nspr/​releases/​v4.4.1/​WINNT5.0_OPT.OBJ|Mozilla NSPR FTP site]] ​ | 
 +|Pthreads-w32 v1            |pthread-win32 ​  ​|pthreads-w32-1-11-0-release.exe ​       |[[http://​sourceware.org/​pthreads-win32|Pthreads website]] ​                                             | 
 +|Spidermonkey ​              ​|js ​             |js-1.5.tar.gz ​                         |[[http://​www.mozilla.org/​js/​spidermonkey|Mozilla Spidermonkey website]] ​                               | 
 +|Zlib                       ​|zlib ​           |zlib123-dll.zip ​                       |[[http://​www.zlib.net/​|zlib website]] ​                                                                 | 
 + 
 +These libraries are optional but enable Avidemux to have greater functionality. 
 + 
 +^Library ​                  ​^Component(s) ​             ^Example Filename ​         ^URL                                                            ^ 
 +|Aften ​                    ​|aften ​                    ​|aften-0.05-win32.zip ​     |[[http://​aften.sourceforge.net/​|Aften website]] ​               | 
 +|FAAC                      |faac                      |faac-1.25.zip ​            ​|[[http://​www.audiocoding.com/​|Audiocoding website]] ​           | 
 +|FAAD                      |faad                      |faad2-2.5.zip ​            ​|::: ​                                                           | 
 +|LAME                      |mp3lame ​                  ​|lame-3.97.tar.gz ​         |[[http://​lame.sourceforge.net/​|LAME website]] ​                 | 
 +|Libdca ​                   |libdca ​                   |libdca-0.0.2.tar.gz ​      ​|[[http://​developers.videolan.org/​libdca.html|libdca website]] ​ | 
 +|Ogg Vorbis ​               |libogg ​                   |libogg-1.1.3.zip ​         |[[http://​www.vorbis.com/​|Vorbis website]] ​                     | 
 +|:::                       ​|libvorbis ​                ​|libvorbis-1.1.2.zip ​      ​|::: ​                                                           | 
 +|Simple DirectMedia Layer  |libsdl ​                   |SDL-1.2.11.zip ​           |[[http://​www.libsdl.org/​index.php|SDL website]] ​               | 
 +|:::                       ​|libsdl-dev ​               |SDL-devel-1.2.11-VC6.zip ​ |:::                                                            | 
 +|Xvid                      |xvid                      |xvidcore-1.1.2.tar.gz ​    ​|[[http://​www.xvid.org/​|Xvid website]] ​                         | 
 + 
 +=== Install Dependencies === 
 + 
 +== Expat == 
 + 
 +  - Extract the files **xmlparse.dll** and **xmltok.dll** from the expat zip file to the MinGW **bin** folder. 
 +  - Copy **xmlparse.dll** as **libexpat.dll**. 
 + 
 +== GTK+ == 
 + 
 +  - Extract the contents of each zip file (atk, atk-dev, cairo, cairo-dev, fontconfig, fontconfig-dev,​ freetype, freetype-lib,​ gettext, gettext-dev,​ glib, glib-dev, gtk+, gtk+-dev, libiconv, libpng, libpng-lib, pango, pango-dev) to the MinGW folder. 
 + 
 +== Libxml2 == 
 + 
 +  - Extract the contents of the libxml2 zip file to a temporary folder. 
 +  - Move the libxml2 **bin**, **include** and **lib** folders to the corresponding MinGW folders. 
 + 
 +== Netscape Portable Runtime == 
 + 
 +  - Extract the contents of the nspr zip file to a folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Copy **libnspr4.dll** from the NSPR **lib** folder to the MinGW **bin** folder. 
 + 
 +== Pthreads-w32 v1 == 
 + 
 +  - Run the Pthreads-w32 exe to extract required files to a temporary folder. 
 +  - Copy the contents of the **<​nowiki>​Pre-built.1\include</​nowiki>​** folder to the MinGW **include** folder. 
 +  - Copy all **a** and **lib** files from the **<​nowiki>​Pre-built.1\lib</​nowiki>​** folder to the MinGW **lib** folder. 
 +  - Copy all **dll** files from the **<​nowiki>​Pre-built.1\lib</​nowiki>​** folder to the MinGW **bin** folder. 
 + 
 +== Zlib == 
 + 
 +  - Extract the contents of the zlib zip file to the MinGW folder. 
 +  - Copy **zdll.lib** in the MinGW **lib** folder as **z.lib**. 
 +  - Move **zlib1.dll** from the MinGW folder to the MinGW **bin** folder. 
 + 
 +== SpiderMonkey == 
 + 
 +  - Extract the contents of the tarball to a folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Build Spidermonkey using Microsoft Visual C++ or MinGW: 
 + 
 +//Using Microsoft Visual C++ 6.0:// 
 +    * a. Open the **js.mak** file in the Spridermonkey **src** folder with a text editor. 
 +    * b. Update the compiler options to refer to the Netscape Portable Runtime by replacing all occurrences of: <​code>​CPP_PROJ=</​code>​ with (includes a trailing space): <​code>​CPP_PROJ=/​I c:​\dev\nspr-4.4.1\include /D "​JS_THREADSAFE" ​ </​code>​ 
 +    * c. Update the linker options to refer to the Netscape Portable Runtime by replacing all occurrences of: <​code>​LINK32_FLAGS=</​code>​ with (includes a trailing space): <​code>​LINK32_FLAGS=/​libpath:​c:​\dev\nspr-4.4.1\lib libnspr4.lib ​ </​code>​ 
 +    * d. Save the file and close the editor. 
 +    * e. Start a command prompt and run **VCVARS32.BAT** from the Visual C++ **bin** folder. <​code>"​C:​\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"</​code>​ 
 +    * f. Change directory to the Spidermonkey **src** folder. <​code>​cd\Dev\js\src</​code>​ 
 +    * g. Run **NMAKE** on **js.mak** using the **jsshell – Win32 Release** configuration. <​code>​nmake /f js.mak CFG="​jsshell - Win32 Release"</​code>​ 
 +    * h. Close the command prompt. 
 +    * i. Start MSYS. 
 +    * j. Change directory to the Spidermonkey **<​nowiki>​src\Release</​nowiki>​** folder. <​code>​cd /​c/​Dev/​js/​src/​Release</​code>​ 
 +    * k. Using **pexports**,​ create a module-definition file for the newly created **js32.dll**:​ <​code>​pexports js32.dll > js32.def</​code>​ 
 +    * l. Use **dlltool** to produce a **libjs** import library. <​code>​dlltool -d js32.def -l /​mingw/​lib/​libjs.a</​code>​ 
 +    * m. Move **js32.dll** to the MinGW **bin** folder. <​code>​mv js32.dll /​mingw/​bin</​code>​ 
 +    * n. Close MSYS. 
 + 
 +//Using MinGW:// 
 + 
 +    * a. Create a text file named **makefile** in the Spidermonkey **src/​fdlibm** folder. 
 +    * b. Paste the following script into **makefile**:​ <code make># Project: fdlibm 
 +CC = gcc.exe 
 +SRCDIR = /​c/​dev/​js/​src/​fdlibm 
 + 
 +OBJECTS= \ 
 +$(SRCDIR)/​w_sqrt.o \ 
 +$(SRCDIR)/​e_pow.o \ 
 +$(SRCDIR)/​e_sqrt.o \ 
 +$(SRCDIR)/​k_standard.o \ 
 +$(SRCDIR)/​s_atan.o \ 
 +$(SRCDIR)/​s_finite.o \ 
 +$(SRCDIR)/​s_isnan.o \ 
 +$(SRCDIR)/​s_matherr.o \ 
 +$(SRCDIR)/​s_rint.o \ 
 +$(SRCDIR)/​s_scalbn.o \ 
 +$(SRCDIR)/​w_atan2.o \ 
 +$(SRCDIR)/​e_atan2.o \ 
 +$(SRCDIR)/​s_fabs.o \ 
 +$(SRCDIR)/​s_copysign.o \ 
 +$(SRCDIR)/​w_pow.o \ 
 +$(SRCDIR)/​s_lib_version.o 
 + 
 +LIBS = -llibm 
 +BIN  = fdlibm.lib 
 +CFLAGS = -DJS_THREADSAFE -D_IEEE_LIBM -DWIN32 -D_WINDOWS -s 
 +.c.o: $(CC) -c $(CFLAGS) -o $@ $*.c 
 + 
 +$(BIN): $(OBJECTS) 
 + ar r $(BIN) $(OBJECTS) 
 + ranlib $(BIN)</​code>​ 
 +    * c. Make sure all indentations in the script are tabbed and not spaced. ​ Also ensure **SRCDIR** is correctly set to the Spidermonkey **<​nowiki>​src\fdlibm</​nowiki>​** folder. 
 +    * d. Create a text file named **makefile** in the Spidermonkey **src** folder. 
 +    * e. Paste the following script into **makefile**:<​code make># Project: js32 
 + 
 +CC   = gcc.exe 
 +WINDRES = windres.exe 
 +RES  = js.res 
 +SRCDIR = /​c/​dev/​js/​src 
 +OBJECTS = \ 
 +    $(SRCDIR)/​jsapi.o \ 
 +    $(SRCDIR)/​jsarena.o \ 
 +    $(SRCDIR)/​jsarray.o \ 
 +    $(SRCDIR)/​jsatom.o \ 
 +    $(SRCDIR)/​jsbool.o \ 
 +    $(SRCDIR)/​jscntxt.o \ 
 +    $(SRCDIR)/​jsdate.o \ 
 +    $(SRCDIR)/​jsdbgapi.o \ 
 +    $(SRCDIR)/​jsdhash.o \ 
 +    $(SRCDIR)/​jsdtoa.o \ 
 +    $(SRCDIR)/​jsemit.o \ 
 +    $(SRCDIR)/​jsexn.o \ 
 +    $(SRCDIR)/​jsfun.o \ 
 +    $(SRCDIR)/​jsgc.o \ 
 +    $(SRCDIR)/​jshash.o \ 
 +    $(SRCDIR)/​jsinterp.o \ 
 +    $(SRCDIR)/​jslock.o \ 
 +    $(SRCDIR)/​jslog2.o \ 
 +    $(SRCDIR)/​jslong.o \ 
 +    $(SRCDIR)/​jsmath.o \ 
 +    $(SRCDIR)/​jsnum.o \ 
 +    $(SRCDIR)/​jsobj.o \ 
 +    $(SRCDIR)/​jsopcode.o \ 
 +    $(SRCDIR)/​jsparse.o \ 
 +    $(SRCDIR)/​jsprf.o \ 
 +    $(SRCDIR)/​jsregexp.o \ 
 +    $(SRCDIR)/​jsscan.o \ 
 +    $(SRCDIR)/​jsscope.o \ 
 +    $(SRCDIR)/​jsscript.o \ 
 +    $(SRCDIR)/​jsstr.o \ 
 +    $(SRCDIR)/​jsutil.o \ 
 +    $(SRCDIR)/​jsxdrapi.o \ 
 +    $(SRCDIR)/​prmjtime.o \ 
 +    $(RES) 
 + 
 +LIBS =  --add-stdcall-alias -lfdlibm -lnspr4 -L./fdlibm -L/​c/​dev/​nspr-4.4.1/​lib 
 +BIN  = js.dll 
 +CFLAGS = -I/​dev/​nspr-4.4.1/​include -DJS_THREADSAFE -DXP_WIN \ 
 +-DEXPORT_JS_API -D_WINDOWS -DWIN32 -D_MINGW -s 
 + 
 +DLLWRAP=dllwrap.exe 
 +DEFFILE=libjs.def 
 +STATICLIB=libjs.a 
 +.c.o: $(CC) -c $(CFLAGS) -o $@ $*.c 
 + 
 +$(BIN): $(OBJECTS) 
 + $(CC) -shared -o $@ \ 
 + -Wl,​--output-def,​$(DEFFILE) \ 
 + -Wl,​--out-implib,​$(STATICLIB) \ 
 + $(OBJECTS) \ 
 + $(LIBS) 
 + 
 +$(RES):  
 + $(WINDRES) -i $(SRCDIR)/​js3240.rc -I rc -o $(RES) -O coff</​code>​ 
 + 
 +    * f. Make sure all indentations in the script are tabbed and not spaced. ​ Also ensure **LIBS** and **CFLAGS** are correctly set to the appropriate Netscape Portable Runtime subdirectories and **SRCDIR** is correctly set to the Spridermonkey **src** folder. 
 +    * g. Start MSYS. 
 +    * h. Make the fdlibm library. <​code>​cd /​c/​Dev/​js/​src/​fdlibm 
 +make</​code>​ 
 +    * i. Make the SpiderMonkey library. <​code>​cd /​c/​Dev/​js/​src 
 +make 
 +strip –-strip-all js.dll</​code>​ 
 +    * j. Move **js.dll** to the MinGW **bin** folder and **libjs.a** to the MinGW **lib** folder. <​code>​mv /​c/​Dev/​js/​src/​js.dll /​mingw/​bin 
 +mv /​c/​Dev/​js/​src/​libjs.a /​mingw/​lib</​code>​ 
 +    * k. Close MSYS. 
 +    * 
 + 
 +===Install optional libraries=== 
 + 
 +== Aften == 
 + 
 +  - Extract the contents of the Aften zip file to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Move the Aften **bin**, **include** and **lib** subdirectories to the corresponding MinGW folders. 
 +  - Open the file **aften.h** in the MinGW **include** folder with a text editor. 
 +  - Fix the incorrect usage of a reserved word by replacing: <code cpp>void *private;</​code>​ with: <code cpp>void *_private;</​code>​ 
 +  - 5. Save the file and close the editor. 
 + 
 +If you prefer to use a DLL rather than linking to a static library, also follow these steps: 
 + 
 +  - Start MSYS. 
 +  - Change directory to the MinGW **lib** folder. <​code>​cd /​mingw/​lib</​code>​ 
 +  - Create **aften.dll** from the **libaften.a** static library. <​code>​a2dll libaften.a -o aften.dll</​code>​ 
 +  - Remove all unnecessary symbols from aften.dll. <​code>​strip --strip-all aften.dll</​code>​ 
 +  - Using **pexports**,​ create a module-definition file for the Aften runtime: <​code>​pexports aften.dll > aften.def</​code>​ 
 +  - Use **dlltool** to produce a Aften import library. <​code>​dlltool -d aften.def -l libaften.a</​code>​ 
 +  - Move **aften.dll** to the MinGW **bin** folder. <​code>​mv aften.dll /​mingw/​bin</​code>​ 
 +  - 8. Close MSYS. 
 + 
 +== FAAC == 
 + 
 +  - Extract the contents of the faac zip file to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Open the header files **libfaac\frame.h** and **include\faac.h** with a text editor. 
 +  - Replace the following line in both files: <code cpp>#​define FAACAPI __stdcall</​code>​ with: <code cpp>#​define FAACAPI __cdecl</​code>​ 
 +  - Save both files and close the editor. 
 +  - Copy ***.h** in the FAAC **include** folder to the MinGW **include** folder. 
 +  - Build FAAC using Microsoft Visual C++ or MinGW: 
 + 
 +//Using Microsoft Visual C++ 6.0:// 
 + 
 +    * a. Open the file **libfaac_dll.dsw** in the FAAC **libfaac** folder using Microsoft Visual C++ 6.0. 
 +    * b. Add Source Files that are missing from the project and remove Source File that no longer exist (add kiss_fft\ kiss_fft.c, kiss_fft\ kiss_fftr.c). 
 +    * c. Choose **Set Active Configuration** from the **Build** menu. 
 +    * d. Choose the **libfaac_dll – Win32 Release** project configuration. 
 +    * e. Choose **Settings** from the **Project** menu. 
 +    * f. Choose the **C/C++** tab. 
 +    * g. Select **Preprocessor** from the **Category** dropdown box. 
 +    * h. Add **..\include** to the **Additional include directories**. 
 +    * i. Click the **OK** button. 
 +    * j. Choose **Build libfaac.dll** from the **Build** menu. 
 +    * k. Close Microsoft Visual C++. 
 +    * l. Copy **libfaac.dll** in the FAAC **libfaac\ReleaseDLL** folder to the MinGW **bin** folder. 
 +    * m. Start MSYS. 
 +    * n. Using **pexports**,​ create a module-definition file for the FAAC runtime: <​code>​pexports /​mingw/​bin/​libfaac.dll > libfaac.def</​code>​ 
 +    * o. Use dlltool to produce a FAAC import library. <​code>​dlltool -d libfaac.def -l /​mingw/​lib/​libfaac.a</​code>​ 
 +    * p. Close MSYS. 
 + 
 +//Using MinGW:// 
 + 
 +    * a. Start MSYS. 
 +    * b. Change directory to the FAAC **libfaac** folder. <​code>​cd /​c/​Dev/​faac/​libfaac</​code>​ 
 +    * c. Compile source code and link **libfaac.dll**. <​code>​gcc –s –O3 –shared -I../​include *.c -o /​mingw/​bin/​libfaac.dll -Wl,​--out-implib,/​mingw/​lib/​libfaac.a –Wl,​--add-stdcall-alias</​code>​ 
 +    * d. Close MSYS. 
 + 
 +== FAAD == 
 + 
 +  - Extract the contents of the FAAD zip file to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Copy ***.h** in the FAAD **include** folder to the MinGW **include** folder. 
 +  - Build FAAD using Microsoft Visual C++ or MinGW: 
 + 
 +//Using Microsoft Visual C++ 6.0:// 
 + 
 +    * a. Open the file **libfaad2_dll.dsw** in the FAAD **libfaad** folder using Microsoft Visual C++ 6.0. 
 +    * b. Remove **dither.c** from the project as it no longer exists. 
 +    * c. Update **libfaad2.def** to the following:<​code>​LIBRARY ​ libfaad2.dll 
 +EXPORTS 
 +
 +; libfaad exports 
 +
 +NeAACDecOpen ​                     @1 
 +NeAACDecGetCurrentConfiguration ​  @2 
 +NeAACDecSetConfiguration ​         @3 
 +NeAACDecInit ​                     @4 
 +NeAACDecInit2 ​                    @5 
 +NeAACDecDecode ​                   @6 
 +NeAACDecClose ​                    @7 
 +NeAACDecGetErrorMessage ​          @8 
 +NeAACDecAudioSpecificConfig ​      @9 
 +NeAACDecPostSeekReset ​            ​@10</​code>​ 
 +    * d. Choose **Set Active Configuration** from the **Build** menu. 
 +    * e. Choose the **libfaad_dll – Win32 Release** project configuration. 
 +    * f. Choose **Build libfaad2.dll** from the **Build** menu. 
 +    * g. Close Microsoft Visual C++. 
 +    * h. Copy **libfaad2.dll** in the FAAD **libfaad\ReleaseDLL** folder to the MinGW **bin** folder. 
 +    * i. Start MSYS. 
 +    * j. Using **pexports**,​ create a module-definition file for the FAAD runtime: <​code>​pexports /​mingw/​bin/​libfaad2.dll > libfaad.def</​code>​ 
 +    * k. Use **dlltool** to produce a FAAD import library. <​code>​dlltool -d libfaad.def -l /​mingw/​lib/​libfaad.a</​code>​ 
 +    * l. Close MSYS. 
 + 
 +//Using MinGW:// 
 + 
 +    * a. Start MSYS. 
 +    * b. Change directory to the FAAD **libfaad** folder. <​code>​cd /​c/​Dev/​faad2/​libfaad</​code>​ 
 +    * c. Compile source code and link **libfaad2.dll**. <​code>​gcc –s –O3 -DHAVE_MEMCPY=1 -DHAVE_STRING_H=1 –DHAVE_STDINT_H=1 -I"​."​ *.c -shared -o /​mingw/​bin/​libfaad2.dll -Wl,​--out-implib,/​mingw/​lib/​libfaad.a</​code>​ 
 +    * d. Close MSYS. 
 + 
 +== LAME == 
 + 
 +  - Extract the contents of the lame tarball to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Start MSYS. 
 +  - Change directory to the lame folder. <​code>​cd /​c/​dev/​lame-3.97</​code>​ 
 +  - Execute the following commands: <​code>​./​configure --prefix=/​mingw 
 +make 
 +make install</​code>​ 
 +  - Remove all unnecessary symbols from libmp3lame-0.dll. <​code>​strip --strip-all /​mingw/​bin/​libmp3lame-0.dll</​code>​ 
 +  - Close MSYS. 
 + 
 +== Libdca == 
 + 
 +  - Extract the contents of the libdca tarball to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Start MSYS. 
 +  - Change directory to the libdca folder. <​code>​cd /​c/​dev/​libdts-0.0.2</​code>​ 
 +  - Execute the following commands: <​code>​./​configure --prefix=/​mingw 
 +make 
 +make install</​code>​ 
 +  - Close MSYS. 
 +  - Copy **dts_internal.h** in the **libdts** folder to the MinGW **include** folder. 
 + 
 +If you prefer to use a DLL rather than linking to a static library, also follow these steps: 
 + 
 +  - Start MSYS. 
 +  - Change directory to the MinGW **lib** folder. <​code>​cd /​mingw/​lib</​code>​ 
 +  - Create **dts.dll** from the **libdts.a** static library. <​code>​a2dll libdts.a -o dts.dll</​code>​ 
 +  - Remove all unnecessary symbols from dts.dll. <​code>​strip --strip-all dts.dll</​code>​ 
 +  - Using **pexports**,​ create a module-definition file for the dts runtime: <​code>​pexports dts.dll > dts.def</​code>​ 
 +  - Use **dlltool** to produce a dts import library. <​code>​dlltool -d dts.def -l libdts.a</​code>​ 
 +  - Move **dts.dll** to the MinGW **bin** folder. <​code>​mv dts.dll /​mingw/​bin</​code>​ 
 +  - 8. Close MSYS. 
 + 
 +== Ogg Vorbis == 
 + 
 +  - Extract the contents of the Ogg and Vorbis zip files to the same temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Build Ogg Vorbis using Microsoft Visual C++ or MinGW: 
 + 
 +//Using Microsoft Visual C++ 6.0:// 
 + 
 +    * a. Rename the Ogg folder to **ogg**. 
 +    * b. Open the file **ogg.dsw** in the Ogg **win32** folder using Microsoft Visual C++ 6.0. 
 +    * c. Choose **Set Active Configuration** from the **Build** menu. 
 +    * d. Choose the **ogg_dynamic – Win32 Release** project configuration. 
 +    * e. Choose **Build ogg.dll** from the **Build** menu. 
 +    * f. Close Microsoft Visual C++. 
 +    * g. Copy **ogg.dll** in the Ogg **win32\Dynamic_Release** folder to the MinGW **bin** folder. 
 +    * h. Copy the Ogg **include\ogg** folder to the MinGW **include** folder. 
 +    * i. Open the file **vorbis.dsw** in the Vorbis **win32** folder using Microsoft Visual C++ 6.0. 
 +    * j. Choose **Set Active Configuration** from the **Build** menu. 
 +    * k. Choose the **vorbis_dynamic – Win32 Release** project configuration. 
 +    * l. Choose **Build vorbis.dll** from the **Build** menu. 
 +    * m. Repeat steps j – l to build **vorbisenc.dll** and **vorbisfile.dll** using the **vorbisenc_dynamic – Win32 Release** and **vorbisfile_dynamic – Win32 Release** project configurations. 
 +    * n. Close Microsoft Visual C++. 
 +    * o. Copy **vorbis.dll** in the Vorbis **win32\Vorbis_Dynamic_Release** folder to the MinGW **bin** folder. 
 +    * p. Copy **vorbisenc.dll** in the Vorbis **win32\VorbisEnc_Dynamic_Release** folder to the MinGW **bin** folder. 
 +    * q. Copy **vorbisfile.dll** in the Vorbis **win32\VorbisFile_Dynamic_Release** folder to the MinGW **bin** folder. 
 +    * r. Copy the Vorbis **include\vorbis** folder to the MinGW **include** folder.  
 +    * s. Start MSYS. 
 +    * t. Using **pexports**,​ create a module-definition file for the Ogg Vorbis runtimes: <​code>​pexports /​mingw/​bin/​vorbis.dll > vorbis.def 
 +pexports /​mingw/​bin/​vorbisenc.dll > vorbisenc.def</​code>​ 
 +    * u. Use **dlltool** to produce Ogg Vorbis import libraries. <​code>​dlltool -d vorbis.def -l /​mingw/​lib/​libvorbis.a 
 +dlltool -d vorbisenc.def -l /​mingw/​lib/​libvorbisenc.a</​code>​ 
 +    * v. Close MSYS. 
 + 
 +//Using MinGW:// 
 + 
 +    * a. Start MSYS. 
 +    * b. Change directory to the Ogg folder. <​code>​cd /​c/​dev/​libogg-1.1.3</​code>​ 
 +    * c. Execute the following commands: <​code>​./​configure --prefix=/​mingw 
 +make 
 +make install</​code>​ 
 +    * d. Change directory to the Vorbis folder. <​code>​cd /​c/​dev/​libvorbis-1.1.2</​code>​ 
 +    * e. Execute the following commands: <​code>​./​configure --prefix=/​mingw LIBS="​-L/​mingw/​lib –logg"​ 
 +make 
 +make install</​code>​ 
 +    * f. Close MSYS. 
 + 
 +== Simple DirectMedia Layer == 
 + 
 +  - Extract the contents of the SDL zip file to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Start MSYS. 
 +  - Change directory to the SDL folder. <​code>​cd /​c/​dev/​sdl-1.2.11</​code>​ 
 +  - Execute the following commands: <​code>​./​configure --prefix=/​mingw 
 +make 
 +make install</​code>​ 
 +  - 5. Close MSYS. 
 +  - If you prefer a Microsoft Visual C++ compiled runtime, extract **SDL.dll** in the SDL-dev zip file to the MinGW **bin** folder. Alternatively,​ compile the supplied **SDL.dsw** using Microsoft Visual C++ 6.0. 
 + 
 +== x264 == 
 + 
 +  - Using Tortoise SVN, download the latest x264 source code from: <​code>​svn://​svn.videolan.org/​x264/​trunk</​code>​ 
 +  - Open the file **configure** in the x264 folder with a text editor. 
 +  - Update the following lines: <​code>​if cc_check pthread.h -lpthread "​pthread_create(0,​0,​0,​0);"​ ; then 
 +      pthread="​yes"​ 
 +      libpthread="​-lpthread"</​code>​ to: <​code>​if cc_check pthread.h –lpthread**GC1** "​pthread_create(0,​0,​0,​0);"​ ; then 
 +      pthread="​yes"​ 
 +      libpthread="​-lpthread**GC1**"</​code>​ 
 +  - Save the file and close the editor. 
 +  - Open the file **Makefile** in the x264 folder with a text editor. 
 +  - Replace the following lines: <code make>​libx264.a:​ .depend $(OBJS) $(OBJASM) 
 +  ar rc libx264.a $(OBJS) $(OBJASM) 
 + ​ ranlib libx264.a 
 +  
 +$(SONAME): .depend $(OBJS) $(OBJASM) 
 + $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,​-soname,​$(SONAME) $(LDFLAGS)</​code>​ with: <code make>​ifeq ($(SYS),​MINGW) 
 + $(CC) -shared -Wl,​--out-implib,​libx264.a -o libx264.dll $(OBJS) $(OBJASM) $(LDFLAGS) 
 +else 
 + libx264.a: .depend $(OBJS) $(OBJASM) 
 + ar rc libx264.a $(OBJS) $(OBJASM) 
 + ranlib libx264.a 
 + 
 + $(SONAME): .depend $(OBJS) $(OBJASM) 
 + $(CC) -shared -o $@ $(OBJS) $(OBJASM) -Wl,​-soname,​$(SONAME) $(LDFLAGS) 
 +endif</​code>​ 
 +  - Save the file and close the editor. 
 +  - Start MSYS. 
 +  - Change directory to the x264 folder. <​code>​cd /​c/​dev/​x264</​code>​ 
 +  - Execute the following commands: <​code>​./​configure --prefix=/​mingw --enable-pthread –-enable-avis-input --enable-shared 
 +make 
 +make install</​code>​ 
 +  - Copy **libx264.dll** to the MinGW **bin** folder. <​code>​cp libx264.dll /​mingw/​bin</​code>​ 
 +  - Close MSYS. 
 + 
 +== Xvid == 
 + 
 +  - Extract the contents of the Xvid tarball to a temporary folder, e.g. <​nowiki>​C:​\Dev</​nowiki>​. 
 +  - Build Xvid using Microsoft Visual C++ or MinGW: 
 + 
 +// Using Microsoft Visual C++ 6.0:// 
 + 
 +    * a. Open the file **xvidcore.dsw** in the Xvid **build\Win32** folder using Microsoft Visual C++ 6.0. 
 +    * b. Choose **Set Active Configuration** from the **Build** menu. 
 +    * c. Choose the **libxvidcore – Win32 Release** project configuration. 
 +    * d. Choose **Build xvidcore.dll** from the **Build** menu. 
 +    * e. Close Microsoft Visual C++. 
 +    * f. Copy the **xvidcore.dll** file from the Xvid **build\Win32\bin** folder to the MinGW **bin** folder. 
 +    * g. Copy the **xvidcore.dll.a** file from the Xvid **build\Win32\bin** folder to the MinGW **lib** folder. 
 +    * h. Copy the **xvid.h** file from the Xvid **src** folder to the MinGW **include** folder. 
 + 
 +//Using MinGW:// 
 + 
 +    * a. Start MSYS. 
 +    * b. Change directory to the Xvid **build\generic** folder. <​code>​cd /​c/​dev/​xvid-1.1.2/​build/​generic</​code>​ 
 +    * c. Execute the following commands: <​code>​./​configure --prefix=/​mingw 
 +make 
 +make install</​code>​ 
 +    * d. Close MSYS. 
 + 
 +==== Build Avidemux ==== 
 + 
 +  - Using Tortoise SVN, download the latest Avidemux source code. Alternatively,​ download and extract the latest Avidemux source code tarball. 
 +  - Start MSYS. 
 +  - Change directory to the Avidemux source code folder. <​code>​cd /​c/​dev/​avidemux</​code>​ 
 +  - Execute the following command: <​code>​make –f makefile.dist</​code>​ If make fails with an **AM_GNU_GETTEXT** error, execute the following commands: <​code>​cp ./m4/*.m4 /​mingw/​share/​aclocal 
 +make –f makefile.dist</​code>​ 
 +  - Run **configure** referencing the Spidermonkey **src** folder and then perform a **make**: <​code>​./​configure –-with-jsapi-include=/​c/​dev/​js/​src 
 +make</​code>​ 
 +  - The make will fail.  Run the make again but capture the output to a text file. <​code>​ ./​avidemux/​dolink</​code>​ 
 +  - Open the **dolink** file in the Avidemux **avidemux** folder with a text editor. 
 +  - Remove all lines from the file apart from the one starting with: <​code>/​bin/​sh ../​libtool</​code>​ 
 +  - Include **.\xpm\adm.o** in the list of library object files. This will add the avidemux icon to the resulting executable. 
 +  - Move all **–l** parameters to the end of the line. 
 +  - Add the following parameters to the end of the line: <​code>​-llibxml2 -lwinmm -lwsock32</​code>​ 
 +  - The final result should look something like this:<​code>/​bin/​sh ../libtool --silent --mode=link g++ -g -I.. -I../​ADM_lavutil -IADM_library -I../​ADM_library ​ \ 
 +-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -mno-cygwin -mms-bitfields -O2 -falign-loops=16 ​ \ 
 +-o avidemux2.exe ​  \ 
 +-L/​mingw/​lib \ 
 +
 +guiplay.o gui_savenew.o gui_navigate.o gtk_gui.o callbacks.o \ 
 +avilist.o main.o prefs.o ADM_guiBitrate.o ADM_pp.o ADM_memsupport.o \ 
 +gui_autodrive.o GUI_jobs.o ADM_dialog/​DIA_quota.o \ 
 +ADM_lavcodec/​libavcodec.a ADM_lavcodec/​libpostproc/​libpostproc.a \ 
 +./​ADM_script/​libADM_script.a ./​ADM_editor/​libADM_editor.a \ 
 +./​ADM_library/​libADM_library.a ./​ADM_openDML/​libADM_openDML.a \ 
 +./​oplug_ogm/​liboplug_ogm.a ./​ADM_audiocodec/​libADM_audiocodec.a \ 
 +./​ADM_audio/​libADM_audio.a ./​oplug_avi/​liboplug_avi.a \ 
 +./​oplug_mp4/​liboplug_mp4.a ./​oplug_mpeg/​liboplug_mpeg.a \ 
 +./​oplug_mpegFF/​liboplug_mpegFF.a ./​ADM_mplex/​libADM_mplex.a \ 
 +./​ADM_lavformat/​libADM_lavformat.a ./​ADM_lavutil/​libADM_lavutil.a \ 
 +./​ADM_lvemux/​libADM_lvemux.a ./​ADM_filter/​libADM_filter.a \ 
 +./​ADM_video/​libADM_video.a ​  ​./​ADM_encoder/​libADM_encoder.a \ 
 +./​ADM_codecs/​libADM_codecs.a ./​ADM_vp32/​libADM_vp32.a \ 
 +./​ADM_audiofilter/​libADM_audiofilter.a ./​libtoolame/​liblibtoolame.a \ 
 +./​ADM_gui2/​libADM_gui2.a ./​ADM_libswscale/​libswscale.a \ 
 +./​mpeg2enc/​libmpeg2enc.a ./​ADM_liba52/​libADM_liba52.a \ 
 +./​ADM_libMad/​libADM_mad.a ./​ADM_inpics/​libADM_inpics.a ​ \ 
 +./​ADM_3gp/​libADM_3gp.a ./​ADM_avsproxy/​libADM_avsproxy.a \ 
 +./​ADM_matroska/​libADM_matroska.a ./​ADM_asf/​libADM_asf.a \ 
 +./​ADM_h263/​libADM_h263.a ./​ADM_nuv/​libADM_nuv.a \ 
 +./​ADM_ogm/​libADM_ogm.a ./​ADM_audiodevice/​libADM_audiodevice.a \ 
 +./​ADM_xvidratectl/​libADM_xvidratectl.a ./​ADM_requant/​libADM_requant.a \ 
 +./​ADM_ocr/​libADM_ocr.a ./​ADM_mpegdemuxer/​libADM_mpegdemuxer.a \ 
 +./​ADM_audio/​libADM_audio.a ./​ADM_toolkit/​libADM_toolkit.a \ 
 +./​ADM_dialog/​libADM_dialog.a ./​libMpeg2Dec/​liblibMpeg2Dec.a \ 
 +./​ADM_tray/​libADM_tray.a ./​ADM_colorspace/​libADM_colorspace.a \ 
 +ADM_lavcodec/​libavcodec.a ./​ADM_lavutil/​libADM_lavutil.a \ 
 +./​ADM_lavcodec/​libpostproc/​libpostproc.a ./​ADM_library/​libADM_library.a \ 
 +./​ADM_toolkit/​libADM_toolkit.a ./​libass/​libass.a ​  \ 
 +./xpm/adm.o \ 
 +
 +-luuid -ljs -lfontconfig -lmp3lame -lvorbis -lvorbisenc -lfaac -lfaad \ 
 +-ldts -lxvidcore -lpng -lx264 -laften -lmingw32 -lSDLmain -lSDL \ 
 +-mwindows -user32 -lpthreadGC1 -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 \ 
 +-lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 \ 
 +-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 \ 
 +-lglib-2.0 -lintl -liconv -lgthread-2.0 -lfreetype -lz -llibxml2 \ 
 +-lwinmm -lwsock32</​code>​ 
 +  - Link Avidemux2.exe and strip all unnecessary symbols. <​code>​cd avidemux 
 +dolink 
 +strip –-strip-all avidemux2.exe</​code>​ 
 +  - Run avidemux2.exe <​code>​avidemux2</​code>​
  
build/compiling_avidemux.1271207355.txt.gz · Last modified: 2012/11/11 08:51 (external edit)