Compiling on Linux

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Eddi
Tycoon
Tycoon
Posts: 8276
Joined: 17 Jan 2007 00:14

Re: Compiling on Linux

Post by Eddi »

well, you can copy the checkout, but you have to copy all of it, including the hidden folders (.svn)
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Compiling on Linux

Post by Ammler »

or use a DVCS like git or mercurial, openttd already offers converts for those...

and use make bundle and BUNDLE_DIR to create different binary sets with same source.
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Compiling on Linux

Post by ST2 »

happened to me too and this was how i solved it: (it's not the solution, more a "work around")

Code: Select all

--- src/rev.cpp.in	(revision 22295)
+++ src/rev.cpp.in	(working copy)
@@ -27,7 +27,7 @@
  * norev000 is for non-releases that are made on systems without
  * subversion or sources that are not a checkout of subversion.
  */
-const char _openttd_revision[] = "!!VERSION!!";
+const char _openttd_revision[] = "1.1.0";
and when compiling:

Code: Select all

$ ./configure --revision=r22282
$ make
hope you already made it, but this way worked for me and no more desyncs :D
___
happy games :)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Compiling on Linux

Post by planetmaker »

Oh dear.

please don't come and complain when the game desyncs or alike. Faking a version like this usually is not a good idea at all.

Use a checkout from our svn repository and there's no need for any acrobatics. And if it then compiles as 1.1.0 you can be reasonably sure that it should behave as such.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Compiling on Linux

Post by Alberth »

BenTrein wrote:I need to compile two different versions - one for a non mod noob friend of mine (noob in Linux that is), and one for myself using the moderator gui. The one for the friend of mine has also a patch (colouring the city names based on the rating). So - being behind not such a fast internet connection - thought I'd save time by copy/pasting the checkout into a new folder, and compiling it there.
Why did you do that?
You got a checked-out copy, so you can revert changes locally by means of 'svn revert'.
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Compiling on Linux

Post by ST2 »

well, usually this is the method i use:
(this is a clean try out)

Code: Select all

$ svn checkout svn://svn.openttd.org/tags/1.1.0
...
[...bla...bla...getting files...]
...
A    1.1.0\readme.txt
 U   1.1.0
Checked out revision 22298.

Warp@Warp-PC ~/_ottd
$ cd 1.1.0

Warp@Warp-PC ~/_ottd/1.1.0
$ ./configure
checking awk... awk
detecting OS... MINGW
checking build system type... mingw32
checking host system type... mingw32
checking universal build... no
checking build cc... gcc
checking host cc... gcc
checking build c++... g++
checking host c++... g++
checking host windres... windres
checking host strip... strip
checking builtin depend... yes
checking makedepend... disabled
detecting cpu-type... 32 bits
checking static... yes
checking unicode... yes
using debug level... no
using desync debug level... no
using link time optimization... no
checking OSX sysroot... not OSX, skipping
checking Allegro... not found
checking SDL... found
checking COCOA... not OSX, skipping
checking GDI video driver... found
checking dedicated... not selected
checking console application... disabled (only used when forced)
checking network... found
checking ai... found
checking translator... no
checking assert... disabled
checking zlib... found
checking liblzma... found
checking lzo2... found
checking libpng... found
checking libfreetype... found
checking libfontconfig... WIN32, skipping
checking libicu... not found
checking psp-config... not PSP, skipping
checking libtimidity... not found
checking direct-music... not found
checking sort... sort
checking endianess... AUTO
suppress language errors... no
checking stripping... strip -s
checking distcc... no (only used when forced)
checking ccache... no (only used when forced)
checking OSX application bundle... not OSX, skipping
checking revision... no detection
WARNING: there is no means to determine the version.
WARNING: please use a subversion, mercurial, or git checkout of OpenTTD.
WARNING: you can only join game servers that have been compiled without
WARNING:   version detection.
WARNING: there is a great chance you desync.
WARNING: USE WITH CAUTION!
checking iconv... not OSX, skipping
...
[...bla...bla...]
...
Generating Makefile...
Generating lang/Makefile...
Generating grf/Makefile...
Generating objs/Makefile...

Warp@Warp-PC ~/_ottd/1.1.0
$ which svn
/usr/local/bin/svn.exe

Warp@Warp-PC ~/_ottd/1.1.0
$
Whenever used in this way and it worked (as Bentrein said too but i'm on W7) but as a "Wiki's dependent" to use MinGW maybe i'm doing something wrong and would be grateful for some enlightenment.
As i said, "it's not the solution", only the way i made things work (and i google'd a lot :D)
Don't worry, I'm not (and will not) complain for desync probs with a "over the knee solution"! (never happened desyncs)
Thank you in advance
:)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Compiling on Linux

Post by Alberth »

I do the exact same sequence at a 'real' Linux system, and it works for me.

I can think of two possible causes:
- The svn directories (called '.svn') are not created.
- Version detection is broken due to some utility not being available or so.

To start with the former, what happens when you do

Code: Select all

$ cd 1.1.0
$ ls -a
.                         config.lib  findversion.sh   Makefile.bundle.in  objs
..                        config.log  .gitignore       Makefile.grf.in     os
bin                       config.pwd  .hgignore        Makefile.in         projects
changelog.txt             configure   known-bugs.txt   Makefile.lang.in    readme.txt
config.cache              COPYING     Makefile         Makefile.msvc       source.list
config.cache.pwd          docs        Makefile.am      Makefile.src.in     src
config.cache.source.list  Doxyfile    Makefile.bundle  media               .svn
Notice the last entry '.svn' at the last column.

The revision is detected with the 'findversion.sh' script in that directory; what happens when you do

Code: Select all

$ ./findversion.sh
1.1.0	22282	0	1.1.0
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Compiling on Linux

Post by ST2 »

This is what appears to me:

Code: Select all

Warp@Warp-PC ~/_ottd/1.1.0
$ ls -a
.           Doxyfile            Makefile.src.in  findversion.sh  source.list
..          Makefile.bundle.in  bin              known-bugs.txt  src
.gitignore  Makefile.grf.in     changelog.txt    media
.hgignore   Makefile.in         config.lib       os
.svn        Makefile.lang.in    configure        projects
COPYING     Makefile.msvc       docs             readme.txt

Warp@Warp-PC ~/_ottd/1.1.0
$ ./findversion.sh
svn: Write error: Bad file descriptor
svn: Write error: Bad file descriptor
svn: Write error: Bad file descriptor
svn: Write error: Bad file descriptor
r               0       r
Yep, something wrong with "findversion.sh", not the file but maybe some utility missing.
I'll put my eyes in some reading to figure out... or trying! (just in case, if you have some ideias... :D)
Thank you :bow:
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Compiling on Linux

Post by Alberth »

Lines 79-81 do the actual work, they run 'svn info', and do processing of that output by 'awk'.
Line 81 looks the simplest, could you try to get useful output from that line (the command being run is between both ` characters:

Code: Select all

LC_ALL=C svn info | awk '/^Last Changed Rev:/ { print $4 }'
I changed '"$AWK"' by just 'awk'. It grabs the number from the 'svn info' line "Last Changed Rev: 22282"
ST2
Engineer
Engineer
Posts: 63
Joined: 07 Apr 2011 14:17

Re: Compiling on Linux

Post by ST2 »

Success!!

Code: Select all

Warp@Warp-PC ~/_ottd/1.1.0
$ ./findversion.sh
1.1.0   22282   0       1.1.0
Installed SVN v1.6.16 strictly following the Wiki and... done!
Since i'm in Windows 7 I noticed too that the firewall (Comodo) was blocking some svn connections (strange). Don't know if can happen in Linux too, sorry. :oops:
My apologies for the basic questions and doubts...
Thanks to all. Alberth, thank you very much :)

Edit:
all worked well but this lines still needed to who apply some patches (maybe nothing new - or another mistake from me - but i talk from my lack of experience :) )

Code: Select all

--- src/rev.cpp.in   (revision 22298)
+++ src/rev.cpp.in   (working copy)
@@ -27,7 +27,7 @@
  * norev000 is for non-releases that are made on systems without
  * subversion or sources that are not a checkout of subversion.
  */
-const char _openttd_revision[] = "!!VERSION!!";
+const char _openttd_revision[] = "1.1.0";
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 1 guest