Hello to all.
First let me state that I succeeded in compiling harbour with all supported contribs under FreeBSD, and the apps and libraries of qtcontribs.
I'll post a similar report in the qtcontribs group.
Since I spent the month of October zeroed in on this (and qtcontribs also), I decided to post the most accurate report I could, describing the problems
I found and the steps I took to resolve them.
*** My system:
Platform: FreeBSD 11.1-STABLE amd64
Compiler: LLVM/Clang C 4.0.1 (tags/RELEASE_401/final) (64-bit)
Harbour 3.4 git pulled today.
=== Problems found ===
*** compile errors
1) I was having trouble compiling the following files:
contrib/xhb/filestat.c:
contrib/hbmzip/mzip.c
src/common/hbffind.c
src/common/hbfsapi.c
src/rtl/filebuf.c
src/rtl/filesys.c
src/rtl/fssize.c
because HB_USE_LARGEFILE64 is defined, and is triggering
the use of lseek64()/flock64()/ftruncate64()/stat64,
which do not exist on any FreeBSD amd64, and compilation stops
with:
stat64 undefined symbol
The terrible and completely ugly workaround I made to solve my
particular compilation problem was to edit all of the above .c files
and replaced all occurrences of:
#if defined( HB_USE_LARGEFILE64 )
with
#if defined( HB_USE_LARGEFILE64 ) && !defined( HB_OS_BSD )
With these changes, compilation finishes without errors, and
everything works.
Although this solution solves a FreeBSD arch amd64 problem,
I'm sure it will cause problems for FreeBSD arch i386 compilation.
I know the intention in ChangeLog.txt:
2007-11-22 01:44 UTC+0100 Przemyslaw Czerpak (druzus/at/
priv.onet.pl)
was to solve a problem but it created this one on BSD amd64 machines.
In bsd's case, the definition of HB_USE_LARGEFILE64 could be conditioned
to a detection of 'amd64' or 'i386'.
Perhaps
! HB_HOST_PLAT: bsd (x86_64)
! HB_PLATFORM: bsd (x86_64) (auto-detected)
could be used for this.
2) contribs hbmysql, sddmy and rddsql were not finishing compilation because
they were not finding -lmysqlclient lib so I edited:
- added to contrib/hbmysql/hbmysql.hbc and contrib/sddmy/sddmy.hbc
{bsd}libpaths=/usr/local/lib/mysql
- added to contrib/rddsql/rddsql.hbc
libpaths=/usr/local/lib/mysql
3) found a small discrepancy: hbcups and hbicu were being skipped because hbmk was reporting
it could no find the include files, despite:
export HB_WITH_ICU=/usr/local/include/unicode
export HB_WITH_CUPS=/usr/local/include/cups
Well, the project asks for:
export HB_WITH_MYSQL=/usr/local/include/mysql
export HB_WITH_CURL=/usr/local/include/curl
export HB_WITH_CAIRO=/usr/local/include/cairo
export HB_WITH_GS=/usr/local/include/ghostscript
export HB_WITH_MINIZIP=/usr/local/include/minizip
but in case of ICU and CUPS, it adds cups/cups.h and unicode/utypes.h
by itself. So in the case of these two, the correct form is:
export HB_WITH_ICU=/usr/local/include
export HB_WITH_CUPS=/usr/local/include
My small suggestion for consistency is to make these two have the same form as all the others but
it is not at all critical. It just took me a while to find out why they were not compiling since
I had everything needed by them.
-------------------------------------------------------------------------
*** Libs linking errors (when compiling qtcontribs57.hbp)
A lot of qtcontribs link to libgtqtc.(so | a), and gtqt.hbp was not linking to Qt libraries,
so I edited contrib/gtqtc/gtqtc.hbc.
Changed
{bsd|darwin}libs=stdc++
to
{darwin}libs=stdc++
{bsd}libs=stdc++ Qt5Core Qt5Gui Qt5Widgets
and added the following lines to it.
{HBMK_HAS_QT5&bsd}ldflags=-L${HB_QT_DIR}
{HBMK_HAS_QT5&bsd}dflags=-L${HB_QT_DIR}
-------------------------------------------------------------------------
After that, i exported the following:
export HB_OS_BSD=yes
export HB_USER_PRGFLAGS=-d__HB_QT_MAJOR_VER_5__
export HB_ARCHITECTURE=bsd
export HB_BUILD_VERBOSE=yes
export HB_BUILD_SHARED=yes
export HB_BUILD_UNICODE=yes
export HB_TR_SYSOUT=yes
export HB_BUILD_CONTRIB_DYN=yes
export HB_BUILD_PARTS=all
export HB_INSTALL_PREFIX=/usr/local/harbour
export HB_INSTALL_BIN=/usr/local/harbour/bin
export HB_INSTALL_LIB=/usr/local/harbour/lib
export HB_INSTALL_ETC=/usr/local/harbour/etc
export HB_INSTALL_INC=/usr/local/harbour/include
export HB_INSTALL_DOC=/usr/local/share/harbour
#
export HB_WITH_X11=/usr/local/include
export HB_WITH_MYSQL=/usr/local/include/mysql
export HB_WITH_CURL=/usr/local/include/curl
export HB_WITH_CAIRO=/usr/local/include/cairo
export HB_WITH_GS=/usr/local/include/ghostscript
export HB_WITH_GD=/usr/local/include
export HB_WITH_SLANG=/usr/local/include
export HB_WITH_PCRE=/usr/local/include
export HB_WITH_PCRE2=/usr/local/include
export HB_WITH_MINIZIP=/usr/local/include/minizip
export HB_WITH_SQLITE3=/usr/local/include
export HB_WITH_ICU=/usr/local/include
export HB_WITH_CUPS=/usr/local/include
#
export HB_WITH_QT=/usr/local/include/qt5
export HB_QT_MAJOR_VER=5
export HBMK_DIR_QT5=/usr/local/lib/qt5/bin
export HB_QTPATH=/usr/local/lib/qt5/bin
export HB_QT_DIR=/usr/local/lib/qt5
export HB_BUILD_ADDONS=qtcontribs57.hbp
I didn't need/want these:
export HB_WITH_ALLEGRO=no
export HB_WITH_FREEIMAGE=no
export HB_WITH_PGSQL=no
export HB_WITH_FIREBIRD=no
export HB_WITH_OCILIB=no
then gmake and gmake install
Log excerpt:
! Building Harbour 3.4.0dev from source
! MAKE: gmake 4.2.1 '/bin/sh'
! HB_USER_PRGFLAGS: -d__HB_QT_MAJOR_VER_5__
! HB_INSTALL_PREFIX: /usr/local/harbour
! HB_INSTALL_BIN: /usr/local/harbour/bin
! HB_INSTALL_LIB: /usr/local/harbour/lib
! HB_INSTALL_INC: /usr/local/harbour/include
! HB_INSTALL_DOC: /usr/local/share/harbour
! HB_INSTALL_ETC: /usr/local/harbour/etc
! HB_BUILD_CONTRIB_DYN: yes
! HB_BUILD_SHARED: yes
! HB_BUILD_PARTS: all
! HB_HOST_PLAT: bsd (x86_64) HB_SHELL: sh
! LD_LIBRARY_PATH: /Apps/Dbase/harbour/harbour4/lib/bsd/clang:
! HB_PLATFORM: bsd (x86_64) (auto-detected)
! HB_COMPILER: clang (v0400) (auto-detected: /usr/bin/)
! HB_HOST_PKGM: pkg
! Component: 'zlib' found in /usr/include
! Component: 'pcre2' found in /usr/local/include
! Component: 'gpm' not supported on bsd platform
! Component: 's-lang' found in /usr/local/include
! Component: 'curses' found in /usr/include
! Component: 'x11' found in /usr/local/include
! Component: 'wattcp/watt-32' not supported on bsd platform
! Source code: 2424d10cd6 master
https://github.com/vszakats/harbour-core.gitgmake[1]: Nothing to be done for 'all'.
gmake[1]: Nothing to be done for 'all'.
! 'hbdossrl' library skipped (platform or compiler not supported)
! 'png' library skipped (local copy unused)
! 'hbpcre' library skipped (local copy unused)
! 'hbpcre2' library skipped (local copy unused)
! 'hbzlib' library skipped (local copy unused)
OBS - despite export HB_BUILD_ADDONS=qtcontribs57.hbp, qtcontribs doesn't build from here.
../bin/bsd/clang/hbmk2 ../bin/make.hb . first
! Harbour root: '../' Project store: './' Core build: yes Addon: no
! Warning: Project not found, cannot be added: ./qtcontribs57/qtcontribs57.hbp
! Started build...
! Calculating build order for 72 projects...
I tried the full path /usr/local/harbour/addons/qtcontribs57.hbp but it was a no go.
In the end, there it is!
[~]>harbour -build
Harbour 3.4.0dev (2424d10cd6) (2017-10-24 18:00)
Copyright (c) 1999-2017,
https://github.com/vszakats/harbour-core/Harbour Build Info
---------------------------
Version: Harbour 3.4.0dev (2424d10cd6) (2017-10-24 18:00)
Compiler: LLVM/Clang C 4.0.1 (tags/RELEASE_401/final) (64-bit)
Platform: FreeBSD 11.1-STABLE amd64
PCode version: 0.3
Commit info: 2017-10-24 18:00:54 +0000
Commit ID: 2424d10cd609d077729bf9e762cc74dbc70bd7e5
Extra Harbour compiler options: -d__HB_QT_MAJOR_VER_5__
Build options:
---------------------------
[~]ls /usr/local/harbour/bin
3rdpatch.hb harbour hbformat hbmk2 hbpp hbspeed
commit.hb hbdoc hbi18n hbnetio hbrun hbtest
And added this path to ldconfig
[~]ls /usr/local/harbour/lib
bsd libhbcrypto.so.3.4.0 libhbhttpd.a libhbodbc.so.3.4.0 libhbxpp.so.3.4.0
libbz2.a libhbct.a libhbhttpd.so libhboslib.a libhbyaml.a
libed25519.a libhbct.so libhbhttpd.so.3.4 libhboslib.so libhbyaml.so
libexpat.a libhbct.so.3.4 libhbhttpd.so.3.4.0 libhboslib.so.3.4 libhbyaml.so.3.4
libgtcgi.a libhbct.so.3.4.0 libhbicu.a libhboslib.so.3.4.0 libhbyaml.so.3.4.0
libgtcrs.a libhbcups.a libhblang.a libhbpipeio.a libhbzebra.a
libgtpca.a libhbcups.so libhblzf.a libhbpipeio.so libhbzebra.so
libgtqtc.a libhbcups.so.3.4 libhblzf.so libhbpipeio.so.3.4 libhbzebra.so.3.4
libgtqtc.so libhbcups.so.3.4.0 libhblzf.so.3.4 libhbpipeio.so.3.4.0 libhbzebra.so.3.4.0
libgtqtc.so.3.4 libhbcurl.a libhblzf.so.3.4.0 libhbpp.a libhbziparc.a
libgtqtc.so.3.4.0 libhbcurl.so libhbmacro.a libhbrdd.a libhbziparc.so
libgtsln.a libhbcurl.so.3.4 libhbmagic.a libhbrtl.a libhbziparc.so.3.4
libgtstd.a libhbcurl.so.3.4.0 libhbmagic.so libhbsix.a libhbziparc.so.3.4.0
libgttrm.a libhbdebug.a libhbmagic.so.3.4 libhbsms.a libhpdf.a
libgtxwc.a libhbexpat.a libhbmagic.so.3.4.0 libhbsms.so libhwgdebug.a
libharbour.so libhbexpat.so libhbmemio.a libhbsms.so.3.4 liblzf.a
libharbour.so.3.4 libhbexpat.so.3.4 libhbmemio.so libhbsms.so.3.4.0 libminilzo.a
libharbour.so.3.4.0 libhbexpat.so.3.4.0 libhbmemio.so.3.4 libhbsqlit3.a libminizip.a
libhbamf.a libhbextern.a libhbmemio.so.3.4.0 libhbssl.a libmxml.a
libhbamf.so libhbformat.a libhbmisc.a libhbssl.so librddbm.a
libhbamf.so.3.4 libhbformat.so libhbmisc.so libhbssl.so.3.4 librddbm.so
libhbamf.so.3.4.0 libhbformat.so.3.4 libhbmisc.so.3.4 libhbssl.so.3.4.0 librddbm.so.3.4
libhbblink.a libhbformat.so.3.4.0 libhbmisc.so.3.4.0 libhbtcpio.a librddbm.so.3.4.0
libhbblink.so libhbfoxpro.a libhbmlzo.a libhbtcpio.so librddcdx.a
libhbblink.so.3.4 libhbfoxpro.so libhbmlzo.so libhbtcpio.so.3.4 librddfpt.a
libhbblink.so.3.4.0 libhbfoxpro.so.3.4 libhbmlzo.so.3.4 libhbtcpio.so.3.4.0 librddmisc.a
libhbbz2.a libhbfoxpro.so.3.4.0 libhbmlzo.so.3.4.0 libhbtest.a librddmisc.so
libhbbz2.so libhbfship.a libhbmxml.a libhbtest.so librddmisc.so.3.4
libhbbz2.so.3.4 libhbfship.so libhbmxml.so libhbtest.so.3.4 librddmisc.so.3.4.0
libhbbz2.so.3.4.0 libhbfship.so.3.4 libhbmxml.so.3.4 libhbtest.so.3.4.0 librddnsx.a
libhbbz2io.a libhbfship.so.3.4.0 libhbmxml.so.3.4.0 libhbtip.a librddntx.a
libhbbz2io.so libhbgd.a libhbmysql.a libhbtip.so librddsql.a
libhbbz2io.so.3.4 libhbgd.so libhbmysql.so libhbtip.so.3.4 librddsql.so
libhbbz2io.so.3.4.0 libhbgd.so.3.4 libhbmysql.so.3.4 libhbtip.so.3.4.0 librddsql.so.3.4
libhbcairo.a libhbgd.so.3.4.0 libhbmysql.so.3.4.0 libhbtpathy.a librddsql.so.3.4.0
libhbcairo.so libhbgs.a libhbmzip.a libhbtpathy.so libscrypt.a
libhbcairo.so.3.4 libhbgs.so libhbmzip.so libhbtpathy.so.3.4 libsddmy.a
libhbcairo.so.3.4.0 libhbgs.so.3.4 libhbmzip.so.3.4 libhbtpathy.so.3.4.0 libsddmy.so
libhbcomio.a libhbgs.so.3.4.0 libhbmzip.so.3.4.0 libhbunix.a libsddmy.so.3.4
libhbcomio.so libhbgt.a libhbnetio.a libhbunix.so libsddmy.so.3.4.0
libhbcomio.so.3.4 libhbgt.so libhbnetio.so libhbunix.so.3.4 libsddodbc.a
libhbcomio.so.3.4.0 libhbgt.so.3.4 libhbnetio.so.3.4 libhbunix.so.3.4.0 libsddodbc.so
libhbcomm.a libhbgt.so.3.4.0 libhbnetio.so.3.4.0 libhbusrrdd.a libsddodbc.so.3.4
libhbcomm.so libhbgzio.a libhbnf.a libhbvm.a libsddodbc.so.3.4.0
libhbcomm.so.3.4 libhbgzio.so libhbnf.so libhbvmmt.a libsddsqlt3.a
libhbcomm.so.3.4.0 libhbgzio.so.3.4 libhbnf.so.3.4 libhbxdiff.a libxdiff.a
libhbcommon.a libhbgzio.so.3.4.0 libhbnf.so.3.4.0 libhbxdiff.so libxhb.a
libhbcpage.a libhbhpdf.a libhbnortl.a libhbxdiff.so.3.4 libxhb.so
libhbcplr.a libhbhpdf.so libhbnulrdd.a libhbxdiff.so.3.4.0 libxhb.so.3.4
libhbcrypto.a libhbhpdf.so.3.4 libhbodbc.a libhbxpp.a libxhb.so.3.4.0
libhbcrypto.so libhbhpdf.so.3.4.0 libhbodbc.so libhbxpp.so libyaml.a
libhbcrypto.so.3.4 libhbhsx.a libhbodbc.so.3.4 libhbxpp.so.3.4
I have attached the full compilation log, hbide and hbdbu screens, all natively compiled in FreeBSD 11.1
Please let me know your opinions and suggestions, and if I can be of any help or assistance.
I cannot thank Victor and Pitpal enough for providing these wonderful softwares.
Piece!
Mario Lobo
http://www.mallavoodoo.com.brFreeBSD since 2.2.8 [not Pro-Audio.... YET!!]
"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."