Wikia

Freeciv

It:Install-Windows

703pages on
this wiki
Talk0
This page contains outdated information and needs to be updated. Refer to the English language page.

Il modo più veloce e facile per installare Freeciv è quello di scaricare il pacchetto Windows installer. Questo vi assicura di avere un gioco funzionante e la minima difficoltà ad iniziare.

Se invece siete interessati a testare la prossima versione di Freeciv e siete abituati a lavorare con problematiche tecniche, probabilmente volete considerare l'idea di installare la versione di sviluppo (Nota del traduttore: in questo caso conoscete bene l'Inglese, per cui non avrete problemi a leggere di seguito :D )

Windows InstallerEdit

The latest official version of Freeciv can be found on the Freeciv home page or on SourceForge:

To play on old (1.14.x) servers, you can still download the last version of the 1.0-series client:

  • freeciv-1.14.2-win32.zip (for Windows 95 and later)
  • Install the game by unzipping the files into a suitable directory, such as C:\Program Files\Freeciv

Please notice that some virus checkers incorrectly tell you a "Trojan" is included with the Freeciv distribution.

Other LanguagesEdit

If you installed a recent version of Freeciv (2.0 or later), you can run the game in a different language than your default system language.

Create a batch file (for example, named freeciv.bat) in the same directory as where you installed the package. It only needs to contain these two lines:

set LANG=EN
civclient.exe

Substitute "EN" with the two-letter code for your desired language, and run this batch file instead of civclient.exe. If you use the shortcuts created by the Windows installer, don't forget to change the "target" field of each shortcut to point to this batch file instead of to civclient.exe.

Compile From SourceEdit

If you choose to compile Freeciv from source, you likely fit one or more descriptions:

  • You want to play and test the latest version of the game
  • You want to contribute to Freeciv development
  • You're curious
  • You like to run with scissors

When compiling Freeciv from source, remember this Free Software/Open Source axiom: "If it breaks, you get to keep both pieces." The humor needed to understand that saying will serve you well if you encounter difficulties.

Tip: While we have taken care to explain the process as clearly as possible, you may still run into problems when compiling Freeciv from source. Use IRC to join #freeciv-dev on irc.freenode.org to talk to someone if you run into problems.

Install the Development EnvironmentEdit

If your goal is simply to play the latest version of Freeciv, compiling from source is typically a one-time operation. However, the extra work necessary to configure the development environment will reward you with the very latest version of Freeciv - along with all the newest features and potential bugs which that implies.

MinGW, Cygwin, MSYS, and their supporting files are rather large. Patience and/or a fast connection is required.

The Compiler and Libraries (MinGW)Edit

MinGW (Minimal GNU for Windows) hosts the basic tools necessary to compile Freeciv from source: an ANSI C compiler and the code libraries that Freeciv depends on.

If you're interested in learning more about MinGW in more detail, the MinGW Getting Started page is an excellent source. Otherwise, simply following the instructions below should result in the environment you need to compile Freeciv from source.

Freeciv can use one of two clients under Windows: the Windows native (GDI) client, and the GTK client. The GTK client is more actively developed, and as a result often has more advanced features than the Windows native client.

1
For Either ClientEdit
  1. Install the latest MinGW (currently MinGW-5.0.0.exe). This is where you will install the packages that Freeciv needs to compile, referred to as the "MinGW root directory".
    • On the "Choose Package" step, select "Current"
    • On the "Choose Components" step, check only the box next to "MinGW base tools"
      Tip: You will make things much easier on yourself if you avoid spaces in the directory names that you choose for MinGW and other tools. We recommend accepting the MinGW installer's default directory name (C:\MinGW), or using a similar convention (C:\gnuwin32, C:\Devel\MinGW).
  2. Download the following packages from the GNU Win32 porting project:
  3. Copy the directories and files (of both zlib and libpng) from their installed location into the MinGW root directory.
    Tip: You can install these packages (and the others mentioned in this how-to) in any order.
  4. Download following packages from the GTK+ for Windows porting project:
  5. Unzip the files, and move the extracted directories and files to the MinGW root directory.
2
For the GTK ClientEdit

Installing the packages listed above will permit you to compile the Windows native (GDI) client. If you're using Windows NT or later, you probably want to compile the GTK client as well. The GTK client is under more active development, and sometimes contains features not present in the Windows native client.

  1. Download the following packages:
  2. Unzip each file, and move the extracted directories and files to the MinGW root directory.

The Shell and Supporting ToolsEdit

We strongly recommend installing the Cygwin environment. It offers the option to install a wide array of tools including Subversion, which is used to check out the Freeciv source. You will probably find it much simpler to do regular checkouts and compiles in the same environment, rather than using a combination of Windows programs and command-line tools.

Developers will most likely be interested to find that the Cygwin installer is actually a package manager. This enables you to install familiar tools like Subversion, Emacs, or even the X Window System - all with automatic dependency resolution.

Even if you are not a developer,

If you want to keep pace with Freeciv development or modify the code, then you would most likely be interested in the additional tools in the Cygwin environment.

Tip: You really only need to install one of either Cygwin or MYS, not both. Installing both won't do any harm, but you'll spend more time downloading and installing than necessary.

3 (a)
CygwinEdit

Cygwin is a Linux-like environment for Windows. These instructions focus on installing only the "extras" necessary to integrate with MinGW and compile Freeciv source. For more information on the wide range of command-line and graphical tools that Cygwin offers, refer to the Cygwin FAQ and Cygwin package list.

  1. Download the Cygwin net installer and launch it to start installation.
    Tip: It's best if you place Cygwin in the same parent directory as where you installed MinGW. For MinGW in C:\MinGW, install Cygwin to C:\cygwin. If you installed MinGW into a subdirectory (for example, C:\Devel\MinGW), use the same subdirectory for Cygwin (C:\Devel\cygwin).
    • On the "Select Packages" step, select the following packages:
      • automake1.9 (in the "Devel" section)
      • gettext-devel (in the "Devel" section)
      • make (in the "Devel" section)
      • subversion (in the "Devel" section)
      • Optional: rxvt (in the "Shells" section)
        Tip: You will have a much better experience with Cygwin using rxvt as your shell than if you keep the Cygwin default.
      • Optional: vim or emacs (in the "Editors" section)
    • Note that other packages (such as autoconf) will be automatically selected to satisfy dependencies
  2. With WordPad (in the Windows Start menu, under Accessories), edit the file profile in the etc directory, contained in the Cygwin root directory.
    • Go to the line starting with PATH=.
    • Insert the full path to your MinGW bin directory at the start of the existing Cygwin path. Use the following example as a guide. (Note the way "/" and ":" are used, and how Windows drive letter x: is replaced with /cygdrive/x.)
    • Example: For MinGW in C:\MinGW, the edited PATH= line should look something like:
PATH=/cygdrive/c/MinGW/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:$PATH
  1. If you installed rxvt, go to the Cygwin root directory. Edit the file called cygwin.bat. Replace its contents with the following lines:
    @echo off
    cd /d c:\Devel\cygwin\bin
    rxvt -tn xterm -rv -sr -sl 2500 -e /bin/bash --login -i
    
    • To understand what the above rxvt options do - as well as to find other useful options - refer to the rxvt man page (man rxvt).
3 (b)
MSYSEdit

MSYS (Minimal SYStem) is designed to be a minimal environment for MinGW, adding a command-line shell and some automatic configuration developer tools that the autogen.sh script uses.

Note: If you choose to use MSYS instead of Cygwin, you will also need to install a separate Subversion client such as TortoiseSVN.

  1. Install the latest MSYS (currently MSYS-1.0.11-2004.04.30-1.exe). This provides an interactive shell.
    Tip: It's best if you place MSYS in the same parent directory as where you installed MinGW. For MinGW in C:\MinGW, install MSYS to C:\msys. If you installed MinGW into a subdirectory (for example, C:\Devel\MinGW), use the same subdirectory for MSYS (C:\Devel\msys).
    • When asked by the MSYS installer if you would like to normalize your MinGW installation, reply "yes". This will integrate MinGW with the MSYS environment. (For details see the section "Working with MinGW" in README.rtf, installed by MSYS in its doc directory.)
  2. Install the latest MSYS Developer Tool Kit (currently msysDTK-1.0.1.exe). These are the basic compiler support packages that you will need for Freeciv development.
    • Install msysDTK in exactly the same directory as where you installed MSYS. For example, C:\msys or C:\Devel\msys.

Download the SourceEdit

4 (a)

Stable VersionEdit

To compile the stable version of Freeciv, download the source tarball (currently freeciv-2.0.7.zip). The latest official version of the source can be found on the Freeciv home page or on SourceForge.

Unzip this file within your home directory in your development environment. Your home directory is contained in home, which is in turn within the Cygwin or MSYS root.

Tip: If you installed Cygwin, downloading a stable version of Freeciv is no different than checking out the development version. See the next step for the best way to download the source under Cygwin.

Development VersionEdit

These instructions focus on checking out a version of the Freeciv source. Refer to How to Contribute for general developer information, including more things you can do with Subversion.

4 (b)
Using CygwinEdit

Launch the shell by either double-clicking the Cygwin icon on the desktop or selecting it from the Windows Start menu.

To check out the latest Freeciv source, type:

svn co svn://svn.gna.org/svn/freeciv/trunk freeciv

To check out an older stable version of the Freeciv source (for example, Freeciv 2.1), type:

svn co svn://svn.gna.org/svn/freeciv/branches/S2_1/ freeciv-2.1
4 (c)
If You Installed MSYSEdit

Install TortoiseSVN. Once installed, configure TortoiseSVN to use Unix line endings.

Be sure to check out the source to a directory contained within your home directory in your development environment. Your home directory is contained in home, which is in turn within the Cygwin or MSYS root.

To check out the latest Freeciv source, use this address:

svn://svn.gna.org/svn/freeciv/trunk

To check out an older stable version of the Freeciv source (for example, Freeciv 2.1), use this address:

svn://svn.gna.org/svn/freeciv/branches/S2_1/

Configure the BuildEdit

If you haven't already, launch the shell by either double-clicking the appropriate icon on the desktop or selecting it from the Windows Start menu.

Change the directory to the one containing the Freeciv source (where you unzipped or checked out the source in Download the Source).

5 (a)

Using CygwinEdit

To configure the build for the native Windows client, type:

./autogen.sh --enable-client=win32 --with-libiconv-prefix=/usr --host=mingw32 CPPFLAGS=-mno-cygwin

To configure the build for the GTK client, type:

./autogen.sh --enable-client=gtk-2.0 --with-libiconv-prefix=/usr --host=mingw32 CPPFLAGS=-mno-cygwin
5 (b)

Using MSYSEdit

To configure the build for the native Windows client, type:

./autogen.sh --enable-client=win32 --with-libiconv-prefix=/usr

To configure the build for the GTK client, type:

./autogen.sh --enable-client=gtk-2.0 --with-libiconv-prefix=/usr
6

The configure process will start, printing out something like the following:

+ checking for autoconf >= 2.55 ... found 2.59, ok.
+ checking for automake >= 1.6 ... found 1.9.6, ok.
+ checking for xgettext >= 0.10.36 ... found 0.14.5, ok.
+ checking for msgfmt >= 0.10.36 ... found 0.14.5, ok.
+ creating acinclude.m4
+ running aclocal ...
+ running autoheader ...
+ running autoconf ...

...

This will be followed by a long series of checks for various header files and functions:

...

checking whether we are using the GNU C++ compiler... no
checking whether CC accepts -g... no
checking dependency style of CC... none
checking whether ln -s works... yes
checking for mingw32-ranlib... no
checking for ranlib... ranlib
checking for mingw32-ar... no
checking for ar... ar
checking for uname... uname
checking for iconv... yes

...

If the build configuration terminates normally, you should see something like the following:

...

config.status: creating civ
config.status: creating ser
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
config.status: executing fc_default-1 commands
extending po/Makefile
config.status: executing fc_default-2 commands
silencing po/Makefile
config.status: executing fc_default-4 commands
modifying po/Makefile add-comments/escape
config.status: executing fc_default-5 commands
config.status: executing default commands
7

Compile the CodeEdit

If the build configuration terminated normally, you can now type make and sit back while the code compiles.

Tip: If the compiling fails, especially if you encounter an error when make comes to the intl directory, see the section below titled If Things Go Wrong With Compiling.

8

Install the FilesEdit

Type make install and/or copy over DLLs as needed.

TODO: This section needs documentation love.

If Things Go Wrong With CompilingEdit

Not everything in life goes quite as well as we'd like, and compiling the Freeciv code is one of them.

or go back to Configure the Build and try adding --disable-nls to the autogen.sh arguments. Continue on to the following steps.
  • If you encounter an error when configure comes to checking the presence of gtk.h (see config.log), try
pkg-config --cflags gtk+-2.0

It should print out something like

-mms-bitfields -Ic:/mingw/include/gtk-2.0 -Ic:/mingw/lib/gtk-2.0/include -Ic:/mingw/include/atk-1.0 -Ic:/mingw/include/cairo -Ic:/mingw/include/pango-1.0 -Ic:/devel/target/stable/include/cairo -Ic:/mingw/include/glib-2.0 -Ic:/mingw/lib/glib-2.0/include

If it does not, try fixing your PKG_CONFIG_PATH env variable like this

export PKG_CONFIG_PATH=/c/mingw/lib/pkgconfig

Also, you might want to change those .pc files in /c/mingw/lib/pkgconfig to reflect your path-prefix

prefix=/c/MinGW
  • This error when configure comes to checking the presence of zlib is due to an older version of zlib somewhere in your PATH (e.g. I had 1 with the Ruby distribution):
checking for gzgets in -lz... no
configure: error: Could not find zlib library
  • If, during config, you get the following error:
 checking for C compiler default output file name... configure: error: C compiler cannot 
 create executables
 See `config.log' for more details.
 configure failed

try to run autogen.sh qithout the CPPFLAGS, like this

 ./autogen.sh --enable-client=gtk-2.0 --with-libiconv-prefix=/usr --host=mingw32

Running the Compiled VersionEdit

You might have noticed that the civclient program will not run from the directory you compiled in because it is not finding the data directory. I managed to run ./client/civclient, but not ./civ which is supposed to work.

Usually GNU/Unix programs can be installed by typing make install Which will install them such that they can be started from a MinGW shell, probably in $MINGW/ local/bin directory.

TODO: This section needs documentation love.

For me, this didn't work either because the shared libraries/DLLs where not found. You can either fix this by placing the DLLs in the appropriate windows/system folder by hand, or by packaging them with Freeciv in some folder where you installed to. In this case, a working Freeciv install that can be started by typing

./civclient

The freeciv directory in the MinGW shell looks like this (this isn't perfect, but I hope it helps):

freeciv-2.0.1/:
total 6800
-rw-r--r--    1 mcfred unknown      2217 May 13 00:39 CIVCLIENT.RPT
-rwxr-xr-x    1 mcfred unknown   5769464 May 11 22:11 civclient.exe
-rwxr-xr-x    1 mcfred unknown   1203712 May 11 23:02 civmanual.exe
-rwxr-xr-x    1 mcfred unknown   5751863 May 11 22:11 civserver.exe
drwxr-xr-x   14 mcfred unknown         0 May 11 23:05 data
-rwxr-xr-x    1 mcfred unknown    916849 Jan 31  2003 libiconv-2.dll
-rwxr-xr-x    1 mcfred unknown    203264 Dec  4 01:09 libpng13.dll
drwxr-xr-x    3 mcfred unknown         0 May 11 23:06 share
-rwxr-xr-x    1 mcfred unknown     74752 Jan  2 13:31 zlib1.dll
freeciv-2.0.1/data:
total 40
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 civ1
-rw-r--r--    1 mcfred unknown       249 May 11 22:10 civ1.serv
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 civ2
-rw-r--r--    1 mcfred unknown       218 May 11 22:10 civ2.serv
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 default
drwxr-xr-x    2 mcfred unknown         0 May 11 22:07 flags
-rw-r--r--    1 mcfred unknown     64491 May 11 22:10 helpdata.txt
drwxr-xr-x    2 mcfred unknown         0 May 11 22:10 history
-rw-r--r--    1 mcfred unknown       116 May 11 22:10 history.serv
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 isophex
-rw-r--r--    1 mcfred unknown      3126 May 11 22:10 isophex.tilespec
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 isotrident
-rw-r--r--    1 mcfred unknown      2851 May 11 22:10 isotrident.tilespec
drwxr-xr-x    2 mcfred unknown         0 May 11 22:07 misc
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 nation
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 scenario
drwxr-xr-x    2 mcfred unknown         0 May 11 22:09 trident
-rw-r--r--    1 mcfred unknown      2993 May 11 22:10 trident.tilespec
-rw-r--r--    1 mcfred unknown      3019 May 11 22:10 trident_shields.tilespec
freeciv-2.0.1/data/civ1:
total 66
freeciv-2.0.1/data/civ2:
total 73
freeciv-2.0.1/data/default:
total 87
freeciv-2.0.1/data/flags:
total 100
freeciv-2.0.1/data/history:
total 76
freeciv-2.0.1/data/isophex:
total 57
freeciv-2.0.1/data/isotrident:
total 53
freeciv-2.0.1/data/misc:
total 63
freeciv-2.0.1/data/nation:
total 92
freeciv-2.0.1/data/scenario:
total 84
freeciv-2.0.1/data/trident:
total 46
freeciv-2.0.1/share:
total 0
freeciv-2.0.1/share/locale:
total 2
drwxr-xr-x    3 mcfred unknown         0 May 11 23:08 en_GB
-rw-r--r--    1 mcfred unknown      2641 May 11 22:10 locale.alias

Package FreecivEdit

TODO: This section needs to be written.

TODOEdit

  • Rewrite "Running the Compiled Version"
  • Write "Package Freeciv"

Around Wikia's network

Random Wiki