Compiling TTDPatch under Lubuntu

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Compiling TTDPatch under Lubuntu

Post by WWTBAM »

I think I have all the packages required. When I set up my PATH environment variable, I presume I can leave out the Cygwin path as I am on Linux? I will likely post more questions as we go.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Compiling TTDPatch under Lubuntu

Post by wallyweb »

:shock:

:mrgreen:

:bow: :bow: :bow: :bow:
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

wallyweb wrote::shock:

:mrgreen:

:bow: :bow: :bow: :bow:
Don't hold your breath, I still have a lot to learn but I do plan on tweaking (ie no brand new features for a while) TTDP once I can compile.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Compiling TTDPatch under Lubuntu

Post by wallyweb »

roboboy wrote:Don't hold your breath, I still have a lot to learn but I do plan on tweaking (ie no brand new features for a while) TTDP once I can compile.
Agreed. If I held my breath, my face would turn colours that would break both the DOS and Windows pallets. The bows were for your brave attempt. More to come if you are successful. :bow:
User avatar
orudge
Administrator
Administrator
Posts: 25129
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by orudge »

I would just give it a shot. I just tried to build TTDPatch on my Debian server, but it's running on an x86_64 system and it seems to be coming up with some errors trying to cross-compile. May need to either a) attempt to adjust the build system or b) built it on a 32-bit OS/chroot instead. :)
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

Well, I just tried and I get

Code: Select all

[CC DEP] mkptinc.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] mkpttxt.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] codepage.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] switches.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] makelang.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] windows.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] auxfiles.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] checkexe.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] loadlng.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] grep.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] error.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] ttdpatch.o.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] dos.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] auxfiles.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] checkexe.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] loadlng.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] switches.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] grep.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] error.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC DEP] ttdpatch.obj.d
gcc: error: unrecognized command line option ‘-mno-cygwin’
[CC] non-asm/cwrap.wpo
cc1: error: -MG may only be used with -M or -MM
make: *** [non-asm/cwrap.wpo] Error 1
When I type make win into the terminal in the root of my source dir. I presume that means I am missing a package or I have the wrong version of a package. I got my list of packages from http://www.tt-wiki.net/wiki/CompilingTT ... f_TTDPatch and http://projects.tt-forums.net/projects/ ... ompile.txt. Of course if wanted, I can post screenies of the package manager showing which packages are installed if needed.

My path is:

Code: Select all

/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/user/Documents/TTDPatch/TTDPatch-nightly-r2366/NASM:/user/Documents/TTDPatch/TTDPatch-nightly-r2366/BIN
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Compiling TTDPatch under Lubuntu

Post by Wold »

You may have all the need packages, but you've got the newest versions :) Read this for a start:

Code: Select all

Not yet, but it is coming.  for now, explicitly use 'gcc-3 -mno-cygwin'
or switch your default gcc to version 3.x by using
/usr/bin/set-gcc-default-3.sh
Another read. And another.
Image
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

I fear this may not be possible as if I search in my package manager for gcc-3 I only get the current release which is 4.6.3. I am gloing to go looking for a copy of gcc-3 to use. I would preferably like it pre-built which it seems I'm not going to get.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: Compiling TTDPatch under Lubuntu

Post by Wold »

Try one of the mirrors from this list - like this one. Or edit your repositories using the guide.
Image
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

I believe I am supposed to have /usr/bin/set-gcc-default-3.sh, but I can find that script anywhere even though I have installed gcc-3.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by Lakie »

Have you changed the following lines in "makefile.local", by default it assumes Cygwin not cross compiling if you haven't. Hense the '-mno-cygwin' flag being wrongly applied.

Code: Select all

WINCC := CROSS
HOST := INTEL
[Edit] You might also need to uncomment the cross-compiler prefix line, so it finds the right compiler on Lubunbu.
Though that'll only provide capcity for compiling the Windows version of the patch.

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

Lakie wrote:Have you changed the following lines in "makefile.local", by default it assumes Cygwin not cross compiling if you haven't. Hense the '-mno-cygwin' flag being wrongly applied.

Code: Select all

WINCC := CROSS
HOST := INTEL
[Edit] You might also need to uncomment the cross-compiler prefix line, so it finds the right compiler on Lubunbu.
Though that'll only provide capcity for compiling the Windows version of the patch.

~ Lakie
I just tried changing those lines. I now get the following output

Code: Select all

[HOSTCC DEP] host/mkptinc.o.d
[HOSTCC DEP] host/mkpttxt.o.d
[NASM DEP] host/texts.o.d
[HOSTCC DEP] host/codepage.o.d
[HOSTCC DEP] host/switches.o.d
[HOSTCC DEP] host/makelang.o.d
[HOSTCC DEP] host/windows.o.d
[HOSTCC DEP] host/auxfiles.o.d
[HOSTCC DEP] host/checkexe.o.d
[HOSTCC DEP] host/loadlng.o.d
[HOSTCC DEP] host/grep.o.d
[HOSTCC DEP] host/error.o.d
[HOSTCC DEP] host/ttdpatch.o.d
[CC DEP] mkptinc.o.d
[CC DEP] mkpttxt.o.d
[CC DEP] codepage.o.d
[CC DEP] switches.o.d
[CC DEP] makelang.o.d
[CC DEP] windows.o.d
[CC DEP] auxfiles.o.d
[CC DEP] checkexe.o.d
[CC DEP] loadlng.o.d
[CC DEP] grep.o.d
[CC DEP] error.o.d
[CC DEP] ttdpatch.o.d
[CC DEP] dos.obj.d
[CC DEP] auxfiles.obj.d
[CC DEP] checkexe.obj.d
[CC DEP] loadlng.obj.d
[CC DEP] switches.obj.d
[CC DEP] grep.obj.d
[CC DEP] error.obj.d
[CC DEP] ttdpatch.obj.d
[CC] non-asm/cwrap.wpo
[CC] non-asm/enhguic.wpo
[CC] non-asm/gridArray.wpo
[CC] non-asm/md5sum.wpo
[CC] non-asm/themes.wpo
[CC] reloc.o
[DLLTOOL] reloc.a
[LDEXP] ttdprotw.pe
i586-mingw32msvc-ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
patch.ld:103: undefined symbol `__recordversiondata' referenced in expression
make: *** [ttdprotw.pe] Error 1
make: *** [ttdprotw.pe] Deleting file `ttdprotw.map'
Thank you for the help so far.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
Lakie
TTDPatch Developer
TTDPatch Developer
Posts: 1799
Joined: 26 May 2004 16:37
Location: Britain
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by Lakie »

Did you run the following command after changing the makefile.local?

Code: Select all

make mrproper
If you didn't it's possible that some of the erroneous dependency / compiled files still existed, breaking the compile.

[edit] Have you also replaced the 'nasm' binary with the one from the TTDPatch nasm folder?

~ Lakie
TTDpatch Developer 2005 - 2010 ~ It all started because of shortened vehicle not loading correctly, now look where I've gone with it!
Grfs coded ~ Finnish Train Set (Teaser) | Bm73 (Release 3) | Emu 680 (Release 3)| Glass Station (Release 1) | UK Roadset (Version 1.1a) | New Water Coasts (Version 7)
Pikka: "Lakie's a good coder, but before he'll add any feature to TTDP you have to convince him that you're not going to use it to destroy the world as we know it."
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

I replaced the nasm binary with the one from my source dir/nasm and ran ¨make mrproper".

I now get the below errors:

Code: Select all

i586-mingw32msvc-ld: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
[OBJCOPY/GZIP] ttdprotw.bin
[OBJCOPY/OBJDUMP] ttdprotw.lst
[CC] ttdpatch.o
[CC] error.o
[CC] grep.o
[PERL] bitnames.h
[PERL] sw_lists.h
[CC] switches.o
switches.c: In function ‘processswitch’:
switches.c:798: warning: ‘parvalue’ may be used uninitialized in this function
switches.c:798: note: ‘parvalue’ was declared here
[CC] loadlng.o
[CP] versions/20110016.ver
[CP] versions/20110018.ver
[CP] versions/20110024.ver
[CP] versions/20110042.ver
[CP] versions/20110044.ver
[CC] checkexe.o
In file included from checkexe.c:25:
loadver.h:32: warning: dereferencing type-punned pointer will break strict-aliasing rules
loadver.h:33: warning: dereferencing type-punned pointer will break strict-aliasing rules
loadver.h:34: warning: dereferencing type-punned pointer will break strict-aliasing rules
loadver.h:35: warning: dereferencing type-punned pointer will break strict-aliasing rules
loadver.h:37: warning: dereferencing type-punned pointer will break strict-aliasing rules
checkexe.c: In function ‘loadingamestrings’:
checkexe.c:115: warning: pointer targets in passing argument 5 of ‘langinfo_readingamestrings’ differ in signedness
checkexe.c:123: warning: pointer targets in passing argument 5 of ‘langinfo_readingamestrings’ differ in signedness
[CC] auxfiles.o
[CC] windows.o
[CC] codepage.o
[WINDRES] ttdpatchw.res
[PERL] langerr.h
[HOSTCC] host/makelang.o
[HOSTCC] host/switches.o
switches.c: In function ‘getswitchline’:
switches.c:1261:3: warning: format not a string literal and no format arguments [-Wformat-security]
switches.c:1261:3: warning: format not a string literal and no format arguments [-Wformat-security]
switches.c: In function ‘showtheswitches’:
switches.c:1527:3: warning: format not a string literal and no format arguments [-Wformat-security]
switches.c:1530:3: warning: format not a string literal and no format arguments [-Wformat-security]
switches.c:1600:3: warning: format not a string literal and no format arguments [-Wformat-security]
[HOSTCC] host/codepage.o
[PERL] inc/ourtext.h
[HOSTCC] host/mkptinc.o
[HOSTLD] host/mkptinc
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [host/mkptinc] Error 1
rm ttdprotw.pe
I know some of them aren't errors but I copied from the first error down to the end.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
orudge
Administrator
Administrator
Posts: 25129
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by orudge »

You need the zlib development files available by the look of it. Whether that's a cross-compiled version or a native version you need I'm not sure, I'd guess the former.
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

orudge wrote:You need the zlib development files available by the look of it. Whether that's a cross-compiled version or a native version you need I'm not sure, I'd guess the former.
Lakie suggested similar to me. Will double check my lib packages in the morning and post screen shots of what I have.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

Woopsie. I had installed what I thought was zlib, but was a different package. So it compiled, now to get it out of my VM as VMWare's shared folder's don't seem to be working. Or I may install wine and set up TTD using it.

Well it started after getting TTD installed. I was getting extra output though that I don't normally see on Windows with a copy from the compile farm. Will post that extra output later.

Edit:
I get these two extra lines:

Code: Select all

- dplay.dll FIX DEBUG FileLocation: 1B478
- dplay.dll FIX DEBUG OriginalFirstThunk: 232D8
and I managed to get it out of my VM into windows. I presume the reason it says r0 in the title is because I downloaded the zip from http://nightlies.ttdpatch.net rather than via SVN.

Edit: when I run 'svn checkout http://projects.tt-forums.net/projects/ ... repository ./' I get:

Code: Select all

svn: E175002: Unable to connect to a repository at URL 'http://projects.tt-forums.net/projects/ttdpatch/repository'
svn: E175002: Server sent unexpected return value (405 Method Not Allowed) in response to OPTIONS request for 'http://projects.tt-forums.net/projects/ttdpatch/repository'
I was pointed to 'http://projects.tt-forums.net/projects/ ... repository' when I tried to run 'svn checkout http://svn.ttdpatch.net ./'
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
orudge
Administrator
Administrator
Posts: 25129
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by orudge »

You need to do svn checkout svn://svn.ttdpatch.net/trunk/, rather than http. Possibly I can detect the Subversion client and redirect it to svn://svn.ttdpatch.net/trunk/ though.

EDIT: Done, the command line svn client at least will show the correct URL if you try to access svn.ttdpatch.net via HTTP.
User avatar
WWTBAM
Moderator
Moderator
Posts: 3689
Joined: 02 Apr 2005 07:01
Location: Sydney NSW Antipodea
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by WWTBAM »

Woohoo. I can now build TTDP from svn and apply diffs. Thank you Lakie and orudge :bow: :bow: :bow:

Now to start meddling with the source.
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/
User avatar
orudge
Administrator
Administrator
Posts: 25129
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: Compiling TTDPatch under Lubuntu

Post by orudge »

If or when you start producing patches, I can give you commit access to the SVN repository.
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 5 guests