To build a version of the ooRexx interpreter from the SVN repository doesn't need any special permission—anyone can do that.
Based on information in a mail from Rick and the build readme in trunk I've put together various How To's from my own experience how to build ooRexx.
Check out a copy of the latest ooRexx interpreter source code from the SVN repository. Here we're using https://
to check out—you can also check out with http://
or svn://
but in this case no changes can be checked-in back into the repository (this only matters if you've got commit privileges)
md oorexxSVN cd oorexxSVN svn co https://svn.code.sf.net/p/oorexx/code-0/main/trunk main/trunk
Create a build directory (outside of your SVN workspace), where you'll keep various builds (note that you can build for 32-bit or 64-bit, and build a debug, a release, or a release-with-debuginfo version).
md oorexxBuild cd oorexxBuild md debug64
Open a new command prompt. Don't use an existing command prompt, or re-use one that has already been used for a different build.
To set up Visual Studio for the required architecture (32- or 64-bit), run the commands
cd debug64 "\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
When building for 32-bit, use x86
instead of amd64
.
Depending on the Visual Studio version and where it was installed to, the path to vcvarsall.bat
may vary.
Running CMake
is generally only needed once, but can be repeated if changes to the CMake setup become necessary.
cmake -G "NMake Makefiles" ..\..\oorexxSVN\main\trunk
When building a release version, add -DCMAKE_BUILD_TYPE=RELEASE
; when building a release version with debug information, add -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
. The default is -DCMAKE_BUILD_TYPE=DEBUG
.
nmake
nmake
by default will do an incremental build, which is much quicker than a full build. If you want to do a full build, run nmake clean
and then nmake
.
if nmake
successfully finishes, it will have created a bin/
subdirectory, which includes all binaries and other supporting files to run ooRexx. If you intend to only test the built version, it may be sufficient to just change into the bin/
subdirectory and run rexx.exe
from there, or e. g. set up an alias with doskey rexx5d=ooRexxBuild\debug64\bin\rexx.exe $*
so you can run the ooRexx version just built with rexx5d
filename.rex.
Additional steps (including changes to the CMake setup) are necessary if a Windows installer file should be built. See Create Windows installer file for ooRexx below.
Microsoft's nmake
doesn't support multi-core builds. To enable faster parallel multi-core builds, download jom
from https://download.qt.io/official_releases/jom , extract jom.exe
, put it into your path (or copy it to the Visual Studio directories where nmake.exe
is located) and change your CMake command to use cmake -G "NMake Makefiles JOM" ...
.
Then run the build with the jom
command instead of nmake
.
%svn%/test/trunk
requires explanationTo package a build into a Windows installer file, the following pre-requisites are needed:
PATH
DOC_SOURCE_DIR
must point to a directory (e. g. oorexxDocs
) containing all of the following PDF files (or identically-named stubs): oodguide.pdf
, oodialog.pdf
, ooRexxTry.pdf
, readme.pdf
, rexxextensions.pdf
, rexxgtk.pdf
, rexxpg.pdf
, rexxref.pdf
, rxftp.pdf
, rxmath.pdf
, rxsock.pdf
, and winextensions.pdf
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RELEASE -DDOC_SOURCE_DIR=..\..\oorexxDocs -DOS_DIST=windows ..\..\oorexxSVN\main\trunk nmake nmake nsis_template_installer
To automate and simplify many of the above tasks, I'm using the following Windows batch file setbuild.bat
.
To use it, some setup is necessary:
Create a batch file cdbuild.bat
(and place it in a directory within the PATH
) which changes into your build directory. E. g.
@cd c:\oorexxBuild
Create a batch file setsvn.bat
(and place it in a directory within the PATH
) which sets the environment variable SVN
to the root of your SVN repository.
@set svn=c:\oorexxSVN
Check the hard-coded paths and correct/remove them depending on your own installation:
%SVN%\test\trunk
\oorexxDocs
"\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
%USERPROFILE%\Downloads\Xalan
%USERPROFILE%\Downloads\Nsis_longStrings
Running setbuild.bat
[build-type] will change to the specified directory (or default to debug64
), run vcvarsall.bat
with the correct architecture, set PATH
, and print appropriate CMake
and nmake
commands to copy/paste if needed.
@echo off :-- switch to build directory set build_dir=%1 if %build_dir%.==. set build_dir=release64 call cdbuild if not exist %build_dir% echo build dir %build_dir% doesn't exist & goto :exit cd %build_dir% :-- get SVN path call setsvn set test=%SVN%\test\trunk mode con lines=300 :-- set build architecture to 64-bit if build directory ends in "..64", set to 32-bit else set build_arch=x86 :-- don't know why "x86_amd64" doesn't work if %build_dir:~-2%==64 set build_arch=amd64 :-- set build type to RELWITHDEBINFO if build directory starts with "relw.." :-- set build type to RELEASE if build directory starts with "re.." :-- else let build type default to DEBUG :-- DOC_SOURCE_DIR is only required, if an NSIS package build is done set build_opts=-G "nmake Makefiles" -DDOC_SOURCE_DIR=\temp\docs if %build_dir:~0,4%==relw ( set build_opts=%build_opts% -DCMAKE_BUILD_TYPE=RELWITHDEBINFO ) else ( if %build_dir:~0,2%==re set build_opts=%build_opts% -DCMAKE_BUILD_TYPE=RELEASE ) echo call vcvarsall.bat %build_arch% call "\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %build_arch% echo cmake %build_opts% ^%%svn^%%\main\trunk echo nmake clean echo nmake echo nmake nsis_template_installer :-- we have to add Xalan, which needs to run each time "rexxmsg.xml" is changed :-- we have to add (long string) NSIS to enable package builds run with "nmake nsis_template_installer" set path=%cd%\bin;%PATH%;%test%;%test%\framework;%USERPROFILE%\Downloads\Xalan;%USERPROFILE%\Downloads\Nsis_longStrings :exit
Building ooRexx requires an SVN client, cmake, gcc, and ncurses header files.
sudo apt install subversion sudo apt install cmake sudo apt install g++ sudo apt install libncurses5-dev
First, create a directory for the ooRexx source code, and check-out a fresh workspace from SVN
mkdir oorexxsvn
cd oorexxsvn
svn co svn://svn.code.sf.net/p/oorexx/code-0/main/trunk main/trunk
Later, you'll just need to update your existing workspace to the latest revision
cd main/trunk
svn update
Create a build directory (outside of your SVN workspace), where you'll keep various builds (you may want to e. g. build a debug and a release version). Here, we create the directory for a release version.
mkdir oorexxbuild
cd oorexxbuild
mkdir release
Running CMake
is generally only needed once, but can be repeated if changes to the CMake setup become necessary.
When building a release version, use -DCMAKE_BUILD_TYPE=RELEASE
, when building a release version with debug information, use -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
. The default is -DCMAKE_BUILD_TYPE=DEBUG
for a debug version.
cd release cmake -DBUILD_DEB=1 -DOS_DIST=ubuntu1604 -DCMAKE_BUILD_TYPE=RELEASE ../../oorexxsvn/main/trunk
The default ooRexx install location on Linux is /usr/bin
. To set up your build to use a different install location, set CMAKE_INSTALL_PREFIX
to the desired path by adding e. g. -DCMAKE_INSTALL_PREFIX=~/oorexx
to above cmake
command.
Run the build
make
To install the version you just built
sudo make install
Optionally, you can create a package (.deb
) file
cpack ./
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt install g++-6
To make either g++-5 or g++6 selectable
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50 --slave /usr/bin/g++ g++ /usr/bin/g++-5 update-alternatives --config gcc
This is a much cleaner solution, I will try it out. Tnx.