Using gnu make system and hb* scripts, I can easily build the contribs
simply adding them to HB_CONTRIBLIBS but when I need to build
executable all the dependences have to be added to the hbmk command
line.

In Linux this is not a big problem usually means simply a -l<devlib>
but under Win and OSX is not so easy.

Today to achieve this I've modified my local hb-func.sh and
hb-mkslib.sh to include all the contribs into harbour's shared lib
adding  HB_CONTRIBLIBS to mk_hbgetlibs() and to include f.e.
PostgreSQL I've added to hb-func.sh:
...
if [ "\${HB_PGSQL}" = "yes" ]; then
    if [ "\${HB_ARCHITECTURE}" = "w32" ]; then
       SYSTEM_LIBS="\${SYSTEM_LIBS} -L/opt/pgsql/lib"
    fi
    if [ "\${HB_ARCHITECTURE}" = "darwin" ]; then
        SYSTEM_LIBS="\${SYSTEM_LIBS} -L/opt/local/lib -lssl -lldap
-lcrypto -lkrb5"
    fi
    SYSTEM_LIBS="\${SYSTEM_LIBS} -lpq"
fi
...

and to hb-mkslib.sh:
...
if [ "${SLIB_EXT}" = ".dylib" ]; then
...
        -L/opt/local/lib -lpq -lssl -lldap -lcrypto -lkrb5 -lgd \
...
elif [ "${SLIB_EXT}" = ".dll" ]; then
...
        SYSLIBS="${SYSLIBS} -L/opt/local/lib -lgd -L/opt/pgsql/lib -lpq"
...
    fi



this allows me to get small cgi executables using hbmk <myprg> -gd
-pgsql or easily add pgsql to gtk apps using
hbmk <myprg> -xhgtk -pgsql but I think we need to find a more
"universal way" to manage contribs.

Just to start the discussion:

how:
- add a switch for every contrib like the actual -xbgtk -xhgtk -hwgui

for the contrib that DON'T need external deps ( hbvpdf, hbct ):
- include into Harbour's shared lib
- create a single "hbext" shared lib
- create one shared lib for every contrib

for the contrib that need external deps:
- if we define that every dependence is in form: /<depdir>/[bin,include,lib]
    then HB_INC_xyz should point to <depdir> and we should use
<depdir>/include in makefiles and <depdir>/lib at link time
- we need a way to define the list of dep libs ( -L/opt/local/lib -lpq
-lssl -lldap -lcrypto -lkrb5 )

an example to follow could be PHP's extensions: one shared lib for
every contrib.

Comments?

best regards,
Lorenzo
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to