Add Git+Gerrit command line instructions.
[metze/wireshark/wip.git] / docbook / wsdg_src / WSDG_chapter_tools.asciidoc
1 ++++++++++++++++++++++++++++++++++++++
2 <!-- WSDG Chapter Tools -->
3 ++++++++++++++++++++++++++++++++++++++
4     
5 [[ChapterTools]]
6
7 == Tool Reference
8
9 [[ChToolsIntro]]
10
11 === Introduction
12
13 This chapter will provide you with information about the
14 various tools needed for Wireshark development.
15
16 None of the tools mentioned in this chapter are needed to
17 run Wireshark; they are only needed to build it.
18
19 Most of these tools have their roots on UNIX like
20 platforms, but Win32 ports are also available. Therefore the
21 tools are available in different "flavours":
22
23 * UNIX (or Win32 Cygwin): the tools should be commonly available on the
24   supported UNIX platforms, and for Win32 platforms by using the Cygwin UNIX
25   emulation
26
27 * Win32 native: some tools are available as native Win32 tools, no special
28   emulation is required
29
30 [WARNING]
31 .Follow the directions
32 ====
33 Unless you know exactly what you are doing, you should strictly follow the recommendations given in <<ChapterSetup>>.
34 ====
35
36 The following sections give a very brief description of
37 what a particular tool is doing, how it is used in the
38 Wireshark project and how it can be installed and
39 tested.
40
41 Documentation for these tools is outside the scope of this document. If you need
42 further information on using a specific tool you should find lots of useful
43 information on the web, as these tools are commonly used. You can also get help
44 for the UNIX based tools with `toolname --help` or the man page via `man
45 toolname`.
46
47 You will find explanations of the tool usage for some of the specific
48 development tasks in <<ChapterSources>>.
49
50 [[ChToolsCygwin]]
51
52 === Win32: Cygwin
53
54 Cygwin provides a lot of UNIX based tools on the Win32 platform. It uses a UNIX
55 emulation layer which might be a bit slower compared to the native Win32 tools,
56 but at an acceptable level. The installation and update is pretty easy and done
57 through a single utility, 'setup.exe'.
58
59 The native Windows tools will typically be a bit faster but more complicated to
60 install, as you would have to download the tools from different web sites and
61 install and configure them them individually.
62
63
64 [NOTE]
65 .You must have Cygwin installed
66 ====
67 As there's no Win32 native bash version available, at least a basic installation
68 of Cygwin is required in any case. This may change in the future as packaging
69 systems such as NuGet and Chocolatey mature.
70 ====
71
72 Although Cygwin consists of several separate packages, the installation and
73 update is done through a single utility, 'setup.exe', which acts similar to
74 other web based installers. All tools will be installed into one base folder.
75 The default is 'C:\cygwin'.
76
77 You will find 'setup.exe' at http://www.cygwin.com/[]. Click on one of the
78 "Install Cygwin now" links to download 'setup.exe'. After the download
79 completes, run it.
80
81 Setup.exe will ask you for some settings. The defaults
82 should usually work well, at least initially. At the "Select
83 Packages" page, you'll need to select some additional packages,
84 which are not installed by default. Navigate to the required
85 Category/Package row and click on the "Skip" item in the "New"
86 column so it shows a version number for the required
87 package
88
89 After clicking the Next button several times the setup
90 will then download and install the selected packages (this may
91 take a while, depending on the package size).
92
93 Under: 'Start→Programs→Cygwin→Cygwin Bash Shell' you should now be able to start
94 a new Cygwin bash shell, which is similar to the standard Windows command line
95 interpreters (command.com / cmd.exe) but much more powerful.
96
97 [[ChToolsCygwinPackages]]
98
99 ==== Add/Update/Remove Cygwin Packages
100
101 If you want to add, update, or remove packages later you can do so by running
102 'setup.exe' again. At the "Select Packages" page, the entry in the "New" column
103 will control what is done (or not) with the package. If a new version of a
104 package is available, the new version number will be displayed, so it will be
105 automatically updated. You can change the current setting by simply clicking at
106 it, it will change between:
107
108 * 'A specific version number.' This specific package version will be installed.
109
110 * 'Skip.' Not installed, no changes.
111
112 * 'Keep.' Already installed, no changes.
113
114 * 'Uninstall.' Uninstall this package.
115
116 * 'Reinstall.' Reinstall this package.
117
118 [[ChToolsGNUChain]]
119
120 === GNU compiler toolchain (UNIX or Win32 Cygwin)
121
122 [[ChToolsGCC]]
123
124 ==== gcc (GNU compiler collection)
125
126 [WARNING]
127 .Compiling with gcc on Windows is discouraged
128 ====
129 Using Cygwin gcc to compile Wireshark is unsupported and recommended. If you
130 really want to try it anyway see:
131 http://wiki.wireshark.org/Development/CygwinGCC[] for details.
132 ====
133
134 The GCC C compiler is available for most of the
135 UNIX-like platforms and as the Devel/gcc package from the
136 <<ChToolsCygwin,Cygwin setup>>.
137
138 If GCC isn't already installed or available
139 as a package for your platform, you can get it at:
140 http://gcc.gnu.org/[].
141
142 After correct installation, typing at the
143 bash command line prompt:
144
145 ----
146 $ gcc --version
147 ----
148
149 should result in something like
150
151 ----
152 gcc (GCC) 3.4.4 (cygwin special) (gdc 0.12, using dmd 0.125)
153 Copyright (C) 2004 Free Software Foundation, Inc.
154 This is free software; see the source for copying conditions.  There is NO
155 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
156 ----
157
158 Your version string may vary, of course.
159
160 [[ChToolsGDB]]
161
162 ==== gdb (GNU project debugger)
163
164 GDB is the debugger for the GCC compiler. It is
165 available for many (if not all) UNIX-like platforms and as
166 the Devel/gdb package from the
167 <<ChToolsCygwin,Cygwin setup>>
168
169 If you don't like debugging using the command line
170 there are some GUI frontends for it available, most notably
171 GNU DDD.
172
173 If gdb isn't already installed or available
174 as a package for your platform, you can get it at:
175 http://www.gnu.org/software/gdb/gdb.html[].
176
177 After correct installation:
178
179 ----
180 $ gdb --version
181 ----
182
183 should result in something like:
184
185 ----
186 GNU gdb 6.5.50.20060706-cvs (cygwin-special)
187 Copyright 2003 Free Software Foundation, Inc.
188 GDB is free software, covered by the GNU General Public License, and you are
189 welcome to change it and/or distribute copies of it under certain conditions.
190 Type "show copying" to see the conditions.
191 There is absolutely no warranty for GDB.  Type "show warranty" for details.
192 This GDB was configured as "i686-pc-cygwin".
193 ----
194
195 Your version string may vary, of course.
196
197 [[ChToolsDDD]]
198
199
200 ==== ddd (GNU Data Display Debugger)
201
202 The GNU Data Display Debugger is a good GUI frontend
203 for GDB (and a lot of other command line debuggers), so you
204 have to install GDB first. It is available for many UNIX-like
205 platforms and as the ddd package from the
206 <<ChToolsCygwin,Cygwin setup>>.
207
208 If GNU DDD isn't already installed or
209 available as a package for your platform, you can get it at:
210 http://www.gnu.org/software/ddd/[].
211
212 [[ChToolsGNUmake]]
213
214 ==== make (GNU Make)
215
216 [NOTE]
217 .GNU make isn't supported either
218 ====
219 Although some effort is made to use make from the
220 Cygwin environment, the mainline is still using Microsoft
221 Visual Studio's nmake.
222 ====
223
224 GNU Make is available for most of the UNIX-like
225 platforms and also as the Devel/make package from the
226 <<ChToolsCygwin,Cygwin setup>>.
227
228 If GNU Make isn't already installed or
229 available as a package for your platform, you can get it at:
230 http://www.gnu.org/software/make/[].
231
232 After correct installation:
233
234 ----
235 $ make --version
236 ----
237
238 should result in something like:
239
240 ----
241 GNU Make 3.81
242 Copyright (C) 2006  Free Software Foundation, Inc.
243 This is free software; see the source for copying conditions.
244 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
245 PARTICULAR PURPOSE.
246 ----
247
248 Your version string may vary, of course.
249
250 [[ChToolsMSChain]]
251
252 === Microsoft compiler toolchain (Win32 native)
253
254 To compile Wireshark on Windows using the Microsoft C/$$C++$$
255 compiler, you'll need:
256
257 . C compiler (`cl.exe`)
258
259 . Assembler (`ml.exe` for 32-bit targets and `ml64.exe` for 64-bit targets)
260
261 . Linker (`link.exe`)
262
263 . Make (`nmake.exe`)
264
265 . C runtime headers and libraries (e.g. 'stdio.h', 'msvcrt.lib')
266
267 . Windows platform headers and libraries (e.g.
268 'windows.h', 'WSock32.lib')
269
270 // Can we drop support for CHM?
271 . HTML help headers and libraries ('htmlhelp.h', 'htmlhelp.lib')
272
273 ==== Toolchain Package Alternatives
274
275 The official Wireshark 1.8.x and 1.10.x releases are compiled using
276 Microsoft Visual $$C++$$ 2010 SP1.
277 The official 1.2, 1.4, and 1.6 releases were compiled using
278 Microsoft Visual $$C++$$ 2008 SP1.
279 Other past releases, including the 1.0 branch,
280 were compiled using Microsoft Visual $$C++$$ 6.0. Using the release
281 compilers is recommended for Wireshark development work. "Express
282 Edition" compilers such as Visual $$C++$$ 2010 Express Edition SP1 can be
283 used but any PortableApps packages you create with them
284 will require the installation of a separate Visual $$C++$$
285 Redistributable package on any machine on which the PortableApps
286 package is to be used. See
287 <<msvc-runtime-redistributable>> below for more details.
288
289 However, you might already have a different Microsoft $$C++$$ compiler
290 installed. It should be possible to use any of the following with the considerations listed:
291
292
293 .Visual C++ 2010 Express Edition (recommended)
294
295 IDE + Debugger?:: Yes
296
297 Purchase required?:: http://www.microsoft.com/express/Downloads/#Visual_Studio_2010_Express_Downloads[Free Download]
298
299 SDK required for 64-bit builds?:: Yes.
300
301 config.nmake MSVC_VARIANT:: MSVC2010EE
302
303 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x86`
304
305 64-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x64`
306
307 Remarks:: Installers created using express editions require a $$C++$$ redistributable
308 ('$$vcredist_x86.exe$$' or
309 '$$vcredist_x86.exe$$').footnoteref[vcredist,'$$vcredist_x86.exe$$' (3MB free
310 download) is required to build
311 Wireshark-win32-wireshark-major-minor-version:[].x.exe, and
312 '$$vcredist_x64.exe$$' is required to build
313 Wireshark-win64-wireshark-major-minor-version:[].x.exe. The version of
314 '$$vcredist_x86.exe$$' or '$$vcredist_x64.exe$$' _must_ match the version for your
315 compiler including any service packs installed for the compiler.]
316
317
318 .Visual Studio 2010
319
320 IDE + Debugger?:: Yes
321
322 Purchase required?:: Yes
323
324 SDK required for 64-bit builds?:: No
325
326 config.nmake MSVC_VARIANT:: MSVC2010
327
328 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x86`
329
330 64-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat x64_`
331
332 Remarks:: Default compiler in 'config.nmake'. Building a 64-bit installer
333 requires a a $$C++$$ redistributable
334 ('$$vcredist_x86.exe$$').footnoteref[vcredist]
335
336
337 .Visual C++ 2008 Express Edition SP1
338
339 IDE + Debugger?:: Yes
340
341 Purchase required?:: http://www.microsoft.com/download/details.aspx?id=14597[Free Download]
342
343 SDK required for 64-bit builds?:: 64-bit build not supported
344
345 config.nmake MSVC_VARIANT:: MSVC2008EE
346
347 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat`
348
349 Remarks:: Installers created using express editions require a $$C++$$ redistributable
350 ('$$vcredist_x86.exe$$').footnoteref[vcredist]
351
352
353 .Visual Studio 2008
354
355 IDE + Debugger?:: Yes
356
357 Purchase required?:: Yes
358
359 SDK required for 64-bit builds?:: 64-bit build not supported
360
361 config.nmake MSVC_VARIANT:: MSVC2008
362
363 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat`
364
365
366 .Visual C++ 2005 Express Edition
367
368 IDE + Debugger?:: Yes
369
370 Purchase required?:: Free Download (link disappeared)
371
372 SDK required for 64-bit builds?:: 64-bit build not supported
373
374 config.nmake MSVC_VARIANT:: MSVC2005EE
375
376 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat`
377
378 Remarks:: Installers created using express editions require a $$C++$$ redistributable
379 ('$$vcredist_x86.exe$$').footnoteref[vcredist]
380
381
382 .Visual Studio 2005
383
384 IDE + Debugger?:: Yes
385
386 Purchase required?:: Yes
387
388 SDK required for 64-bit builds?:: 64-bit build not supported
389
390 config.nmake MSVC_VARIANT:: MSVC2005
391
392 32-bit environment setup:: `%PROGRAMFILES%\Microsoft Visual Studio 8\VC\bin\vcvars32.bat`
393
394 ==== Legal issues with MSVC > V6?
395
396 Please note: The following is not legal advice - ask your preferred lawyer
397 instead. It's the author's view, but this view might be wrong.
398
399 The myriad of http://anonsvn.wireshark.org/wireshark-win32-libs/tags/[Win32
400 support lib] port projects all seem to believe there are legal issues involved
401 in using newer versions of Visual Studio. This FUD essentially stems from two
402 misconceptions:
403
404 . Unfortunately, it is believed by many that the Microsoft Visual Studio 2003
405 EULA explicitly forbids linking with GPL'ed programs. This belief is probably
406 due to an improper interpretation of the
407 http://msdn.microsoft.com/visualc/vctoolkit2003/eula.aspx[Visual Studio 2003
408 Toolkit EULA], which places redistribution restrictions only on SOURCE CODE
409 SAMPLES which accompany the toolkit.
410
411 . Other maintainers believe that the GPL itself forbids using Visual Studio 2003
412 since one of the required support libraries (MSVCR71.DLL) does not ship with the
413 Windows operating system. This is also a wrongful interpretation, and the
414 http://www.gnu.org/licenses/gpl-faq.html#WindowsRuntimeAndGPL[GPL FAQ]
415 explicitly addresses this issue.
416
417 The situation is similar for Visual Studio 2005 and later.
418
419 It should be perfectly legal to compile
420 Wireshark, distribute, run it if it was compiled with any
421 MSVC version > V6.
422
423 ==== cl.exe (C Compiler)
424
425 The following table gives an overview of the possible
426 Microsoft toolchain variants and their specific C compiler
427 versions ordered by release date.
428
429 |===============
430 |Compiler Package|cl.exe|_MSC_VER|CRT DLL
431 |Visual Studio 2005|8.0|1400|msvcr80.dll
432 |Visual $$C++$$ 2005 Express Edition
433 |.NET Framework 2.0 SDK
434 |Windows SDK for Windows Vista and
435 .NET Framework 3.0 Runtime Components
436 |Visual Studio 2008|9.0|1500|msvcr90.dll
437 |Visual Studio 2008 Express Edition
438 |Visual Studio 2010|10.0|1600|msvcr100.dll
439 |Visual Studio 2010 Express Edition
440 |===============
441
442 After correct installation of the toolchain, typing
443 at the command line prompt (cmd.exe):
444
445 ----
446 > cl
447 ----
448
449 should result in something like:
450
451 ----
452 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
453 Copyright (C) Microsoft Corp. All rights reserved.
454
455 usage: cl [ option... ] filename... [ /link linkoption... 
456 ----
457
458 However, the version string may vary.
459
460 [[ChToolsNMake]]
461
462 ==== nmake.exe (Make)
463
464 Nmake is part of the toolchain packages described
465 above.
466
467 Instead of using the workspace (.dsw) and projects (.dsp) files, the traditional
468 nmake makefiles are used. This has one main reason: it makes it much easier to
469 maintain changes simultaneously with the GCC toolchain makefile.am files as both
470 file formats are similar. However, as no Visual Studio workspace/project files
471 are available, this makes it hard to use the Visual Studio IDE e.g. for using
472 the integrated debugging feature.
473
474 After correct installation, typing at the command line prompt (cmd.exe):
475
476 ----
477 > nmake
478 ----
479
480 should result in something like:
481
482 ----
483 Microsoft (R) Program Maintenance Utility   Version 6.00.9782.0
484 Copyright (C) Microsoft Corp 1988-1998. All rights reserved.
485
486 NMAKE : fatal error U1064: MAKEFILE not found and no target specified
487 Stop.
488 ----
489
490 However, the version string may vary.
491
492 Documentation on nmake can be found at
493 http://msdn2.microsoft.com/library/dd9y37ha(VS.71).aspx[Microsoft MSDN]
494
495 ==== link.exe (Linker)
496
497 ****
498 This section not yet written
499 ****
500
501 [[msvc-runtime-redistributable]]
502
503
504 ==== C-Runtime "Redistributable" Files
505
506 Please note: The following is not legal advice - ask your preferred lawyer
507 instead. It's the authors view and this view might be wrong.
508
509 Depending on the Microsoft compiler version you use, some binary files coming
510 from Microsoft might be required to be installed on Windows machine to run
511 Wireshark. On a developer machine, the compiler setup installs these files so
512 they are available - but they might not be available on a user machine!
513
514 This is especially true for the C runtime DLL (msvcr*.dll), which contains the
515 implementation of ANSI and alike functions, e.g.: fopen(), malloc(). The DLL is
516 named like: msvcr'version'.dll, an abbreviation for "MicroSoft Visual C
517 Runtime". For Wireshark to work, this DLL must be available on the users
518 machine.
519
520 Starting with MSVC7, it is necessary to ship the C runtime DLL
521 (msvcr'version'.dll) together with the application installer somehow, as that
522 DLL is possibly not available on the target system.
523
524
525 [NOTE]
526 .Make sure you're allowed to distribute this file
527 ====
528 The files to redistribute must be mentioned in the
529 redist.txt file of the compiler package. Otherwise it
530 can't be legally redistributed by third parties like
531 us.
532 ====
533
534 The following MSDN links are recommended for the
535 interested reader:
536
537 * http://msdn2.microsoft.com/library/ms235299(VS.80).aspx[Redistributing Visual C++ Files]
538
539 * http://msdn2.microsoft.com/library/ms235291(VS.80).aspx[How to: Deploy using XCopy]
540
541 * http://support.microsoft.com/?scid=kb%3Ben-us%3B326922&amp;x=10&amp;y=13[Redistribution
542   of the shared C runtime component in Visual $$C++$$ 2005 and in Visual $$C++$$
543   .NET]
544
545 In all cases where '$$vcredist_x86.exe$$' or '$$vcredist_x64.exe$$' is
546 downloaded it should be downloaded to the directory into which the support
547 libraries for Wireshark have been downloaded and installed. This directory is
548 specified by the WIRESHARK_LIB_DIR setting in the 'config.nmake'. By default it
549 is 'C:\wireshark-win32-libs'. It need not, and should not, be run after being
550 downloaded.
551
552 ===== msvcr80.dll / vcredist_x86.exe - Version 8.0 (2005)
553
554 There are three redistribution methods that MSDN
555 mentions for MSVC 8 (see
556 http://msdn.microsoft.com/library/ms235316(VS.80).aspx["Choosing a Deployment Method"]):
557
558 . 'Using Visual $$C++$$ Redistributable Merge Modules'.
559 (Loadable modules for building msi installers.
560 Not suitable for Wireshark's NSIS based installer)
561
562 . 'Using Visual $$C++$$ Redistributable Package'. The Microsoft libraries are
563 installed by copying '$$vcredist_x86.exe$$', '$$vcredist_x64.exe$$', or
564 '$$vcredist_ia64.exe$$' to the target machine and executing it on that machine
565 (MSDN recommends this for applications built with Visual Studio 2005 Express
566 Edition).
567
568 . 'Install a particular Visual $$C++$$ assembly as a private assembly for the
569 application'. The Microsoft libraries are installed by copying the folder
570 content of 'Microsoft.VC80.CRT' to the target directory (e.g. 'C:\Program
571 Files\Wireshark')
572
573 To save installer size, and to make a portable
574 version of Wireshark (which must be completely self-contained,
575 on a medium such as a flash drive, and not require that an
576 installer be run to install anything on the target machine)
577 possible, when building 32-bit Wireshark with MSVC2005, method
578 3 (copying the content of 'Microsoft.VC80.CRT')
579 is used (this produces the smallest package).
580
581 As MSVC2005EE and DOTNET20 don't provide the folder
582 'Microsoft.VC80.CRT', when 32-bit Wireshark
583 is built with either of them method 2 is used.
584 You'll have to download the appropriate version of
585 '$$vcredist_x86.exe$$' from Microsoft for your
586 compiler version.
587
588 A portable version of 64-bit Wireshark is not built, so method 3 is used for all
589 64-bit builds. You'll have to download the appropriate version of
590 '$$vcredist_x64.exe$$' or '$$vcredist_ia64.exe$$' from Microsoft for your target
591 processor and compiler version.
592
593 * For 32-bit builds using Microsoft Visual $$C++$$ 2005
594 Express Edition without Service Pack 1, you need
595 '8.0.50608.0',
596 from: "Microsoft Visual $$C++$$ 2005 Redistributable Package (x86)":
597 http://www.microsoft.com/download/details.aspx?id=3387[].
598
599 * For 64-bit x86 (x64) builds using Microsoft Visual $$C++$$
600 2005, any edition, without Service Pack 1, you need
601 '{fill this in}',
602 from: "Microsoft Visual $$C++$$ 2005 Redistributable Package (x64)":
603 http://www.microsoft.com/download/details.aspx?id=21254[].
604
605 * For IA-64 builds using Microsoft Visual $$C++$$ 2005, any
606 edition, without Service Pack 1, you need
607 '{fill this in}',
608 from: "Microsoft Visual $$C++$$ 2005 Redistributable Package (IA64)":
609 http://www.microsoft.com/download/details.aspx?id=16326[].
610
611 * For 32-bit builds using Microsoft Visual $$C++$$ 2005
612 Express Edition with Service Pack 1, you need
613 '8.0.50727.762', from: "Microsoft
614 Visual $$C++$$ 2005 SP1 Redistributable Package (x86)":
615 http://www.microsoft.com/download/details.aspx?id=5638[].
616
617 * For 64-bit x86 builds using Microsoft Visual $$C++$$ 2005,
618 any edition, with Service Pack 1, you need
619 '{fill this in}', from: "Microsoft
620 Visual $$C++$$ 2005 SP1 Redistributable Package (x64)":
621 http://www.microsoft.com/download/details.aspx?id=18471[].
622
623 Please send a message to the wireshark-dev mailing list if you
624 find a different version number.
625
626 ===== msvcr90.dll / vcredist_x86.exe / vcredist_x64.exe - Version 9.0 (2008)
627
628 There are three redistribution methods that MSDN
629 mentions for MSVC 9 (see:
630 http://msdn.microsoft.com/en-US/library/ms235316(v=vs.90).aspx["Choosing a Deployment Method"]):
631
632 . 'Using Visual $$C++$$ Redistributable Merge Modules'.
633 (Loadable modules for building msi installers.
634 Not suitable for Wireshark's NSIS based installer)
635
636 . 'Using Visual $$C++$$ Redistributable Package'. The Microsoft
637 libraries are installed by copying '$$vcredist_x64.exe$$' or
638 '$$vcredist_x86.exe$$' to the target machine and executing it on that machine
639 (MSDN recommends this for applications built with Visual Studio 2008 Express
640 Edition)
641
642 . 'Install a particular Visual $$C++$$ assembly as a private assembly for the
643 application'. The Microsoft libraries are installed by copying the folder
644 content of _Microsoft.VC90.CRT_to the target directory (e.g. 'C:\Program
645 Files\Wireshark')
646
647 To save installer size and to make a portable version of Wireshark (which must
648 be completely self-contained, on a medium such as a flash drive, and not require
649 that an installer be run to install anything on the target machine) possible,
650 when building 32-bit Wireshark with MSVC2008, method 3 (copying the content of
651 'Microsoft.VC90.CRT') is used (this produces the smallest package).
652
653 As MSVC2008EE doesn't provide the folder 'Microsoft.VC90.CRT', when 32-bit
654 Wireshark is built with it method 2 is used. You'll have to download the
655 appropriate version of '$$vcredist_x64.exe$$' from Microsoft for your compiler
656 version.
657
658 A portable version of 64-bit Wireshark is not built, so method 2 is used for all
659 64-bit builds. You'll have to download the appropriate version of
660 '$$vcredist_x86.exe$$' from Microsoft for your compiler version.
661
662
663 * For 32-bit builds using Microsoft Visual $$C++$$ 2008
664 Express Edition without Service Pack 1, you need
665 '9.0.21022.8', from:
666 "Microsoft Visual $$C++$$ 2008 Redistributable Package (x86)":
667 http://www.microsoft.com/download/details.aspx?id=29[].
668
669 * For 64-bit builds using Microsoft Visual $$C++$$ 2008,
670 any edition, without Service Pack 1, you need
671 '9.0.21022.8', from:
672 "Microsoft Visual $$C++$$ 2008 Redistributable Package (x64)":
673 http://www.microsoft.com/download/details.aspx?id=15336[].
674
675 * For 32-bit builds with Microsoft Visual $$C++$$ 2008
676 Express Edition with Service Pack 1, you need
677 '9.0.30729.17', from:
678 "Microsoft Visual $$C++$$ 2008 SP1 Redistributable Package (x86)":
679 http://www.microsoft.com/download/details.aspx?id=5582[].
680
681 * For 64-bit builds with Microsoft Visual $$C++$$ 2008,
682 any edition, with Service Pack 1, you need
683 '9.0.30729.17', from:
684 "Microsoft Visual $$C++$$ 2008 SP1 Redistributable Package (x64)":
685 http://www.microsoft.com/download/details.aspx?id=2092[].
686
687 Please send a message to the wireshark-dev mailing list if you
688 find a different version number.
689
690 ===== msvcr100.dll / vcredist_x86.exe / vcredist_x64.exe - Version 10.0 (2010)
691
692 There are three redistribution methods that MSDN
693 mentions for MSVC 10 (see:
694 http://msdn.microsoft.com/en-US/library/ms235316(v=vs.100).aspx["Choosing a Deployment Method"]):
695
696 . 'Using Visual $$C++$$ Redistributable Package'.
697 The Microsoft libraries are installed by copying
698 '$$vcredist_x64.exe$$' or
699 '$$vcredist_x86.exe$$' to the target
700 machine and executing it on that machine (MSDN recommends
701 this for applications built with Visual Studio 2010,
702 both Express Edition and non-Express editions)
703
704 . 'Using Visual $$C++$$ Redistributable Merge Modules'.
705 (Loadable modules for building msi installers.
706 Not suitable for Wireshark's NSIS based installer)
707
708 . 'Install a particular Visual $$C++$$ assembly as a
709 private assembly for the application'. The
710 Microsoft libraries are installed by copying the folder
711 content of 'Microsoft.VC100.CRT' to
712 the target directory (e.g. 'C:\Program Files\Wireshark')
713
714 To save installer size, and to make a portable
715 version of Wireshark (which must be completely self-contained,
716 on a medium such as a flash drive, and not require that an
717 installer be run to install anything on the target machine)
718 possible, when building 32-bit Wireshark with MSVC2010, method
719 3 (copying the content of 'Microsoft.VC100.CRT')
720 is used (this produces the smallest package).
721
722 As MSVC20010EE doesn't provide the folder 'Microsoft.VC100.CRT', when 32-bit
723 Wireshark is built with it method 1 is used. You'll have to download the
724 appropriate version of '$$vcredist_x64.exe$$' from Microsoft that corresponds to
725 your compiler version.
726
727 A portable version of 64-bit Wireshark is not built, so method
728 1 is used for all 64-bit builds.  You'll have to download the
729 appropriate version of '$$vcredist_x86.exe$$' from Microsoft for your compiler version.
730
731 * For 32-bit builds using Microsoft Visual $$C++$$ 2010
732 Express Edition without Service Pack 1, you need
733 '10.0.30319.1', from: "Microsoft Visual
734 $$C++$$ 2010 Redistributable Package (x86)":
735 http://www.microsoft.com/download/en/details.aspx?id=5555[].
736
737 * For 64-bit builds using Microsoft Visual $$C++$$ 2010,
738 any edition, without Service Pack 1, you need
739 '10.0.30319.1', from: "Microsoft Visual
740 $$C++$$ 2010 Redistributable Package (x64)":
741 http://www.microsoft.com/download/details.aspx?id=14632[].
742
743 * For 32-bit builds using Microsoft Visual $$C++$$ 2010
744 Express Edition with Service Pack 1, you need
745 '10.0.40219.1', from: "Microsoft Visual
746 $$C++$$ 2010 SP1 Redistributable Package (x86)":
747 http://www.microsoft.com/download/en/details.aspx?id=8328[].
748
749 * For 64-bit builds using Microsoft Visual $$C++$$ 2010,
750 any edition, with Service Pack 1, you need
751 '10.0.40219.1', from: "Microsoft Visual
752 $$C++$$ 2010 SP1 Redistributable Package (x64)":
753 http://www.microsoft.com/download/details.aspx?id=13523[].
754
755 Please report to the developer mailing list, if you
756 find a different version number!
757
758 ==== Windows (Platform) SDK
759
760 The Windows Platform SDK (PSDK) or Windows SDK is a free
761 (as in beer) download and contains platform specific headers and
762 libraries (e.g. 'windows.h', 'WSock32.lib', etc.). As new Windows
763 features evolve in time, updated SDK's become available that
764 include new and updated APIs.
765
766 When you purchase a commercial Visual Studio, it will
767 include an SDK. The free (as in beer) downloadable C compiler
768 versions (V$$C++$$ 2012 Express, V$$C++$$ 2012 Express, etc.) do not
769 contain an SDK -- you'll need to download a PSDK in order to
770 have the required C header files and libraries.
771
772 Older versions of the SDK should also work. However, the
773 command to set the environment settings will be different, try
774 search for SetEnv.* in the SDK directory.
775
776 Prior to Windows Vista, the name "Platform SDK" was used;
777 starting with Vista, the name was changed just to "Windows
778 Software Development Kit" or "Windows SDK".  The full names of the
779 SDKs can be misleading; for example, the SDK for Vista was called
780 the "Microsoft Windows Software Development Kit for Windows Vista
781 and .NET Framework 3.0 Runtime Components", which really means the
782 Windows SDK for Windows Vista and Platforms (like WinXP) that have
783 the .NET 3.0 runtime installed.
784
785 ==== HTML Help
786
787 HTML Help is used to create the User's and Developer's Guide in .chm format and
788 to show the User's Guide as the Wireshark "Online Help".
789
790 Both features are currently optional, and might be removed in future versions.
791
792 ===== HTML Help Compiler (hhc.exe)
793
794 This compiler is used to generate a .chm file from a bunch of HTML files -- in
795 our case to generate the User's and Developer's Guide in .chm format.
796
797 The compiler is only available as the free (as in beer) "HTML Help Workshop"
798 download. If you want to compile the guides yourself, you need to download and
799 install this. If you don't install it into the default directory, you may also
800 have a look at the HHC_DIR setting in the file docbook/Makefile.
801
802 ===== HTML Help Build Files (htmlhelp.c / htmlhelp.lib)
803
804 The files 'htmlhelp.c' and 'htmlhelp.lib' are required to
805 be able to open .chm files from Wireshark and show the
806 online help. Both files are part of the SDK (standalone (P)SDK or MSVC
807 since 2002).
808
809 Simply set HHC_DIR in 'config.nmake' to use it.
810
811 [[ChToolsDebugger]]
812
813 ==== Debugger
814
815 Using a good debugger can save you a lot of development time.
816
817 The debugger you use must match the C compiler Wireshark was compiled with,
818 otherwise the debugger will simply fail or you will only see a lot of garbage.
819
820 [[ChToolsMSVCDebugger]]
821
822 ===== Visual Studio integrated debugger
823
824 You can use the integrated debugger of Visual Studio if your toolchain includes
825 it. However, setting up the environment is a bit tricky, as the Win32 build
826 process uses makefiles instead of the .dsp/.dsw files usually used.
827
828 ****
829 This section not yet written
830 ****
831
832 [[ChToolsMSDebuggingTools]]
833
834 ===== Debugging Tools for Windows
835
836 You can also use the Microsoft Debugging Tools for Windows toolkit, which is a
837 standalone GUI debugger. Although it's not that comfortable compared to
838 debugging with the Visual Studio integrated debugger it can be helpful if you
839 have to debug on a machine where an integrated debugger is not available.
840
841 You can get it free of charge at:
842 http://www.microsoft.com/whdc/devtools/debugging/default.mspx[] (as
843 links to Microsoft pages change from time to time, search
844 for "Debugging Tools" at their page if this link happens to be
845 outdated).
846
847 [[ChToolsBash]]
848
849
850 === bash
851
852 The bash shell is needed to run several shell scripts.
853
854 [[ChToolsGNUBash]]
855
856 ==== UNIX or Win32 Cygwin: GNU bash
857
858 The bash shell is available for most of the UNIX-like
859 platforms and as the bash package from the
860 <<ChToolsCygwin,Cygwin setup>>.
861
862 If bash isn't already installed or
863 available as a package for your platform, you can get it at
864 http://www.gnu.org/software/bash/bash.html[].
865
866 After correct installation, typing at the bash command line prompt:
867
868 ----
869 $ bash --version
870 ----
871
872 should result in something like:
873
874 ----
875 GNU bash, version 3.1.17(6)-release (i686-pc-cygwin)
876 Copyright (C) 2005 Free Software Foundation, Inc.
877 ----
878
879 However, the version string may vary.
880
881 [[ChToolsWin32Bash]]
882
883 ==== Win32 native:
884
885 // MinGW? PowerShell?
886 ****
887 This section not yet written
888 ****
889
890 [[ChToolsPython]]
891
892 === Python
893
894 Python is an interpreted programming language. The homepage of the Python
895 project is http://python.org/[]. It is used to generate some source files.
896 Python 2.5 or later (including Python 3) should work fine but Python 2.7 is
897 recommended.
898
899 [[ChToolsUnixPython]]
900
901 ==== UNIX or Win32 Cygwin: Python
902
903 // XXX - This seems to contradict other parts of the documentation.
904 // Do we recommend Cygwin Python or not?
905
906 Python is available for most UNIX-like platforms
907 and as the python package from the
908 <<ChToolsCygwin,Cygwin setup>>
909
910 If Python isn't already installed or
911 available as a package for your platform, you can get it at
912 http://www.python.org/[].
913
914 After correct installation, typing at the
915 bash command line prompt:
916
917 ----
918 $ python --version
919 ----
920
921 should result in something like:
922
923 Python 2.7.3
924
925 However, the version string may vary.
926
927 [[ChToolsWin32Python]]
928
929 ==== Win32 native: python
930
931 Get Python (2.7 is recommended) from
932 http://python.org/download/[].
933 You can download an installation package there, which
934 will install the Python system in the top level of your
935 'C:' drive by default, e.g.
936 'C:\Python27'.
937
938 You can check for a successful installation from a command prompt (cmd.exe):
939
940 ----
941 C:\> cd python27
942
943 C:\Python27> python --version
944 ----
945
946 The output should look something like:
947
948 ----
949 Python 2.7.5
950 ----
951
952 However, the version string may vary.
953
954 [[ChToolsPerl]]
955
956 === Perl
957
958 Perl is an interpreted programming language. The
959 homepage of the Perl project is
960 http://www.perl.com[]. Perl is used to convert
961 various text files into usable source code. Perl version 5.6
962 and above should work fine.
963
964 [[ChToolsUnixPerl]]
965
966 ==== UNIX or Win32 Cygwin: Perl
967
968 Perl is available for most of the UNIX-like platforms
969 and as the perl package from the
970 <<ChToolsCygwin,Cygwin setup>>.
971
972 If perl isn't already installed or available
973 as a package for your platform, you can get it at
974 http://www.perl.com/[].
975
976 After correct installation, typing at the
977 bash command line prompt:
978
979 ----
980 $ perl --version
981 ----
982
983 should result in something like:
984
985 ----
986 This is perl, v5.8.7 built for cygwin-thread-multi-64int
987 (with 1 registered patch, see perl -V for more detail)
988
989 Copyright 1987-2005, Larry Wall
990
991 Perl may be copied only under the terms of either the Artistic License or the
992 GNU General Public License, which may be found in the Perl 5 source kit.
993
994 Complete documentation for Perl, including FAQ lists, should be found on
995 this system using `man perl' or `perldoc perl'.  If you have access to the
996 Internet, point your browser at http://www.perl.com/, the Perl Home Page.
997 ----
998
999 However, the version string may vary.
1000
1001 [[ChToolsWin32Perl]]
1002
1003 ==== Win32 native: Perl
1004
1005 // XXX - Straberry?
1006 A native Win32 Perl package can be obtained from
1007 http://www.ActiveState.com[]. The installation
1008 should be straightforward.
1009
1010 After correct installation, typing at the command
1011 line prompt (cmd.exe):
1012
1013 ----
1014 > perl -v
1015 ----
1016
1017 should result in something like:
1018
1019 ----
1020 This is perl, v5.8.0 built for MSWin32-x86-multi-thread
1021 (with 1 registered patch, see perl -V for more detail)
1022
1023 Copyright 1987-2002, Larry Wall
1024
1025 Binary build 805 provided by ActiveState Corp. http://www.ActiveState.com
1026 Built 18:08:02 Feb  4 2003
1027 ...
1028 ----
1029
1030 However, the version string may vary.
1031
1032 [[ChToolsSed]]
1033
1034 === sed
1035
1036 Sed it the streaming editor. It makes it easy for example
1037 to replace text inside a source code file.
1038 The Wireshark build process uses this to stamp version strings
1039 in various places.
1040
1041 [[ChToolsUnixSed]]
1042
1043 ==== UNIX or Win32 Cygwin: sed
1044
1045 Sed is available for most of the UNIX-like platforms
1046 and as the sed package from the
1047 <<ChToolsCygwin,Cygwin setup>>.
1048
1049 If sed isn't already installed or available
1050 as a package for your platform, you can get it at
1051 http://directory.fsf.org/GNU/sed.html[]
1052
1053 After correct installation, typing at the
1054 bash command line prompt:
1055
1056 ----
1057 $ sed --version
1058 ----
1059
1060 should result in something like:
1061
1062 ----
1063 GNU sed version 4.1.5
1064 Copyright (C) 2003 Free Software Foundation, Inc.
1065 This is free software; see the source for copying conditions.  There is NO
1066 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
1067 to the extent permitted by law.
1068 ----
1069
1070 However, the version string may vary.
1071
1072 [[ChToolsWin32Sed]]
1073
1074 ==== Win32 native: sed
1075
1076 A native Win32 sed package can be obtained from
1077 http://gnuwin32.sourceforge.net/[]. The
1078 installation should be straightforward.
1079
1080 [[ChToolsYacc]]
1081
1082 === yacc (bison)
1083
1084 Bison is a free implementation of yacc.
1085
1086 [[ChToolsUnixYacc]]
1087
1088 ==== UNIX or Win32 Cygwin: bison
1089
1090 // XXX Add win flex-bison. The Chocolatey version isn't
1091 // ready pending a Chocolatey bug.
1092
1093 Bison is available for most of the UNIX-like platforms
1094 and as the bison package from the
1095 <<ChToolsCygwin,Cygwin setup>>.
1096
1097 If GNU Bison isn't already installed or
1098 available as a package for your platform, you can get it at:
1099 http://www.gnu.org/software/bison/bison.html[].
1100
1101 After correct installation, typing at the
1102 bash command line prompt:
1103
1104 ----
1105 $ bison --version
1106 ----
1107
1108 should result in something like:
1109
1110 ----
1111 bison (GNU Bison) 2.3
1112 Written by Robert Corbett and Richard Stallman.
1113
1114 Copyright (C) 2006 Free Software Foundation, Inc.
1115 This is free software; see the source for copying conditions.  There is NO
1116 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1117 ----
1118
1119 However, the version string may vary.
1120
1121 [[ChToolsWin32Yacc]]
1122
1123 ==== Win32 native: bison
1124
1125 A native Win32 yacc/bison package can be obtained from
1126 http://gnuwin32.sourceforge.net/[]. The
1127 installation should be straightforward.
1128
1129 [[ChToolsLexx]]
1130
1131 === flex
1132
1133 Flex is a free implementation of lexx.
1134
1135 [[ChToolsUnixLexx]]
1136
1137 ==== UNIX or Win32 Cygwin: flex
1138
1139 Flex is available for most of the UNIX-like platforms
1140 and as the flex package from the
1141 <<ChToolsCygwin,Cygwin setup>>.
1142
1143 If GNU flex isn't already installed or
1144 available as a package for your platform, you can get it at
1145 http://www.gnu.org/software/flex/[].
1146
1147 After correct installation, typing at the
1148 bash command line prompt:
1149
1150 ----
1151 $ flex --version
1152 ----
1153
1154 should result in something like:
1155
1156 ----
1157 flex version 2.5.4
1158 ----
1159
1160 However, the version string may vary.
1161
1162 [[ChToolsWin32Lexx]]
1163
1164 ==== Win32 native: flex
1165
1166 A native Win32 lexx/flex package can be obtained from
1167 http://gnuwin32.sourceforge.net/[]. The
1168 installation should be straightforward.
1169
1170 [[ChToolsGit]]
1171
1172 === Git client
1173
1174 The Wireshark project uses its own Git repository
1175 to keep track of all the changes done to the source
1176 code. Details about the usage of Git in the Wireshark
1177 project can be found in
1178 <<ChSrcGitRepository>>.
1179
1180 If you want to work with the source code and are planning to
1181 commit your changes back to the Wireshark community, it is
1182 recommended to use a Git client to get the latest source files.
1183 For detailed information about the different ways to obtain the
1184 Wireshark sources, see
1185 <<ChSrcObtain>>.
1186
1187 You will find more instructions in
1188 <<ChSrcGit>> on how to use the Git
1189 client.
1190
1191 [[ChToolsUnixGit]]
1192
1193 ==== UNIX or Win32 Cygwin: git
1194
1195 Git is available for most of the UNIX-like platforms
1196 and as the Git package from the
1197 <<ChToolsCygwin,Cygwin setup>>
1198
1199 If Git isn't already installed or available as a package for your platform, you
1200 can get it at: http://git-scm.com/[].
1201
1202 After correct installation, typing at the bash command line prompt:
1203
1204 ----
1205 $ git --version
1206 ----
1207
1208 should result in something like:
1209
1210 ----
1211 git version 1.8.3.4
1212 ----
1213
1214 Your version will likely be different.
1215
1216 [[ChToolsWin32SVN]]
1217
1218 ==== Win32 native: git
1219
1220 The Git command line tools for Win32 can be found at
1221 http://git-scm.com/download/win[].
1222
1223 After correct installation, typing at the command
1224 line prompt (cmd.exe):
1225
1226 ----
1227 $ git --version
1228 ----
1229
1230 should result in something like:
1231
1232 ----
1233 git version 1.8.3.4
1234 ----
1235
1236 However, the version string may vary.
1237
1238 [[ChToolsGitGUI]]
1239
1240 === Git GUI client (optional)
1241
1242 Along with the traditional command-line client, several
1243 GUI clients are available for a number of platforms. See
1244 http://git-scm.com/downloads/guis[] for details.
1245
1246 // [[ChToolsUnixGitGUI]]
1247 // XXX Add Gui client section
1248
1249 [[ChToolsPatch]]
1250
1251 === patch (optional)
1252
1253 The patch utility is used to merge a diff file into your own source tree. This
1254 tool is only needed, if you want to apply a patch (diff file) from someone else
1255 (probably from the developer mailing list) to try out in your own private source
1256 tree.
1257
1258 It most cases you may not need the patch tool installed. Git and Gerrit should
1259 handle patches for you.
1260
1261 You will find more instructions in <<ChSrcPatchApply>>on how to use the patch
1262 tool.
1263
1264 [[ChToolsUnixPatch]]
1265
1266 ==== UNIX or Win32 Cygwin: patch
1267
1268 Patch is available for most of the UNIX-like platforms
1269 and as the patch package from the
1270 <<ChToolsCygwin,Cygwin setup>>.
1271
1272 If GNU patch isn't already installed or
1273 available as a package for your platform, you can get it at
1274 http://www.gnu.org/software/patch/patch.html[].
1275
1276 After correct installation, typing at the
1277 bash command line prompt:
1278
1279 ----
1280 $ patch --version
1281 ----
1282
1283 should result in something like:
1284
1285 ----
1286 patch 2.5.8
1287 Copyright (C) 1988 Larry Wall
1288 Copyright (C) 2002 Free Software Foundation, Inc.
1289
1290 This program comes with NO WARRANTY, to the extent permitted by law.
1291 You may redistribute copies of this program
1292 under the terms of the GNU General Public License.
1293 For more information about these matters, see the file named COPYING.
1294
1295 written by Larry Wall and Paul Eggert
1296 ----
1297
1298 However, the version string may vary.
1299
1300 [[ChToolsWin32Patch]]
1301
1302 ==== Win32 native: patch
1303
1304 A native Win32 patch package can be obtained from
1305 http://gnuwin32.sourceforge.net/[]. The
1306 installation should be straightforward.
1307
1308 [[ChToolsWget]]
1309
1310 === Win32: GNU wget (optional)
1311
1312 GNU wget is used to download files from the internet using the command line.
1313
1314 GNU wget is available for most of the UNIX-like platforms and as the wget
1315 package from the <<ChToolsCygwin,Cygwin setup>>.
1316
1317 You will only need wget, if you want to use the Win32 automated library
1318 download, see <<ChLibsSetup>>for details.
1319
1320 If GNU wget isn't already installed or available as a package for your platform
1321 (well, for Win32 it is available as a Cygwin package), you can get it at
1322 http://www.gnu.org/software/wget/wget.html[].
1323
1324 If wget is trying to download files but fails to do so, your Internet connection
1325 might use an HTTP proxy. Some Internet providers use such a proxy and it is
1326 common in many company networks today. Wireshark's setup script will try to
1327 discover your proxy settings automatically, but you may need to set the
1328 environment variable 'HTTP_PROXY' by hand before using wget. For example, if you
1329 are behind proxy.com which is listening on port 8080, you have to set it to
1330 something like:
1331
1332 ----
1333 set HTTP_PROXY=http://proxy.com:8080/
1334 ----
1335
1336 If you are unsure about the settings, you might ask your system administrator.
1337
1338 [[ChToolsUnzip]]
1339
1340 === Win32: GNU unzip (optional)
1341
1342 GNU unzip is used to, well, unzip the zip files downloaded using the wget tool.
1343
1344 GNU unzip is available for most of the UNIX-like platforms and as the unzip
1345 package from the <<ChToolsCygwin,Cygwin setup>>.
1346
1347 You will only need unzip, if you want to use the Win32 automated library
1348 download, see <<ChLibsSetup>>for details.
1349
1350 If GNU unzip isn't already installed or available as a package for your platform
1351 (well, for Win32 it is available as a Cygwin package), you can get it at
1352 http://gnuwin32.sourceforge.net/packages/unzip.htm[].
1353
1354 [[ChToolsNSIS]]
1355
1356 === Win32: NSIS (optional)
1357
1358 The NSIS (Nullsoft Scriptable Install System) is used to generate
1359 'wireshark-win32-wireshark-major-minor-version:[].x.exe' from all the files
1360 needed to be installed, including all required DLLs, plugins, and supporting
1361 files.
1362
1363 To install it, simply download the latest released version (currently 2.46)
1364 from http://nsis.sourceforge.net[] and start the downloaded installer. You will
1365 need NSIS version 2. Version 3 is not yet supported.
1366
1367 You will find more instructions in <<ChSrcNSIS>>on how to use the NSIS tool.
1368
1369 ++++++++++++++++++++++++++++++++++++++
1370 <!-- End of WSDG Chapter Tools -->
1371 ++++++++++++++++++++++++++++++++++++++
1372
1373 // vim: set syntax=asciidoc: