распаковать в /usr/src/harbour
cd /usr/src/harbour
make_gnu.sh all
make_gnu.sh install
вот, как-то так...
Не забываем, что нужны хидеры Иксов!!!
apt-get install xorg-dev
Мне еще пришлось создать пару папочек
sudo mkdir /usr/local/lib/harbour
sudo mkdir /usr/local/include/harbour
только после этого шаманства инсталляция закончилась
Итак, будем считать, что Харбор собран и установлен. самая простая проверка - запустить сам компилятор:
--------------------------------------------------
dimao@dimao-desktop:~$ harbour
Harbour 1.1.0dev (Rev. 10272)
Copyright (c) 1999-2009, http://www.harbour-project.org/
Syntax: harbour
Options: -a automatic memvar declaration
-b debug info
-build display detailed version info
-credits display credits
-d
-es[
-fn[:[l|u]|-] set filename casing (l=lower u=upper)
-fd[:[l|u]|-] set directory casing (l=lower u=upper)
-fp[:
-fs[-] turn filename space trimming on or off (default)
-g
-gc[
3=generate real C code
-go output type: Platform dependant object module
-gh output type: Harbour Portable Object (.hrb)
-i
-j[
-k compilation mode (type -k? for more data)
-l suppress line number information
-m compile module only
-n[
1=no starting procedure at all
-o
-p[
-p+ generate pre-processor trace (.ppt) file
-q quiet
-q0 quiet and don't display program header
-r:
-s syntax check only
-u[
-undef:
-v variables are assumed M->
-w[
-x[
-z suppress shortcutting (.and. & .or.)
@
dimao@dimao-desktop:~$
------------------------------------------
ну вот и все - можно компилировать программы. На сайте проекта можно найти простенький "ХауТу".
http://www.harbour-project.org/samples/HowToBuildOnLinux.html
-------------------------------------------
How to Build on Linux
In the last phase of install process if bash shell is available in the system then few bash scripts are created to make compiling and linking with Harbour a little easier. There are compiler and linker wrappers called "hbcc", "hbcmp", "hblnk" and "hbmk".
"hbcc" is a wrapper to the C compiler only. It sets all flags and paths necessary to compile .c files which include Harbour header files. The result of its work is an object file.
Use "hbcmp" exactly as you would use the harbour compiler itself. The main difference with hbcmp is that it results in an object file, not a C file that needs compiling down to an object. hbcmp also ensures that the harbour include directory is seen by the harbour compiler.
"hblnk" simply takes a list of object files and links them together with the harbour virtual machine and run-time library to produce an executable. The executable will be given the basename of the first object file if not directly set by the "-o" command line switch.
"hbmk" tries to produce an executable from your .prg file. It's a simple equivalent of cl.bat from the CA-Clipper distribution.
All these scripts accept command line switches:
-o
-static # link with static Harbour libs
-fullstatic # link with all static libs
-shared # link with shared libs (default)
-mt # link with multi-thread libs
-gt
# link with more GTs. The first one will be
# the default at runtime
-xbgtk # link with xbgtk library (xBase GTK+ interface)
-hwgui # link with HWGUI library (GTK+ interface)
-l
-L
-fmstat # link with the memory statistics lib
-nofmstat # do not link with the memory statistics lib (default)
-[no]strip # strip (no strip) binaries
-main=
# if not set then 'MAIN' is used or if it doesn't
# exist the name of first public function/procedure
# in first linked object module (link)
Link options work only with "hblnk" and "hbmk" and have no effect in "hbcc" and "hbcmp". Other options are passed to Harbour/C compiler/linker.
An example compile/link session looks like:
---------------------------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
function main()
? "Hello, World!"
return nil
druzus@uran:~/tmp$ hbcmp foo
Harbour Compiler Alpha build 46.2 (Flex)
Copyright 1999-2006, http://www.harbour-project.org/
Compiling 'foo.prg'...
Lines 5, Functions/Procedures 2
Generating C source output to 'foo.c'... Done.
druzus@uran:~/tmp$ hblnk foo.o
druzus@uran:~/tmp$ strip foo
druzus@uran:~/tmp$ ls -l foo
-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo
---------------------------------------------------------------------------------------
or using hbmk only:
---------------------------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
function main()
? "Hello, World!"
return nil
druzus@uran:~/tmp$ hbmk foo
Harbour Compiler Alpha build 46.2 (Flex)
Copyright 1999-2006, http://www.harbour-project.org/
Compiling 'foo.prg'...
Lines 5, Functions/Procedures 2
Generating C source output to 'foo.c'... Done.
druzus@uran:~/tmp$ ls -l foo
-rwxrwxr-x 1 druzus druzus 3824 maj 17 02:46 foo
---------------------------------------------------------------------------------------
You will find additional wonderful tools: /usr/bin/hbrun
You can run clipper/xbase compatible source files with it if you only put in their first line: #!/usr/bin/hbrun
For example:
----------------------------------------------------------------------
druzus@uran:~/tmp$ cat foo.prg
#!/usr/bin/hbrun
function main()
? "Hello, World!, This is a script !!! :-)"
return nil
druzus@uran:~/tmp$ chmod +x foo.prg
druzus@uran:~/tmp$ ./foo.prg
Hello, World!, This is a script !!! :-)
druzus@uran:~/tmp$
I hope you will find this information useful,
Przemyslaw Czerpak (druzus/at/priv.onet.pl)
Комментариев нет:
Отправить комментарий