[Harbour] HB_DLLIBS and shared binaries
Przemyslaw Czerpak
druzus at acn.waw.pl
Fri Dec 5 12:16:39 EST 2008
On Fri, 05 Dec 2008, Lorenzo Fiorini wrote:
Hi Lorenzo,
> I'm trying to cleanup the way to create shared libs ( in 1.0.1 ).
> Under Linux everything is so easy but when it comes the turn of Win or
> OSX the things become harder.
> Locally I simply add all my contribs to harbour.[so|dll|dylib] but
> this can't be considered "clean".
> F.e. to link hbpgsql and gd under OSX you need:
> -lhggd -lhbpgsql
> and
> -L/opt/local/lib -lpq -lssl -lldap -lcrypto -lkrb5 -lgd
> and
> full path reference to harbour.dylib
It's possible that full path references are not necessary. See libtool
options. Maybe it supports runtime late dynamic binding.
I also suggest to not hard code build time paths and use -L parameter.
Check libtool options for relative paths and later runtime behavior.
In general it will be good to check what libtool can do in MacOSX.
It has many interesting extensions. F.e. it does not need .a archive
extracting and can accept them directly.
> hb-mkslib doesn't support paths in *.a so I've tried to build to
> create some "postinst" shared libs using:
??? Can you describe what is the problem?
I've just made:
hb-mkslib dest/libxhgtk.so xhgtk/lib-hb/libxhgtk.a \
`pkg-config --libs gtk+-2.0 --libs libglade-2.0`
and it works without any problems.
> if [ "$HB_ARCHITECTURE" = "w32" ]; then
> cd $HB_LIB_INSTALL
> hb-mkslib $HB_BIN_INSTALL/libhbgd.dll libhbgd.a
> /opt/local/lib/libgd.lib $HB_BIN_INSTALL/harbour.dll
> /opt/local/bin/libgd2.dll
> hb-mkslib $HB_BIN_INSTALL/libhbpgsql.dll libhbpgsql.a
> -L/opt/pgsql/lib -lpq $HB_BIN_INSTALL/harbour.dll
> /opt/pgsql/bin/libpq.dll
> #hb-mkslib libxhgtk libxhgtk.a `pkg-config --libs gtk+-2.0 --libs
> libglade-2.0
> fi
>
> if [ "$HB_ARCHITECTURE" = "darwin" ]; then
> cd $HB_LIB_INSTALL
> hb-mkslib libhbgd libhbgd.a -L/opt/local/lib -lgd
> hb-mkslib libhbpgsql libhbpgsql.a -L/opt/local/lib -lpq -lssl
> -lldap -lcrypto -lkrb5
> #hb-mkslib libxhgtk libxhgtk.a `pkg-config --libs gtk+-2.0 --libs
> libglade-2.0
> fi
>
> but when it comes the time to use hblnk it still wants the path for
> libpq.dll or libgd2.dll so the problem is simply "shifted".
They have to be visible for linker so they should be located in one of
path defined by -L option. I'm not sure what you want to do.
> I've found an HB_DLLIBS envvar in hb-mkslib. Was it meant as a way to
> add user defined paths and libs?
It's used for compilers which may need some additional libraries
which are not standard ones.
best regards,
Przemek
More information about the Harbour
mailing list