Hi,
Another day another problem ;-)
I'm trying to compile one shared library and program that is using it.
everything works fine when I don't use debug switch -g in CCFLAGS.
That is I can compile shared library and program and link program against
shared version of that lib.
But with -g building is different I still get shared version of library but
now program is compiled against static version of that lib i.e. libFooBar-g.a
Why is that ???
Static libraries are deprecated.
IMHO the default behavior should be try dynamic version first, then search for
static.
In normal mode linking is ok even when I have static and dynamic versions of
lib nmake picks up dynamic one. So why is library binding changed when building
debug version ?
I looked through Makerules.mk and found that .BIND.-l% function (line 645)
binds -lFooBar to libFooBar-g.a if -g is in CCFLAGS . IMHO lines that cause
this behavior 670+ i.e.
if ( T = "$(.LIB.TYPE. $(B))" )
return $(T)
end
should be moved down in the logic so dynamic version would be picked up if
available.
Or maybe is there some variable that I can set to force dynamic linking
here is simple makefile I use to build program.
include $(VROOT)/src/Global.mk
.SOURCE.a:$(VROOT)/src/lib
CCFLAGS+=-g -fast -mt -xtarget=ultra -xarch=v9 -xinline=val_ref,val_unref
-errtags
:ALL: prog
SRC=Main.cc
prog::$(SRC) -lDoSomething
Thanks
Krzysztof
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users