cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libraries with sub-libraries....


From: Eric Brown
Subject: Libraries with sub-libraries....
Date: Mon, 18 Jun 2001 14:18:56 -0700

One of our projects here has a (static) library that references symbols in a
second (static) library (provided by an external vendor).   

Currently, all the projects that reference the internal library also carry a
reference to the external library.  However, our (internal) library doesn't
expose any events provided by the (external) library, and so the developers
would like to 'link' the external library with the internal library.  The
stock Win32 linker/librarian (link.exe, or link -lib) can do this, but I'm
having a heck of a time getting this to happen the way I want to.

I'm using Greg Spencer's Win32 extensions, and the Conscript file for the
library in question looks like this:

# we want to link another library into this one.  Normally, the AR (unix) 
# command line doesn't include any references to %LIBS (needed to include
# the libraries), so we'll override it here by defining ARCOM.
# Aargh.  build::command::library doesn't do the lib path mangling that  
# build::command::link does.  Force resolution by explicitly setting
ARFLAGS.

$ARPATH = DirPath($LIB);

$local = $CONS->clone(LIBS => "@LIBS",
        DEFINES => $DEFS,
        CPPPATH => $MYINCLS . $CONS->{CPPPATH},
        LIBPATH => $LIB,
        PCHSOURCE => $PCHSOURCE,
        PCHHEADER => $PCHHEADER,
        ARCOM => "%AR %ARFLAGS /out:%> %< %LIBS",
        ARFLAGS => "/libpath:%ARPATH",
        ARPATH => $ARPATH,
        );

# Double Aargh.  build::command::library doesn't expand library references,
*either*.
# Add the deps manually....
@FULLLIBS = map $LIB . '/' . $_,  @LIBS;
Depends $local 'CPSSession.lib', @FULLLIBS;

$local->StaticLibrary(NAME => 'CPSSession',
        SRCS => address@hidden,
        INCS => address@hidden,
        LOCALINCS => address@hidden,
        RESOURCES => address@hidden,
        BIN  => $BIN,
        LIB  => $LIB,
        INCLUDE => $INCLUDE,
        NOPROJECT => 'true'
        );

But this seems *really* clumsy.  Has anybody else done anything similar?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]