Obtaining the software
Pre-requisites
- On Linux, you will need
- Qt for Linux, from here: http://qt.nokia.com/downloads/
- Download "Qt libraries 4.7.3 for Linux/X11 (202 MB)" (Or later version, if available)
- Download "Qt Creator 2.2.1 for Linux/X11" (Or later version, if available. Select 32 or 64 bit as appropriate)
- The lemon parser for YACC-like grammar, available through apt-get.
- The re2c lexer, available through apt-get.
- On Windows, you will need
- MSVC 2008. If you do not have the commercial version, you can use the free Express Edition.
- Qt for MSVC 2008, from here: http://qt.nokia.com/downloads/
- Download "Qt libraries 4.7.3 for Windows (VS 2008, 228 MB)" (Or later version, if available)
- On Windows, pre-built lemon.exe and re2c.exe are included with the sources.
- On all platforms, you will also need to install Doxygen if you intend to update documentation.
Downloading
- You can obtain zenlang using git with the following command:
- This will create a directory called zenlang and get the source files into it.
Setting up environment variables
- In the instructions below, ZEN_ROOT_DIR refers to the directory where zenlang was cloned into.
It is not a real environment variable and need not be set, except if building the documentation using doxygen.
- Windows
- On Windows, the %PATH% environment variable must include the path to the following executables (with typical locations in brackets):
For MSVC:
- vcbuild.exe (%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcpackages\)
- cl.exe (%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\)
- mspdb80.dll and other DLLs required by cl.exe (%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\)
For Qt:
- moc.exe (C:\Qt\4.7.3\bin\)
- Set %QTDIR% to the root of the Qt installation (for example, C:\Qt\4.7.3\)
- Linux
- On Linux, the $PATH environment variable must include the path to the following executables (with typical locations in brackets):
For Qt:
- qmake (/opt/QtSDK/Desktop/Qt/473/gcc/bin/)
- moc (/opt/QtSDK/Desktop/Qt/473/gcc/bin/)
- Finally, for all platforms, the PATH variable must also include the directory where the zenlang compiler and libraries are built
- On Windows, %PATH% should include %ZEN_ROOT_DIR%\projects\msvc\bin\
- On Linux, $PATH should include $ZEN_ROOT_DIR/projects/qtc/bin/
Building the software from source
You now need to build the project from source code.
- On Windows, launch MSVC
- Open the solution at: %ZEN_ROOT_DIR%\projects\msvc\zen.sln
- Perform a full Debug and Release builds.
- On Linux, launch QtCreator:
- Open the project at $ZEN_ROOT_DIR/projects/qtc/zbl/zbl.pro
- Open the project at $ZEN_ROOT_DIR/projects/qtc/zcc/zcc.pro
- Note: It is recommended that in QtCreator, you create a new session for these two projects.
- Set the zcc project as dependant of zbl (in Projects tab, click Dependencies)
- Perform a full debug and release build.
- At this stage, the base library and the compiler is ready. Now we build the extended library using the zenlang compiler.
- Open the command prompt and go to the directory where the zcc compiler is placed
- On Windows, this would be %ZEN_ROOT_DIR%\projects\msvc\bin\
- On Linux, this would be $ZEN_ROOT_DIR/projects/qtc/bin/
- To build the zen extended library, enter the following command (for any platform):
zcc make --config rel ../../../sources/zxl/zxl.zen
- To build and run the test suite (optional), enter the following command:
zcc make --config rel ../../../tests/test.zen
- Verify that the above commands have executed successfully.
The software is now ready to use