+ config/Makefile
+ Added Makefile to show an error with simple one-liner
instruction to guide users who want to start provided
GNU Make executables right in the config dir.
This is wrong, they should be started in root.
Anyhow maybe I'll move these make executables to root,
with these names:
dos-make.exe
os2-make.exe
win-make.exe
This will avoid above problem, it simply cannot be
[messed] up anymore. Well, so I imagine.
These names also won't collide with original names
of these tools, so users who want to stick with external
tools, can continue to do so.
The other option is that I delete them from SVN.
* config/global.mk
+ Showing warning to user if she's using DOS shell
(which probably means DOS based GNU Make) on Windows system.
It should also work for most features, but not recommended
and there is little reason to do this in production
environment.
* contrib/hbqt/Makefile
* contrib/hbqt/generator/hbqtgen.prg
+ contrib/hbqt/filelist.mk
- contrib/hbqt/Makefile_gen
* Renamed Makefile to filelist.mk to stick
with known short filenames and extensions.
* INSTALL
* Minor.
870 lines
31 KiB
Plaintext
870 lines
31 KiB
Plaintext
/*
|
|
* $Id$
|
|
*/
|
|
|
|
HARBOUR
|
|
=======
|
|
|
|
"The Harbour Project is a Free Open Source Software effort to build
|
|
a multiplatform Clipper language compiler. Harbour consists of the
|
|
xBase language compiler and the runtime libraries with different
|
|
terminal plugins and different databases (not just DBF)"
|
|
|
|
http://www.harbour-project.org/
|
|
|
|
|
|
HOW TO BUILD AND INSTALL HARBOUR FROM SOURCE
|
|
============================================
|
|
|
|
NOTE: Before reporting a problem on the mailing list, please make
|
|
sure to read the TROUBLESHOOTING section in this file.
|
|
|
|
For all platforms you'll need:
|
|
|
|
* Supported ANSI C compiler
|
|
* GNU Make (3.81 or upper)
|
|
* Harbour sources (2.0.0 or upper)
|
|
|
|
Linux/Darwin
|
|
------------
|
|
[ $ export HB_COMPILER=<gcc|watcom|icc|sunpro> ]
|
|
$ make install
|
|
|
|
To test it, type:
|
|
$ cd tests
|
|
$ hbmk2 hello.prg
|
|
$ ./hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
BSD/HP-UX/Solaris
|
|
-----------------
|
|
[ $ export HB_COMPILER=<gcc|sunpro> ]
|
|
$ gmake install
|
|
|
|
To test it, type:
|
|
$ cd tests
|
|
$ hbmk2 hello.prg
|
|
$ ./hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
NOTE for sunpro on Solaris:
|
|
---------------------------
|
|
If you have any GNU binutils stuff installed, do make sure
|
|
/usr/ccs/bin (the location of the native Sun C compilation
|
|
system tools) come *before* the GNU binutils components in
|
|
your $PATH.
|
|
|
|
Windows/Windows CE
|
|
------------------
|
|
Platform specific prerequisites:
|
|
|
|
1.) Windows NT or compatible system is required to build Harbour.
|
|
2.) Make sure to have your C compiler of choice properly installed
|
|
(in PATH). Refer to your C compiler installation and setup
|
|
instructions for details. It's recommended to make sure no tools
|
|
in your PATH belonging to other C compilers are interfering with
|
|
your setup. For the list of supported compilers, please look up
|
|
the relevant section in this file.
|
|
3.) You need to get GNU Make. We recommend this link:
|
|
http://sourceforge.net/projects/mingw/files/GNU%20Make/Current%20Release_%20mingw32-make-3.81-20080326/mingw32-make-3.81-20080326-3.tar.gz/download
|
|
Unpack it to your PATH or Harbour source root directory.
|
|
If you use MinGW compiler, you already have GNU Make.
|
|
For convenience you may also use included config/mingw32-make.exe
|
|
instead.
|
|
|
|
[ > set HB_COMPILER=<mingw|msvc|watcom|bcc|pocc|cygwin|...> ]
|
|
> mingw32-make install
|
|
|
|
To test it, type:
|
|
> cd tests
|
|
> ..\bin\hbmk2 hello.prg
|
|
> hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
NOTES: - <DIR> is your destination directory where executables,
|
|
libraries and headers will be created. Use absolute paths
|
|
only. For a peace of mind, avoid using spaces, quotes
|
|
in the name. You can leave it empty, in this case the
|
|
results will be created under the current directory tree.
|
|
- You can also use *nix hosts to create Windows builds:
|
|
$ make HB_ARCHITECTURE=win
|
|
- You can also use *nix hosts to create Windows CE builds.
|
|
$ make HB_ARCHITECTURE=wce
|
|
|
|
Windows with MSYS or Cygwin shells
|
|
----------------------------------
|
|
You can also use these shells to build Harbour on Windows.
|
|
Generally it's recommended to use native shell though.
|
|
|
|
[ > set HB_COMPILER=<...> ]
|
|
> sh -c make install
|
|
|
|
To test it, type:
|
|
> cd tests
|
|
> ..\bin\hbmk2 hello.prg
|
|
> hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
NOTES: - With cygwin, <DIR> should use Cygwin drive
|
|
notation: /cygdrive/c for C:
|
|
- When building for Borland C make sure that
|
|
GNU Make is executed when typing 'make',
|
|
Borland Make has the same name.
|
|
|
|
MS-DOS
|
|
------
|
|
You can use MS-DOS or Windows NT compatible hosts to create DOS builds.
|
|
|
|
1.) Make sure to have your C compiler of choice properly installed
|
|
(in PATH).
|
|
2.) You need to get GNU Make. We recommend this link:
|
|
ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/mak381b.zip
|
|
Unpack it to your PATH or Harbour source root directory.
|
|
For convenience you may also use included config/dj-make.exe
|
|
instead.
|
|
|
|
[ > set HB_COMPILER=<djgpp|watcom> ]
|
|
> make install
|
|
|
|
To test it, type:
|
|
> cd tests
|
|
> ..\bin\hbmk2 hello.prg
|
|
> hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
OS/2
|
|
----
|
|
You can use OS/2, Windows NT compatible, or Linux hosts to create
|
|
OS/2 builds.
|
|
Some config tricks are required when non-OS/2 host is used, see in
|
|
examples.
|
|
|
|
1.) You need to get GNU Make. If you use OS/2 host, we recommend this link:
|
|
ftp://hobbes.nmsu.edu/pub/os2/dev/util/make-3.81-r2-bin-static.zip
|
|
If you use other host, please refer to other platform instructions
|
|
in this section.
|
|
For convenience you may also use included config/os2-make.exe
|
|
instead.
|
|
|
|
[ > set HB_COMPILER=<gcc|watcom> ]
|
|
> make install
|
|
|
|
To test it, type:
|
|
> cd tests
|
|
> ..\bin\hbmk2 hello.prg
|
|
> hello
|
|
You should see 'Hello world!' on screen.
|
|
|
|
|
|
HOW TO ENABLE OPTIONAL COMPONENTS BEFORE BUILD
|
|
==============================================
|
|
|
|
Some Harbour parts (typically contrib libraries) depend on 3rd
|
|
party components. To make these Harbour parts built, you need
|
|
to tell Harbour where to find the required 3rd party components
|
|
(typically headers).
|
|
|
|
On *nix systems most of these 3rd party components will
|
|
automatically be picked up if installed on some well-known
|
|
standard system locations.
|
|
|
|
You only need to use manual setup if the dependency isn't available
|
|
on your platform on a system location, or you wish to use
|
|
a non-standard location. Typically you need to do that on non-*nix
|
|
(Windows/MS-DOS/OS2) systems for all packages and for a few packages on
|
|
*nix which aren't available through official package managers
|
|
(ADS Client f.e.). Please see a list of official packages in
|
|
doc/linux1st.txt.
|
|
|
|
You can set these environment variables before starting
|
|
the build. Make sure to adjust them to your own directories:
|
|
|
|
HB_INC_ADS=C:\ads\acesdk
|
|
HB_INC_ALLEGRO=C:\allegro\include
|
|
HB_INC_BLAT=C:\blat\full\source
|
|
HB_INC_CURL=C:\curl\include
|
|
HB_INC_FIREBIRD=C:\Firebird\include
|
|
HB_INC_FREEIMAGE=C:\FreeImage\Dist
|
|
HB_INC_GD=C:\gd\include
|
|
HB_INC_LIBHARU=C:\libharu\include (defaults to locally hosted version)
|
|
HB_INC_LIBPNG=C:\libpng (defaults to locally hosted version on win/dos/os2)
|
|
HB_INC_MYSQL=C:\mysql\include
|
|
HB_INC_ODBC= (may only be needed on non-Windows systems)
|
|
HB_INC_OPENSSL=C:\openssl\inc32
|
|
HB_INC_PGSQL=C:\pgsql\include
|
|
HB_INC_QT=C:\Qt\include
|
|
HB_INC_SQLITE3=C:\sqlite3 (defaults to locally hosted version on win/dos/os2)
|
|
|
|
NOTES: - For MinGW + MSYS and Cygwin you have to use forward slashes
|
|
and also Cygwin drive notation for Cygwin.
|
|
- Spaces in directory names aren't currently supported.
|
|
(You can use short name alias on Windows platform, though)
|
|
- Don't put directory names inside double quotes.
|
|
- Use absolute paths.
|
|
|
|
Windows/Windows CE
|
|
------------------
|
|
Some contribs support build mode in which they can be linked *statically*
|
|
with 3rd party components:
|
|
|
|
HB_ALLEGRO_STATIC=yes
|
|
HB_QT_STATIC=yes
|
|
|
|
Darwin (OS X)
|
|
-------------
|
|
1.) Install MacPorts, follow their instructions:
|
|
http://www.macports.org/
|
|
2.) sudo port install allegro freeimage gd2 mysql5-devel postgresql83
|
|
|
|
|
|
SUPPORTED C COMPILERS UNDER DIFFERENT PLATFORMS
|
|
===============================================
|
|
|
|
You can use HB_ARCHITECURE values shown inside square brackets.
|
|
You can use below listed abbreviations as HB_COMPILER values.
|
|
|
|
Linux [linux]
|
|
-----
|
|
gcc - GNU C
|
|
watcom - Open Watcom C++
|
|
icc - Intel(R) C/C++
|
|
sunpro - Sun Studio C/C++
|
|
|
|
Darwin (OS X) [darwin]
|
|
-------------
|
|
gcc - GNU C
|
|
icc - Intel(R) C/C++
|
|
|
|
BSD [bsd]
|
|
---
|
|
gcc - GNU C
|
|
|
|
HP-UX [hpux]
|
|
-----
|
|
gcc - GNU C
|
|
|
|
Solaris [sunos]
|
|
-------
|
|
gcc - GNU C
|
|
sunpro - Sun Studio C/C++
|
|
|
|
Windows [win]
|
|
-------
|
|
mingw - MinGW GNU C 3.4.2 and above
|
|
mingw64 - MinGW GNU C x86-64
|
|
msvc - Microsoft Visual C++
|
|
msvc64 - Microsoft Visual C++ x86-64
|
|
msvcia64 - Microsoft Visual C++ IA-64
|
|
|
|
Also supported, some features may be missing:
|
|
|
|
watcom - Open Watcom C++
|
|
bcc - Borland/CodeGear C++ 4.x and above
|
|
icc - Intel(R) C/C++
|
|
iccia64 - Intel(R) C/C++ IA-64
|
|
pocc - Pelles C 4.5 and above
|
|
pocc64 - Pelles C x86-64 5.0 and above
|
|
xcc - Pelles C for xhb
|
|
cygwin - Cygwin GNU C
|
|
|
|
Windows CE [wce]
|
|
----------
|
|
mingwarm - MinGW GNU C ARM
|
|
msvcarm - Microsoft Visual C++ ARM
|
|
poccarm - Pelles C ARM 5.0 and above
|
|
|
|
MS-DOS [dos] (32-bit)
|
|
------
|
|
djgpp - Delorie GNU C
|
|
watcom - Open Watcom C++ 9.x and above
|
|
|
|
OS/2 [os2]
|
|
----
|
|
gcc - EMX GNU C
|
|
watcom - Open Watcom C++
|
|
|
|
|
|
OPTIONS AVAILABLE WHEN BUILDING HARBOUR
|
|
=======================================
|
|
|
|
You can fine-tune Harbour builds with below listed
|
|
environment variables. All of these are optional.
|
|
|
|
General
|
|
-------
|
|
- HB_COMPILER Override C compiler autodetection
|
|
- HB_ARCHITECTURE Override platform autodetection
|
|
See this section for possible values:
|
|
SUPPORTED C COMPILERS UNDER DIFFERENT PLATFORMS
|
|
|
|
- HB_USER_PRGFLAGS User Harbour compiler options
|
|
- HB_USER_CFLAGS User C compiler options
|
|
- HB_USER_LDFLAGS User linker options for executables
|
|
- HB_USER_AFLAGS User linker options for libraries
|
|
- HB_USER_DFLAGS User linker options for dynamic libraries
|
|
|
|
- HB_INSTALL_PREFIX Target root directory to install Harbour files.
|
|
This will default to Harbour source tree on
|
|
non-*nix systems. On *nix systems the default
|
|
is set to /usr/local/ or $(PREFIX) if specified,
|
|
and /usr/local/harbour-<arch>-<comp> for
|
|
cross-builds. It's always set to /pkg/<arch>/<comp>
|
|
when HB_BUILD_PKG is set to 'yes'.
|
|
|
|
- HB_BIN_INSTALL Override directory to install executables
|
|
- HB_LIB_INSTALL Override directory to install libraries
|
|
- HB_DYN_INSTALL Override directory to install dynamic libraries
|
|
- HB_INC_INSTALL Override directory to install language headers
|
|
- HB_DOC_INSTALL Override directory to install documentation
|
|
|
|
Special
|
|
-------
|
|
- HB_BUILD_NAME=[<name>] Create named build. This allows to keep
|
|
multiple builds in parallel for any given
|
|
platform/compiler. F.e. debug / release.
|
|
NOTE: In current implementation it's
|
|
appended to compiler directory name, so all
|
|
filesystem/platform name rules and limits
|
|
apply. It's valid to use (back)slashes though.
|
|
- HB_BUILD_PKG=yes Create release package. Default: no
|
|
Requires 'clean install' in root source dir.
|
|
(currently on Windows/Windows CE/DOS)
|
|
- HB_BUILD_DLL=no Create Harbour dynamic libraries. Default: yes
|
|
- HB_BUILD_IMPLIB=yes Create import libraries for external .dll
|
|
dependencies (including contribs). Default: no
|
|
(for Windows targets created on Windows NT
|
|
shells only)
|
|
- HB_BUILD_DEBUG=yes Create a debug build. Default: no
|
|
- HB_BUILD_OPTIM=no Enable C compiler optimizations. Default: yes
|
|
- HB_BUILD_UNICODE=yes Create Unicode build (on Windows/Windows CE).
|
|
Default: no
|
|
- HB_BUILD_MODE=[cpp|c] Changes default build mode to C++ or C.
|
|
Default: c, except for msvc* and watcom
|
|
compilers where it's cpp.
|
|
- HB_CONTRIBLIBS=no Don't build any contrib libraries. Default: yes
|
|
- HB_CONTRIBLIBS=[<list>] Build space separated <list> of contrib
|
|
libraries. Build all if left empty.
|
|
- HB_CONTRIB_ADDONS=<list> Build space separated <list> of additional
|
|
libraries stored in the contrib directory.
|
|
- HB_EXTERNALLIBS=no Don't build any external libraries. Default: yes
|
|
- HB_EXTERNALLIBS=[<list>] Build space separated <list> of external
|
|
libraries. Build all if left empty.
|
|
- HB_EXTERNAL_ADDONS=<list> Build space separated <list> of additional
|
|
libraries stored in the external directory.
|
|
- HB_VISUALC_VER_PRE80=yes Set this if you're using a pre-8.0
|
|
(= pre-MSVS 2005) version of MSVC compiler.
|
|
Default: no
|
|
- HB_REBUILD_PARSER=yes Rebuild language parser sources. Typically
|
|
you only need this if your are Harbour core
|
|
developer modifying grammar rules (.y).
|
|
Requires GNU Bison 1.28 or upper in PATH.
|
|
Default: no
|
|
|
|
Cross building
|
|
--------------
|
|
|
|
You can build Harbour for target platforms different than host
|
|
platform. F.e. you can create Windows build on *nix systems, Linux
|
|
builds on Windows systems, etc. It's also possible to build targets
|
|
for different than host CPU architectures. F.e. you can create
|
|
Windows 64-bit build on 32-bit Windows platform, or Linux x86_64
|
|
build on x86 hosts, or Linux MIPS build on x86 host.
|
|
|
|
Currently possible cross-platform scenarios, sorted by host platform:
|
|
|
|
on Windows hosts:
|
|
-> wce/mingwarm
|
|
-> wce/poccarm
|
|
-> wce/msvcarm
|
|
-> dos/djgpp (using MS-DOS build of GNU Make)
|
|
-> dos/watcom
|
|
-> os2/watcom
|
|
-> linux/watcom
|
|
on MS-DOS compatible hosts:
|
|
-> win/watcom
|
|
-> os2/watcom
|
|
-> linux/watcom
|
|
on OS/2 hosts:
|
|
-> win/watcom
|
|
-> dos/watcom
|
|
-> linux/watcom
|
|
on Linux hosts:
|
|
-> wce/mingwarm
|
|
-> win/mingw
|
|
-> win/watcom
|
|
-> dos/watcom
|
|
-> os2/watcom
|
|
On other *nix hosts:
|
|
-> wce/mingwarm
|
|
-> win/mingw
|
|
|
|
Point this envvar to the directory where native Harbour executables
|
|
for your host platform can be found:
|
|
HB_BIN_COMPILE=<HARBOUR_NATIVE_BUILD_DIR>\bin
|
|
|
|
If you leave this value empty, the make system will try to autodetect it,
|
|
so in practice all you have to do is to create native build first, then
|
|
create the cross-build. If you set this value manually, it may be useful
|
|
to know that only harbour, hbpp and hbmk2 executables are required for
|
|
a cross-build process to succeed.
|
|
|
|
|
|
EXAMPLES
|
|
========
|
|
|
|
Windows/Windows CE
|
|
------------------
|
|
|
|
NOTES: - All code below should be copied to batch files or typed at NT
|
|
command line.
|
|
- Naturally, you'll need to adapt dirs to valid ones on your system.
|
|
Don't use spaces in dirs.
|
|
- '%1 %2' can be empty, 'clean', 'install' or 'clean install'
|
|
depending on what you want to do.
|
|
|
|
--- MSVC 2008 + SDK
|
|
set WindowsSDKDir=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\
|
|
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC 2008
|
|
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC 2008 x86-64 (requires preceding build for native target)
|
|
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC 2008 WinCE/ARM (requires preceding build for native target)
|
|
set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i
|
|
set LIB=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I
|
|
set PATH=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC 2005
|
|
call "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat"
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC 2005 WinCE/ARM (requires preceding build for native target)
|
|
set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i
|
|
set LIB=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I
|
|
set PATH=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MSVC .NET 2003 (untested)
|
|
call "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\vcvarsall.bat"
|
|
rem
|
|
set HB_VISUALC_VER_PRE80=yes
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MinGW GCC
|
|
set PATH=C:\mingw\bin;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MinGW GCC + MSYS
|
|
set PATH=C:\msys\1.0.11\bin;C:\mingw\bin;%PATH%
|
|
rem
|
|
sh -c make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MinGW GCC x86-64 (requires preceding build for native target)
|
|
set PATH=C:\mingw64\bin;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- MinGW GCC WinCE/ARM (requires Cygwin + preceding build for native target)
|
|
set PATH=C:\mingwce\opt\mingw32ce\bin;C:\cygwin\bin;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Cygwin GCC (using Cygwin shell)
|
|
set PATH=C:\cygwin\bin
|
|
rem
|
|
sh -c make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Open Watcom C++
|
|
SET WATCOM=C:\watcom
|
|
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
|
|
SET EDPATH=%WATCOM%\EDDAT
|
|
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\NT
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Intel(R) C++
|
|
call "%ProgramFiles%\Intel\Compiler\C++\10.1.014\IA32\Bin\iclvars.bat"
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Intel(R) C++ IA-64 (requires preceding build for native target)
|
|
call "%ProgramFiles%\Intel\Compiler\C++\10.1.025\Itanium\Bin\iclvars.bat"
|
|
rem
|
|
set HB_COMPILER=iccia64
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Borland/CodeGear C++
|
|
set PATH=C:\Borland\BCC55\Bin;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Pelles C
|
|
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
|
|
set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE%
|
|
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win;%LIB%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Pelles C x86-64 (requires preceding build for native target)
|
|
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
|
|
set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE%
|
|
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win64;%LIB%
|
|
rem
|
|
set HB_COMPILER=pocc64
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Pelles C WinCE/ARM (requires preceding build for native target)
|
|
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
|
|
set INCLUDE=%ProgramFiles%\PellesC\Include\WinCE;%ProgramFiles%\PellesC\Include;%INCLUDE%
|
|
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\WinCE;%LIB%
|
|
rem
|
|
set HB_COMPILER=poccarm
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--8<--
|
|
rem ; Add these *before* above sample scripts to configure 3rd party dependencies.
|
|
rem For 'MinGW + MSYS' and Cygwin you'll have to use forward slashes and
|
|
rem also Cygwin drive notation for Cygwin.
|
|
set HB_INC_ADS=C:\ads\acesdk
|
|
set HB_INC_ALLEGRO=C:\allegro\include
|
|
set HB_INC_APOLLO=C:\Apollo\include
|
|
set HB_INC_BLAT=C:\blat\full\source
|
|
set HB_INC_CURL=C:\curl\include
|
|
set HB_INC_FIREBIRD=C:\Firebird\include
|
|
set HB_INC_FREEIMAGE=C:\FreeImage\Dist
|
|
set HB_INC_GD=C:\gd\include
|
|
set HB_INC_MYSQL=C:\mysql\include
|
|
set HB_INC_OPENSSL=C:\openssl\inc32
|
|
set HB_INC_PGSQL=C:\pgsql\include
|
|
set HB_INC_QT=C:\Qt\include
|
|
-->8--
|
|
|
|
--8<--
|
|
rem ; Add these *before* above sample scripts to configure 3rd party dependencies
|
|
rem for implib generation. These environment variables must point to the *root
|
|
rem directory* of given projects.
|
|
set HB_DIR_ADS=C:\ads\acesdk
|
|
set HB_DIR_ALLEGRO=C:\allegro
|
|
set HB_DIR_APOLLO=C:\Apollo
|
|
set HB_DIR_BLAT=C:\blat
|
|
set HB_DIR_CURL=C:\curl
|
|
set HB_DIR_FIREBIRD=C:\Firebird
|
|
set HB_DIR_FREEIMAGE=C:\FreeImage
|
|
set HB_DIR_GD=C:\gd
|
|
set HB_DIR_MYSQL=C:\mysql
|
|
set HB_DIR_OPENSSL=C:\openssl
|
|
set HB_DIR_PGSQL=C:\pgsql
|
|
set HB_DIR_QT=C:\Qt
|
|
rem
|
|
set HB_BUILD_IMPLIB=yes
|
|
-->8--
|
|
|
|
--8<--
|
|
rem ; To create installation packages (.exe + .zip),
|
|
rem add these lines before above sample scripts and
|
|
rem pass 'clean install' to make:
|
|
set HB_DIR_NSIS=%ProgramFiles%\NSIS\
|
|
set HB_DIR_ZIP=C:\info-zip\
|
|
set HB_BUILD_PKG=yes
|
|
-->8--
|
|
|
|
MS-DOS
|
|
------
|
|
|
|
--- Delorie GNU C (on MS-DOS host)
|
|
set DJGPP=C:\djgpp\djgpp.env
|
|
set PATH=C:\djgpp\bin;%PATH%
|
|
rem
|
|
make %1 %2 > log.txt
|
|
---
|
|
|
|
--- Delorie GNU C (on Windows NT host)
|
|
set DJGPP=C:\djgpp\djgpp.env
|
|
set PATH=C:\djgpp\bin;%PATH%
|
|
rem
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
[ TOFIX: currently chokes on some cmdline limit. ]
|
|
|
|
--- Open Watcom C++
|
|
SET WATCOM=C:\watcom
|
|
SET PATH=%WATCOM%\BINW;%PATH%
|
|
SET EDPATH=%WATCOM%\EDDAT
|
|
SET INCLUDE=%WATCOM%\H
|
|
rem
|
|
make %1 %2 > log-ow.txt 2>&1
|
|
---
|
|
|
|
--8<--
|
|
rem ; Add these *before* above sample scripts to configure 3rd party dependencies.
|
|
rem You have to use 8.3 path notation.
|
|
set HB_INC_ALLEGRO=C:\ALLEGR~1.2\include
|
|
set HB_INC_FIREBIRD=C:\FIREBI~1.4\include
|
|
set HB_INC_GD=C:\GD-20~1.34\include
|
|
set HB_INC_MYSQL=C:\MYSQL-~1.67\include
|
|
set HB_INC_PGSQL=C:\PGSQL-~1.3\include
|
|
-->8--
|
|
|
|
--8<--
|
|
rem ; To create installation packages (.zip),
|
|
rem add these lines before above sample scripts and
|
|
rem pass 'clean install' to make:
|
|
set HB_DIR_ZIP=C:\info-zip\
|
|
set HB_BUILD_PKG=yes
|
|
-->8--
|
|
|
|
OS/2
|
|
----
|
|
|
|
--- Open Watcom C++
|
|
SET WATCOM=C:\watcom
|
|
SET PATH=%WATCOM%\BINP;%WATCOM%\BINW;%PATH%
|
|
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
|
|
SET EDPATH=%WATCOM%\EDDAT
|
|
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2
|
|
SET HELP=%WATCOM%\BINP\HELP;%HELP%
|
|
SET BOOKSHELF=%WATCOM%\BINP\HELP;%BOOKSHELF%
|
|
rem
|
|
make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Open Watcom C++ (on Windows NT host - requires preceding build for Windows target)
|
|
SET WATCOM=C:\watcom
|
|
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
|
|
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
|
|
SET EDPATH=%WATCOM%\EDDAT
|
|
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2
|
|
rem
|
|
rem ; Native Windows Harbour binaries need to be installed on this path
|
|
set HB_BIN_COMPILE=C:\hb-watcom\bin
|
|
rem
|
|
set HB_ARCHITECTURE=os2
|
|
set HB_COMPILER=watcom
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
--- Open Watcom C++ (on Linux host - requires preceding build for Linux target)
|
|
#!/bin/sh
|
|
if [ -z "${WATCOM}" ]; then
|
|
export WATCOM="/opt/lng/watcom"
|
|
export INCLUDE="${WATCOM}/h:${WATCOM}/h/os2"
|
|
export PATH="${WATCOM}/binl:$PATH"
|
|
fi
|
|
# ; eliminate libraries which scans for local host header files
|
|
export HB_XBUILD=yes
|
|
# ; Native Linux binaries need to be installed on this path
|
|
export HB_BIN_COMPILE="/tmp/cross-hb"
|
|
# ;
|
|
export HB_ARCHITECTURE=os2
|
|
export HB_COMPILER=watcom
|
|
export HB_INSTALL_PREFIX="$(pwd)/hb-os2/watcom"
|
|
make "$@"
|
|
---
|
|
|
|
Linux
|
|
-----
|
|
|
|
--- Open Watcom C++ (on Windows NT host - requires preceding build for Windows target)
|
|
SET WATCOM=C:\watcom
|
|
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
|
|
SET EDPATH=%WATCOM%\EDDAT
|
|
SET INCLUDE=%WATCOM%\LH
|
|
rem
|
|
rem ; Native Windows Harbour binaries need to be installed on this path
|
|
set HB_BIN_COMPILE=C:\hb-watcom\bin
|
|
rem
|
|
set HB_ARCHITECTURE=linux
|
|
set HB_COMPILER=watcom
|
|
mingw32-make %1 %2 > log.txt 2>&1
|
|
---
|
|
|
|
|
|
HOW TO GET THE HARBOUR SOURCES
|
|
==============================
|
|
|
|
1.) It's possible you're reading this file as part of the Harbour
|
|
source code package. If not, read along.
|
|
|
|
2.) Harbour source repository
|
|
|
|
You'll need Subversion (SVN) version control software installed
|
|
on your system, and issue this command:
|
|
svn co https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour
|
|
|
|
You can get subsequent updates using this command:
|
|
svn update
|
|
|
|
3.) Harbour nightly sources (updated once a day from source repository)
|
|
|
|
Download source archive from any of these links and unpack:
|
|
http://harbour-project.org/harbour-nightly.zip
|
|
http://harbour-project.org/harbour-nightly.tgz
|
|
http://harbour-project.org/harbour-nightly.bz2
|
|
|
|
4.) Harbour source download (stable)
|
|
|
|
Download source archive from this page and unpack:
|
|
http://sourceforge.net/project/showfiles.php?group_id=681&package_id=192305
|
|
|
|
|
|
TROUBLESHOOTING
|
|
===============
|
|
|
|
Please evaluate these points before reporting an issue on the mailing list.
|
|
|
|
- Make sure to have carefully read this document.
|
|
- Make sure to do a 'clean' before doing a build after refreshing
|
|
the sources.
|
|
- Make sure to install fresh source tree in a new local directory and
|
|
start over. See HOW TO GET THE HARBOUR SOURCES section for instructions
|
|
to get the source.
|
|
- Keep you PATH clean from old, mixed compiler tools or other Harbour
|
|
versions when building Harbour. The surest way to achieve this is to
|
|
leave only compiler directory in PATH:
|
|
set PATH=C:\<compilerdir>
|
|
- Remove all old, unnecessary environment variables from your environment.
|
|
Use only those documented in this file.
|
|
- Try to do no or only small modifications at once to command examples
|
|
included in this file. If it doesn't work, fall back to documented
|
|
examples as is.
|
|
|
|
|
|
QUICK START TO BUILD YOUR OWN HARBOUR APPLICATIONS
|
|
==================================================
|
|
|
|
For all platforms you'll need two things:
|
|
|
|
* Harbour binaries
|
|
|
|
Either a Harbour binary distribution or a local Harbour
|
|
build will be okay. If you're reading this text, it's
|
|
very likely you have one of these already.
|
|
|
|
* Supported ANSI C compiler
|
|
|
|
Your compiler of choice has to be placed in the PATH
|
|
(and configured appropriately according to instructions).
|
|
If you use Harbour binary distribution on Windows, you
|
|
already have MinGW compiler embedded in the installation,
|
|
which will automatically be used, so you don't have to
|
|
make any extra steps here.
|
|
|
|
Examples to build a Harbour application:
|
|
|
|
- To build one simple .prg:
|
|
'hbmk2 hello.prg'
|
|
- To build multiple .prg sources into one application:
|
|
'hbmk2 mymain.prg client.prg'
|
|
- To build an application using a project file:
|
|
'hbmk2 myapp.hbp'
|
|
- To build an application using incremental mode:
|
|
'hbmk2 myapp.hbp -inc'
|
|
- To build an application which uses a contrib library:
|
|
'hbmk2 myapp.prg -lhbct'
|
|
- To build an application which uses a 3rd party library:
|
|
'hbmk2 myapp.prg -lsuplib -L<path_to_lib>'
|
|
- To build an application which uses a 3rd party library,
|
|
and the 3rd party lib has an .hbc file:
|
|
'hbmk2 myapp.prg rddleto.hbc -L<path_to_letodb>'
|
|
- To build an application which uses Windows resources:
|
|
'hbmk2 mymain.prg client.prg myres.rc'
|
|
- To build an application which links against Harbour dynamic libraries:
|
|
'hbmk2 -shared hello.prg'
|
|
- To build an application out of all .prg and .c sources residing
|
|
in 'source' subdir:
|
|
'hbmk2 -omyapp source/*.prg source/*.c'
|
|
|
|
Examples to build a Harbour static library:
|
|
|
|
- To build library 'mylib' from sources:
|
|
'hbmk2 mylibsrc.prg -omylib -hblib'
|
|
- To build library 'mylib' from sources using incremental mode:
|
|
'hbmk2 mylibsrc.prg -omylib -hblib -inc'
|
|
|
|
NOTES: - Most of the above features can be combined. F.e. to use
|
|
incremental build in any of the above commands, just add
|
|
'-inc' switch.
|
|
- List all available options:
|
|
'hbmk2 -help'
|
|
Besides the ones listed, you can use all regular Harbour
|
|
compiler command line options, like:
|
|
-l, -b, -n, -w3 (etc...)
|
|
- To make it easier to work with Harbour, it's recommended to
|
|
put Harbour binary dir into the PATH:
|
|
set PATH=C:\harbour\bin;%PATH% (on Windows)
|
|
(this is not a requirement though)
|
|
- You can access hbmk2 using absolute or relative paths, and
|
|
it will work equally well:
|
|
'C:\hb20\bin\hbmk2 hello.prg'
|
|
- GNU Make, MSYS, or any other extra tool is *not* needed
|
|
to build a Harbour application with above methods.
|
|
|
|
|
|
FOR MORE INFORMATION
|
|
====================
|
|
|
|
Homepage:
|
|
http://www.harbour-project.org/
|
|
|
|
User Forums:
|
|
http://sourceforge.net/apps/phpbb/harbour-project/
|
|
|
|
Sourceforge Page:
|
|
http://sourceforge.net/projects/harbour-project/
|
|
|
|
Developers' Mail Archives:
|
|
http://lists.harbour-project.org/pipermail/harbour/
|
|
|
|
Development Timeline:
|
|
http://sourceforge.net/apps/trac/harbour-project/timeline
|
|
|
|
Source Repository Browser:
|
|
http://harbour-project.svn.sourceforge.net/viewvc/harbour-project/
|
|
|
|
Source Repository Checkout (anonymous):
|
|
svn co https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour
|
|
|
|
Miscellaneous documents:
|
|
/doc directory under this directory.
|
|
|
|
|
|
|
|
[ Copyright (c) 2009 Viktor Szakats (harbour.01 syenar.hu)
|
|
Licensed under Creative Commons Attribution-ShareAlike 3.0:
|
|
http://creativecommons.org/licenses/by-sa/3.0/
|
|
See COPYING. ]
|