forked from freeciv/freeciv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
607 lines (406 loc) · 21.7 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
This document is about using old autotools based build system.
Installing with modern meson based build system is documented
in doc/INSTALL.meson.
===================
Installing Freeciv:
===================
This file describes how to compile and install Freeciv. Last time we
made sure this file is up to date was 16-Jul-06.
Last minor update was 10-Jul-24.
There may be a localized version of this file in the ./doc directory,
named INSTALL.<locale> (e.g., INSTALL.de).
This document contains sections and subsections as follows:
0. Prerequisites:
1. Prerequisites for the clients:
1a. Prerequisites for the Gtk3.22 client:
1b. Prerequisites for the Gtk4 client:
1c. Prerequisites for the SDL2 client:
1d. Prerequisites for the Qt client:
2. Generating Makefiles
2a. Generating the Makefile for git versions:
2b. Generating the Makefile for release versions:
3. Compiling Freeciv:
4. Installation:
5. Native Language Support:
6. Readline Support:
7. Reinier's Solaris Installation Notes:
8. Mac OS X and Darwin notes:
9. Windows notes:
0. Prerequisites:
=================
Freeciv has a number of prerequisites. Note, that apart from the first
prerequisite, the Freeciv configuration process is smart enough to work
out whether your system is suitable. If in doubt, just try it.
- Unix (or similar)
The Unix operating system, a work-alike such as Linux or FreeBSD,
or some OS that provides a very Unix-like personality or mode, like
EMX under OS/2 or the Cygwin toolkit under Windows.
(See https://www.cygwin.com/). Support for BSD-style TCP/IP sockets
is essential, as is a Bourne-shell compatible shell, such as GNU "bash".
(Most Unixes fit the bill...)
- An ANSI C compiler.
Freeciv is written in very portable (almost) ANSI C. Both 32- and 64-
bit machines are supported. You cannot use a "K&R C" compiler, or
a C++ compiler.
Development of Freeciv is primarily done with "gcc", the GNU
project's excellent C compiler. Releases can be compiled with gcc
or most other compilers (such as clang or the unbundled Solaris C compiler).
- A "make" program.
Freeciv developers generally use "gmake", the GNU make program.
Officially released versions of Freeciv are designed to have
makefiles which work with most make programs.
You can check if you have GNU make installed on your system by
typing:
% make -v [and if this doesn't work, try "gmake -v"]
The output should include "GNU Make" somewhere.
- libtool version 2.2 or better
- libcurl;
- For autotools based builds version 7.15.4 or better
- For meson based builds 7.56.0 or better
Libcurl takes care of https, and sometimes http, communication
with external services like the metaserver, and the modpack downloads
by the modpack installer.
https://curl.se/
- libicu
Libicu helps handling UTF-8 texts
https://icu.unicode.org/
- libsqlite3 is required unless both authentication and modpack
installer support have been disabled from the build.
https://www.sqlite.org/
The git version has additional requirements. A release version
contains the generated files.
- The programs from GNU gettext version 0.16 or better
Especial the xgettext program is required to create the *.gmo
files which aren't included in the git tree.
- GNU autoconf version 2.69 or better
Autoconf is required to create configure from configure.ac.
- GNU automake version 1.13 or better
Automake is required to create the various Makefile.in from
Makefile.am.
- Python version 3.6
Some source files are generated by python scripts.
In general, the minimum supported python version will follow
that required for the meson build's minimum meson version;
see INSTALL.meson for that.
1. Prerequisites for the clients:
=================================
The Freeciv client comes in the following forms:
* Gtk+ 3.0 widget library, version 3.22 ("Gtk+ 3.22")
* Gtk 4.0 widget library, version 4.0
* SDL2
* Qt
These forms have different prerequisites, explained separately below.
Your system will need to satisfy at least one of these sets of prerequisites.
Note that most Linux systems have separate library packages for "runtime"
library support and for development support (for compiling programs
which use those libraries). To compile Freeciv on such systems you
will need to have the appropriate "development" packages installed.
Sound support is built in by default if development files for
"SDL2" and "SDL2_mixer" libraries are found from the system.
Minimum version for SDL2 is 2.0.6.
https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz
1a. Prerequisites for the Gtk+ 3.22 client:
==========================================
- "pkgconf", or older "pkg-config"
"pkgconf" is a system for managing library compile/link flags that
works with automake and autoconf. You may obtain it at:
https://distfiles.dereferenced.org/pkgconf/pkgconf-2.0.2.tar.xz
- The "Glib" utility library.
The "Glib" utility library provides non-graphical functions used by the
"Gdk" and "Gtk+" libraries, like hash tables, single linked lists, etc.
Freeciv requires a version of "Glib" greater or equal to 2.50
If the Freeciv configure process tells you that you don't have the
Glib library installed, then it may be obtained from here:
https://download.gnome.org/sources/glib/2.78/glib-2.78.4.tar.xz
- The "Atk" accessibility library.
The "Atk" library provides a set of interfaces for accessibility.
It allows people with disabilities to utilize all the functionality
provided by Gtk+ apps. You may obtain it at:
https://download.gnome.org/sources/atk/2.38/atk-2.38.0.tar.xz
- The "Pango" text layout and rendering library.
"Pango" is library for layout and rendering of text, with an emphasis
on internationalization. You may obtain it at:
https://download.gnome.org/sources/pango/1.50/pango-1.50.14.tar.xz
- The "Gdk-Pixbuf" image loading/saving library
"Gdk-Pixbuf" used to be part of "Gtk+" itself, but is now separate
project. It may be obtained from:
https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.10.tar.xz
- The "Gtk+" widget library.
The "Gtk+" widget library was designed for the GIMP graphics program.
Since then it has gained popularity as an easy to program, free toolkit.
"Gtk+ 3.22" is the default client. If you don't specify any client with
"--enable-client" to configure, you will get "Gtk+ 3.22" client.
The "Gtk+" library comes with one companion libraries:
"Gdk":
Provides an abstraction layer over X-Windows/LinuxFB/Windows to implement
basic drawing functions, windows, clipping, etc.
Freeciv requires a version of "Gtk+" greater or equal to 3.22.0.
If the Freeciv configure process tells you that you don't have the
Gtk+ library installed, then it may be obtained from here:
https://download.gnome.org/sources/gtk+/3.24/gtk%2B-3.24.41.tar.xz
"Gtk+" depends on the "Glib", "Atk", "Gdk-Pixbuf", and "Pango" libraries.
If you are going to make these yourself, build and install them in the
following order: pkgconf, Glib, Atk, Pango, Gdk-Pixbuf, Gtk+.
1b. Prerequisites for the Gtk 4.0 client:
==========================================
- "pkgconf", or older "pkg-config"
"pkgconf" is a system for managing library compile/link flags that
works with automake and autoconf. You may obtain it at:
https://distfiles.dereferenced.org/pkgconf/pkgconf-2.0.2.tar.xz
- The "Glib" utility library.
The "Glib" utility library provides non-graphical functions used by the
"Gdk" and "Gtk" libraries, like hash tables, single linked lists, etc.
Freeciv requires a version of "Glib" greater or equal to 2.66
If the Freeciv configure process tells you that you don't have the
Glib library installed, then it may be obtained from here:
https://download.gnome.org/sources/glib/2.78/glib-2.78.4.tar.xz
- The "Atk" accessibility library.
The "Atk" library provides a set of interfaces for accessibility.
It allows people with disabilities to utilize all the functionality
provided by Gtk apps. You may obtain it at:
https://download.gnome.org/sources/atk/2.38/atk-2.38.0.tar.xz
- The "Pango" text layout and rendering library.
"Pango" is library for layout and rendering of text, with an emphasis
on internationalization. You may obtain it at:
https://download.gnome.org/sources/pango/1.50/pango-1.50.14.tar.xz
- The "Gdk-Pixbuf" image loading/saving library
You may be obtain it at:
https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-2.42.10.tar.xz
- The "Gtk" widget library.
The "Gtk" widget library was designed for the GIMP graphics program.
Since then it has gained popularity as an easy to program, free toolkit.
The "Gtk" library comes with one companion libraries:
"Gdk":
Provides an abstraction layer over X-Windows/LinuxFB/Windows to implement
basic drawing functions, windows, clipping, etc.
Freeciv requires a version of "Gtk" greater or equal to 4.0.0.
If the Freeciv configure process tells you that you don't have the
Gtk library installed, then it may be obtained from here:
https://download.gnome.org/sources/gtk/4.12/gtk-4.12.5.tar.xz
"Gtk" depends on the "Glib", "Atk", "Gdk-Pixbuf", and "Pango" libraries.
If you are going to make these yourself, build and install them in the
following order: pkgconf, Glib, Atk, Pango, Gdk-Pixbuf, Gtk.
1c. Prerequisites for the SDL2 client:
=====================================
- The "SDL2" library.
"Simple DirectMedia Layer is a cross-platform multimedia library designed
to provide low level access to audio, keyboard, mouse, joystick, 3D hardware
via OpenGL, and 2D video framebuffer." (https://www.libsdl.org/)
These features make it a good choice for portable games. You may obtain it
at:
https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.tar.gz
To compile the client using the "SDL2" library add "--enable-client=sdl2"
to the Freeciv configure script. See the section below for more
information about the configure script.
- The "SDL2_image" library.
This library loads the PNG images (with the help of libpng) and converts
them to "SDL surfaces" that can be handled by the "SDL" library. You may
obtain it at:
https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz
- The "SDL2_gfx" library.
https://www.ferzkopp.net/Software/SDL2_gfx/SDL2_gfx-1.0.4.tar.gz
- The "SDL2_ttf" library.
https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz
- The "freetype" library.
This library helps to render text for the SDL2 client, using an externally
provided TrueType font. You may obtain it at:
https://download.savannah.gnu.org/releases/freetype/freetype-2.13.2.tar.xz
1d. Prerequisites for the Qt client:
====================================
- C++ compiler.
Qt-client is written in C++, so you need appropriate compiler.
Compiler needs to support c++17 standard, or,
in case of --with-qtver=qt5 build, just c++11 standard
In Freeciv development, g++ has been the primary C++ compiler.
Also clang++ has been used.
- Qt Meta Object Compiler (moc)
Qt's Meta Object Compiler is a command usually called 'moc', or
'moc-qt6' or 'moc-qt5' depending on Qt version in some systems.
You may want install 'qtchooser' to find correct moc version for you
when you have multiple Qt versions installed in parallel.
If configure does not find (correct) moc, you can give it with
environment variable MOCCMD, e.g.,
../src/configure MOCCMD="/home/freeciv/local-qt/bin/moc" --enable-client=qt
- Qt6Core, Qt6Gui, and Qt6Widgets libraries and headers.
At least version 6.0 is required.
If one configures with Qt5 compatibility switch --with-qtver=qt5,
required libraries and headers are Qt5Core, Qt5Gui, and Qt5Widgets
and at least version 5.15 of Qt is required.
2. Generating Makefiles
=======================
This section contains two parts, one for generating makefiles from git
versions and one for generating makefiles from release versions.
2a. Generating the Makefile for git versions:
=============================================
This step is only needed for git versions.
To create the makefile just type
% ./autogen.sh
This will create the configure script and will run it. All parameters
of autogen.sh are passed to configure. Read the next section about the
parameters which can be passed to configure.
2b. Generating the Makefile for release versions:
=================================================
Before you compile Freeciv, you must generate a Makefile. This makefile
is configured to suit the features available on your machine.
This configuration is done using the GNU "configure" script.
To use "configure", "cd" to directory where you want the build
to end, and run it from the top directory containing
the Freeciv files:
% ../src/configure
This script will then attempt to determine the relevant features (and
misfeatures!!) of your system. It should print a page or two of
diagnostics about your machine, then stop gracefully.
If you'd like help on the various options supported by the configure
script, try the --help option, like this:
% ../src/configure --help
By default the configure script will choose the Gtk+ client if the
required libraries are found. If you prefer to override this default,
you can give configure the "--enable-client=sdl2" option.
If you want to change the compiler options, set the CFLAGS environment
variable in your shell before running "configure". For example:
% CFLAGS="-O -g -pipe" ../src//configure [for people using Bourne shell or bash]
or
% setenv CFLAGS "-O -g -pipe"
% ../src/configure [for people using C shell or tcsh]
If you're tracking down a "core dump", we suggest that you use
a value of "-g" for CFLAGS.
When you install Freeciv (later), the game components will be copied into
subdirectories of /usr/local by default. If you would like to use some
other installation prefix besides /usr/local, you should specify it now:
% ../src/configure --prefix=/opt/freeciv
If for some reason using "configure" gives you trouble, follow these steps:
- Read the prerequisites section carefully, to determine if your
system meets all the requirements.
- If the problem is with "gettext", please read the Native Language
Support section, below, for possible work-arounds.
- Let us know, so that we can fix it for the next release!!
Send mail to the freeciv-dev mailing list, telling us what you did,
and what the result is. It would be helpful to include the output
of the configure script, and the contents of the "config.status",
"config.cache" and "config.log" files, which are generated by the
configure script.
You can find out about the freeciv-dev mailing list on our web
site, at https://www.freeciv.org/
3. Compiling Freeciv:
=====================
If all has gone well previous to this point, then compiling Freeciv
should be as easy as typing "make" (or preferably, "gmake").
If you have problems, read the file BUGS, and follow the advice
carefully. If the problem is with "gettext", please read the Native
Language Support section, below, for possible work-arounds.
After compilation, the important results are:
- The "client/freeciv-<GUI>" and "server/freeciv-server" binaries.
- The "data/" directory, which contains the graphics and scenarios.
- The "translations/" directory, which contains the localization files.
- The "fcgui" and "fcser" scripts.
It's perfectly feasible to play Freeciv in this directory, without
installing it. If you do this, the "fcgui" and "fcser" scripts may be
useful, although they are not as necessary as they used to be.
See the README file for more information.
(However you cannot use Internationalization when playing Freeciv from
the source directory; you must install Freeciv for that.)
4. Installation:
================
Installing Freeciv involves installing the components mentioned in the
Compiling Freeciv section. These need to be copied to a directory such
as /usr/local (the default), /usr/games, /usr/games/freeciv,
/usr/local/freeciv, or some other suitable directory.
Typing "make install" should install everything correctly on your machine.
You may like to use the --prefix=DIR configure option (see the Generating
the Makefile section) to ensure the files get placed where you want.
When the Freeciv client and Freeciv server are run they both need to
find some files from the "data" directory. By default freeciv looks
in the following directories, in order, for any data files: the current
directory; the "data" subdirectory of the current directory; the
subdirectory ".freeciv" in the user's home directory; and the directory
where the files are placed by running "make install". You can override
this search patch by setting the FREECIV_DATA_PATH environment variable, to
a single directory or a list of directories separated by colons.
For example:
% setenv FREECIV_DATA_PATH "/usr/games/freeciv/data:./data"
(for users of csh, tcsh, etc.)
% FREECIV_DATA_PATH="/usr/games/freeciv/data:./data"; export FREECIV_DATA_PATH
(for users of sh, bash, ksh, zsh, etc.)
Also, note that you generally must install Freeciv if you wish to use
its Native Language Support. See the README file for more information.
5. Native Language Support:
===========================
Freeciv uses the "gettext" system for Native Language Support.
If you experience problems with gettext in either configuring or compiling
Freeciv, there are a few work-arounds you can try:
1. If you don't need Native Language Support, disable it using the
"--disable-nls" configure option:
% ../src/configure --disable-nls
% make
2. You can try to install the latest version of GNU gettext.
It may be obtained from here:
https://ftp.gnu.org/gnu/gettext/gettext-0.21.tar.xz
6. Readline Support:
====================
Freeciv has optional support for the readline library.
Readline support is what makes the server command line behave sensibly,
making it possible to
- Use the backspace key.
- Use the cursor to move back and forth on the line you have written.
- Use TAB completion of commands and command arguments. Ie, when you
push tab the server will finish the word for you if there is only one
possible choice.
- Use the up and down cursor to scroll through the history of previously
entered commands.
- etc.
The configure script will check if you have the readline library correctly
installed. If so it will automatically set up the makefiles so that readline
is compiled into the server. If not then it will just silently configure
without readline support.
You can force configure to include readline or die trying by giving
configure the --with-readline option:
% ../src/configure --with-readline
Some linux distributions (and possibly other operating systems) have
readline version 4 incorrectly installed, so that readline is not
set up to declare it's dynamic dependencies. In that case configure
will try to guess which extra libs it should link against and add them.
The configure script will give a warning if it had to add extra libs
to make readline work. This should be harmless, and is just meant as
a reminder to the folks who distribute readline. :)
7. Reinier's Solaris Installation Notes:
========================================
Solaris (2.5 and up) has its own version of X in /usr/openwin, its own
version of make in /usr/ccs/bin/make, and its own compiler (to be purchased
separately) which, if you have it, is available in /opt/SUNWspro/bin.
Solaris does not provide any of the stuff required for imlib, gdk and gtk,
either, which is required to build the GTK+ client. However, with some
patience, everything can be compiled without problems.
Make sure your environment variables, especially $PATH and $LD_LIBRARY_PATH,
and the configure options do not point to an inconsistent set of software,
and compiling will be fine.
You can set up your $PATH and configure to use only GNU
tools. Furthermore, Freeciv is known to compile with MIT X, and with
certain combinations of GNU and Sun tools. The exact recipes depend on your
local installation.
8. Mac OS X and Darwin notes:
=============================
Pkg-config files installed with icu4c homebrew package are not found
from normal path. This shows up as a configure error:
"icu development files not found. Adjusting PKG_CONFIG_PATH may help"
One needs to adjust PKG_CONFIG_PATH before configure, like this:
> export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
Mac OS has a library called libedit that provides similar functionality to
readline, but is not a suitable replacement for freeciv use of readline.
You need to provide real readline implementation (e.g. from homebrew) to
get readline functionality to the freeciv server.
Readline files from homebrew are not found from normal paths, but
you need to adjust CPPFLAGS and LDFLAGS before configure.
If you don't have CPPFLAGS or LDFLAGS defined at all beforehand, use:
> export CPPFLAGS="-I$(brew --prefix readline)/include"
> export LDFLAGS="-L$(brew --prefix readline)/lib"
If you already have either defined, include also those existing
path components, e.g. CPPFLAGS:
> export CPPFLAGS="-I$(brew --prefix readline)/include:$CPPFLAGS"
9. Windows notes:
=================
Windows version of Freeciv can be built either with Msys2 or Cygwin.
Official Windows binaries are built with Msys2, and they are self-contained
packages. For using Cygwin version, you need Cygwin environment installed.
Build instructions for Msys2 versions are documented on doc/README.msys2
Cygwin specific installation notes can be found in doc/INSTALL.Cygwin.
** END **