2009-08-11 13:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
   * Cleaned LDLIBS usage:

One of recent modifications enabled some unnecessary libraries
in linking phase, i.e. now harbour compiler in Linux builds is linked
with -lgpm, i.e.:
ldd harbour
       linux-gate.so.1 =>  (0xffffe000)
       libgpm.so.1 => /usr/lib/libgpm.so.1 (0xb7f28000)
       libm.so.6 => /lib/libm.so.6 (0xb7f02000)
       librt.so.1 => /lib/librt.so.1 (0xb7ef9000)
       libdl.so.2 => /lib/libdl.so.2 (0xb7ef5000)
       libc.so.6 => /lib/libc.so.6 (0xb7db2000)
       libncurses.so.5 => /lib/libncurses.so.5 (0xb7d7a000)
       /lib/ld-linux.so.2 (0xb7f58000)
       libpthread.so.0 => /lib/libpthread.so.0 (0xb7d62000)

gpm library should be only added to binaries linked with
gtcrs, gtsln or gttrm.
If we are cleaning the usage of libraries then in *nix builds
only -lm should be enabled by default and other system libraries
like -lpcre, -lz, -lrt, -ldl -lsocket -lnsl -lresolv should be
enabled only if hbrtl is also linked. They are not necessary for
harbour and hbpp binaries.
It means that they should be covered by:
  ifneq ($(findstring hbrtl, $(LIBS)),)
     ...
  endif
  LDLIBS += -lm

It's still not perfect because we do not know if the code uses parts
of RTL which needs additional libraries anyhow it's better then
nothing.

True, I missed that point, I'll readd the check. Please check me
after it's done, maybe it'll need some tweaks.

Maybe these system libs could be moved to compiler global.cf files.

Brgds,
Viktor

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

Reply via email to