Home | History | Annotate | Download | only in allocator
      1 #!/bin/sh
      2 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 #
      6 # This script takes libcmt.lib for VS2005 and removes the allocation related
      7 # functions from it.
      8 #
      9 # Usage: prep_libcmt.bat <VCInstallDir> <OutputFile>
     10 #
     11 # VCInstallDir is the path where VC is installed, typically:
     12 #    C:\Program Files\Microsoft Visual Studio 8\VC\
     13 #
     14 # OutputFile is the directory where the modified libcmt file should be stored.
     15 #
     16 
     17 LIBCMT="${1}\\libcmt.lib"
     18 LIBCMTPDB="${1}\\libcmt.pdb"
     19 OUTDIR=$2
     20 OUTCMT="${2}\\libcmt.lib"
     21 
     22 mkdir -p $OUTDIR
     23 cp "$LIBCMT" "$OUTDIR"
     24 cp "$LIBCMTPDB" "$OUTDIR"
     25 
     26 
     27 # We'll remove the symbols based on paths found in either the VS2005 or VS2008
     28 # libcmt.lib files.
     29 LIBCMTSRCPATHVS2005="build\\intel\\mt_obj\\"
     30 LIBCMTSRCPATHVS2008="f:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\\mt_obj\\"
     31 
     32 OBJFILES="malloc.obj free.obj realloc.obj new.obj delete.obj new2.obj delete2.obj align.obj msize.obj heapinit.obj expand.obj heapchk.obj heapwalk.obj heapmin.obj sbheap.obj calloc.obj recalloc.obj calloc_impl.obj new_mode.obj newopnt.obj"
     33 
     34 for FILE in $OBJFILES
     35 do
     36   echo ${FILE}
     37   LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2005}${FILE} $OUTCMT
     38   LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2008}${FILE} $OUTCMT
     39 done
     40