Boost logo

Boost :

From: Thomas Witt (witt_at_[hidden])
Date: 2001-10-30 12:15:20


On Monday 29 October 2001 17:02, you wrote:
> From: "Markus Schoepflin" <markus.schoepflin_at_[hidden]>
>

.........
>
> link.exe, however, apparently has a maximum of 4K, and that includes
> content inside "response" files. It's not 4K total, just 4K per line -
> make sure there's a line break at least once every 4k and there should be
> no problems. This restriction is probably why Visual Studio always uses a
> response file when invoking link.exe.
>
> -cd

The following ruleset tries to circumvent the win32 line length problem by
building a response file before linking. It's a bit of a kludge but it works.

#### Link ####

rule Link-action
{
    local response-file = $(<:S=.rsp) ;
    ALWAYS $(response-file) ;
    DEPENDS $(<) : $(response-file) ;
    for object in $(>) {
      Response-File-action $(response-file) : $(object) ;
    }
    intel-win32-Link-action $(<) : $(response-file) ;
}

actions intel-win32-Link-action bind NEEDLIBS
{
    $(INTEL_TOOL_PATH)xilink /nologo $(LINKFLAGS) /PDB:"$(<[1]:S=.pdb)"
/out:"$(<[1])" $(UNDEFS) /LIBPATH:$(LIBPATH) /LIBPATH:$(STDLIBPATH)
$(NEEDLIBS) @$(>)
    del $(>)
}

#### Cc #####

rule Cc-action
{
    intel-win32-Cc-action $(<) : $(>) ;
}
 
actions intel-win32-Cc-action
{
    $(INTEL_TOOL_PATH)icl /Zm400 -nologo -c -U$(UNDEFS) -D$(DEFINES)
$(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -Fo"$(<)" "$(>)"
}

#### C++ ####
rule C++-action
{
    intel-win32-C++-action $(<) : $(>) ;
}

actions intel-win32-C++-action
{
    $(INTEL_TOOL_PATH)icl /Zm400 -nologo -GX -c -U$(UNDEFS) -D$(DEFINES)
$(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -Fo"$(<)" -Tp"$(>)"
}

#### Archive ####
rule Archive-action
{
    local response-file = $(<:S=.rsp) ;
    DEPENDS $(<) : $(response-file) ;
    for object in $(>) {
      Response-File-action $(response-file) : $(object) ;
    }
    intel-win32-Archive-action $(<) : $(response-file) ;
    RmTemps $(<) : $(response-file) ;
}

#
# Creating a response file for linking
#
# Fix Me !! Response file should reside in bin dir.
#
#
rule Response-File-action
{
  DEPENDS $(<) : $(>) ;
  MakeLocate $(<) : $(LOCATE_SOURCE) ;
  SEARCH on $(<) = $(LOCATE_SOURCE) ;
  Clean clean : $(<) ;
}

#
# Adding objects to response file. One at a time.
#
actions updated Response-File-action
{
  echo $(>) >> $(<)
}

rule intel-win32-Archive-action
{
  Clean clean : $(<) ;
}

actions updated together piecemeal intel-win32-Archive-action
{
        if exist "$(<)" set _$(<:B)_="$(<)"

        $(INTEL_TOOL_PATH)xilink /lib /out:"$(<)" %_$(<:B)_% @$(>)
}

Thomas

>
>
>
> Info: http://www.boost.org Unsubscribe:
> <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

-- 
Dipl.-Ing. Thomas Witt
Institut fuer Verkehrswesen, Eisenbahnbau und -betrieb, Universitaet Hannover
voice: +49(0) 511 762 - 4273, fax: +49(0) 511 762-3001
http://www.ive.uni-hannover.de

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk