Recommended way for installation

Installing on windows
Post Reply
PokeMon
New member
Posts: 4
Joined: Tue Mar 04, 2014 12:00 am

Recommended way for installation

Post by PokeMon »

Hi there,
quite new to this forum but not to Zeddy related stuff in general. ;)

I tried to install and run Z88dk for the Sinclair ZX80/ZX81 under WIN.
I wonder what is a recommended way for a new user to start with z88dk ?

In the nightly build there is for example no "quick tutorial" (rtf) and there is no z88dkenv.bat.
Is the batch file no more in use ?

Cheers ! :)
Last edited by PokeMon on Tue Mar 04, 2014 12:23 am, edited 1 time in total.
Timmy
Member
Posts: 136
Joined: Sat Mar 10, 2012 4:18 pm

Post by Timmy »

Alvin wrote a good z88dk installation manual in the WoS Forum, and there were plans to put that in the wiki, but it probably never appeared.

The actual post on WoS is here. That is a document that installs z88dk and sp1 from the nightly build, but on the zx80/81 you should skip the sp1 part.

There's also documentation for installation of the latest stable version, you can find that in this link. The problem is that the stable version is a pretty old version, so some bugs are not fixed there.
PokeMon
New member
Posts: 4
Joined: Tue Mar 04, 2014 12:00 am

Post by PokeMon »

Thanks, that would help I think.
I will checkout the links.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

For windows the easiest way is to unzip the windows nightly build into C: to get a complete c:\z88dk tree that includes binaries and pre-compiled z80 libraries.

Doing this does not set up environment variables for you, which is the reason for running a batch file from a command prompt window prior to compilation. You can add a batch file "init.bat" to c:\z88dk and run it once each time you open a command prompt to set up those environment variables:

"c:\z88dk\init.bat"
set path=%path%;c:\z88dk\bin
set Z80_OZFILES=c:\z88dk\Lib\
set ZCCCFG=c:\z88dk\Lib\Config\

Note: You may want to add "c:\gnu" to the path if you install gnu unix tools in c:\gnu but this is only necessary to make the z80 libraries from scratch, something that is done for you by the nightly build.

The nightly build is a snapshot of the latest cvs repository. You can update when a change occurs by repeating the procedure, unzipping into c:\ and overwriting the c:\z88dk tree. I'd recommend making a copy of your work directory before doing this if that sits in a c:\z88dk subdirectory.

What I do is set up a work directory in c:\z88dk\work and edit my programs there. I open a command prompt window, cd to c:\z88dk, run init.bat to set up the env vars, then cd to c:\z88dk\work. To compile just run "zcc ..." there and use the up arrow to re-run the last compile command each time changes to the program are made. For a more complicated project, you might want to set up a makefile or a batch program to assemble various pieces but most of the time you don't need that.


The nightly build must be installed into c:\z88dk, the reason being there are config files that contain absolute path information in them. The config files describe for each target machine which versions of the library code to use. The latest stable build is available as a windows installer and this creates the config files with correct path information for you so that z88dk can be installed anywhere. However, as Timmy points out, the last stable build is quite old now so I wouldn't recommend using that for now. We probably should release more often to keep the installer option more current. z88dk is undergoing quite a bit of development right now, whether that be new targets in the past year, new c libs or updates to the assembler + compiler so (at least) I have preferred the nightly build method for installing recently.


I do agree that the wiki needs to be updated with better information on getting the tools running, how things work, etc. It's something on the to-do list for me, but I always planned to do that in conjunction with a new c lib option and optional sdcc c compilation, which is coming soon. I promise :) just work is getting in the way the past couple of weeks.
alvin
Well known member
Posts: 1872
Joined: Mon Jul 16, 2007 7:39 pm

Post by alvin »

Timmy wrote:That is a document that installs z88dk and sp1 from the nightly build, but on the zx80/81 you should skip the sp1 part.
sp1 is also available for the zx81 if you have a hi-res capable ram pack :)
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

That post of mine on WoS is very much out of date now. I wouldn't recommend anyone follow that.

I do have details on installing z88dk in my spectranet build environment guide, but if you only intend to use z88dk as is and have no need for mingw, msys, etc. Then it's probably not for you anyway.
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

alvin wrote:The nightly build must be installed into c:\z88dk, the reason being there are config files that contain absolute path information in them. The config files describe for each target machine which versions of the library code to use. The latest stable build is available as a windows installer and this creates the config files with correct path information for you so that z88dk can be installed anywhere. However, as Timmy points out, the last stable build is quite old now so I wouldn't recommend using that for now. We probably should release more often to keep the installer option more current. z88dk is undergoing quite a bit of development right now, whether that be new targets in the past year, new c libs or updates to the assembler + compiler so (at least) I have preferred the nightly build method for installing recently.
This is Off Topic, but that reminds me; If you remember I made the suggestion a while back of revamping the config system to move away from loads of files all with similar contents that all have to have paths rewritten. I studied the source a bit but struggled to understand really how the files are parsed :(
Would improving the config system be a potential goal for the future? I'm happy to work on it if someone can point me in the right direction a bit WRT what the current system does with the config files :)
User avatar
dom
Well known member
Posts: 1194
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Guesser wrote:This is Off Topic, but that reminds me; If you remember I made the suggestion a while back of revamping the config system to move away from loads of files all with similar contents that all have to have paths rewritten. I studied the source a bit but struggled to understand really how the files are parsed :(
Would improving the config system be a potential goal for the future? I'm happy to work on it if someone can point me in the right direction a bit WRT what the current system does with the config files :)
I've done some work in that area as a side effect of adding in the extra processing stage for sdcc, there's now defaults and the capability of doing some token replacement. It will now replace DESTDIR in cfg files with the install prefix (so effectively doing the make config/sed stage), this should be easily rebaseable with ZCCCFG/../.. so I'll sort that out soonish and then it will be location independent (with ZCCCFG defined).
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

awesome! :)
User avatar
dom
Well known member
Posts: 1194
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've just committed the last stage so that z88dk will be location independent.

It will set the root to $ZCCCFG/../../ if it exists, else default to c:/z88dk/

The .cfg files are now just a copy of the .lnx files.
stefano
Well known member
Posts: 1534
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

Great ! This means the installer is now totally useless, right ?
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

Is the only difference between the .cfg and .lnx files now the COPYCMD variable? If so would it makes sense to move that definition out of the file too (and default to "copy" if absent presumably?)
That way the cfg file becomes platform independent (...and makes it easier for me to override the value of COPYCMD to use cp ;))

Edit: ah, I see the other thing is it rewrites the slashes to work on win 9x, bah. :(
Last edited by Guesser on Fri Mar 28, 2014 3:38 pm, edited 1 time in total.
User avatar
dom
Well known member
Posts: 1194
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Guesser wrote:Is the only difference between the .cfg and .lnx files now the COPYCMD variable? If so would it makes sense to move that definition out of the file too (and default to "copy" if absent presumably?)
That way the cfg file becomes platform independent (...and makes it easier for me to override the value of COPYCMD to use cp ;))
Yup, I can do that, the default for win32 is correct in the code.
Edit: ah, I see the other thing is it rewrites the slashes to work on win 9x, bah. :(
So, have I broken win9x? I'm not sure I've got an iso to try it out on I'm afraid.
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

dom wrote:So, have I broken win9x? I'm not sure I've got an iso to try it out on I'm afraid.
As far as I can remember (it's been so long!) COMMAND.COM doesn't understand forward slashes as path separators so using C:/foo/bar would fail.
I think COMMAND.COM will always think it has encountered a commandline switch when it finds a forward slash.

In cmd.exe though the default is still the DOS backslashes it understands the unixy forward slash as a path separator for (almost?) everything.
Last edited by Guesser on Sat Apr 05, 2014 8:41 am, edited 1 time in total.
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

Just trying out the latest nightly on windows 7 [strike]and getting failed linking and some rather broken looking paths[/strike]

Edit: it doesn't actually break anything because the double slash, even the \/ is crunched down and the command completes. The error was that I was trying gfx.c and not telling the maths library to link (the readme is out of date ;))

Things like

Code: Select all

copy D:\Programs\z88dktest\lib\config\..\..\\lib\spec_crt0.opt
and

Code: Select all

copt D:\Programs\z88dktest\lib\config\..\..\/lib/z80rules.2
This is with ZCCCFG and Z80_OZFILES set both with no trailing slash, and bin added to the path.

It looks to me like the code determining the value of DESTDIR is adding a trailing slash that it doesn't need.
Last edited by Guesser on Sat Apr 05, 2014 9:22 am, edited 1 time in total.
Guesser
Member
Posts: 45
Joined: Mon Nov 21, 2011 2:00 pm

Post by Guesser »

also am I right in thinking that at this moment the value of c_copycmd can still only be changed by adding it to the cfg file?

Edit: not that it matters, copy is working fine anyway.
For some reason ages ago I was finding that I couldn't run zcc reliably from a bash shell, but clearly this was nothing to do with the fact that copy isn't available since zcc isn't trying to start it within a bash shell. It's all working fine for me here now with the latest nightly anyway. All problems are just user error on my part because it's so long since I invoked zcc manually instead of project makefiles doing everything for me :lol:
Last edited by Guesser on Sat Apr 05, 2014 9:58 am, edited 1 time in total.
Post Reply