OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 # This script takes libcmt.lib for VS2005 and removes the allocation related | 2 # This script takes libcmt.lib for VS2005 and removes the allocation related |
3 # functions from it. | 3 # functions from it. |
4 # | 4 # |
5 # Usage: prep_libcmt.bat <VCInstallDir> <OutputFile> | 5 # Usage: prep_libcmt.bat <VCInstallDir> <OutputFile> |
6 # | 6 # |
7 # VCInstallDir is the path where VC is installed, typically: | 7 # VCInstallDir is the path where VC is installed, typically: |
8 # C:\Program Files\Microsoft Visual Studio 8\VC\ | 8 # C:\Program Files\Microsoft Visual Studio 8\VC\ |
9 # | 9 # |
10 # OutputFile is the directory where the modified libcmt file should be stored. | 10 # OutputFile is the directory where the modified libcmt file should be stored. |
11 # | 11 # |
12 | 12 |
13 LIBCMT="${1}\\libcmt.lib" | 13 LIBCMT="${1}\\libcmt.lib" |
14 LIBCMTPDB="${1}\\libcmt.pdb" | 14 LIBCMTPDB="${1}\\libcmt.pdb" |
15 OUTDIR=$2 | 15 OUTDIR=$2 |
16 OUTCMT="${2}\\libcmt.lib" | 16 OUTCMT="${2}\\libcmt.lib" |
17 | 17 |
18 mkdir -p $OUTDIR | 18 mkdir -p $OUTDIR |
19 cp "$LIBCMT" "$OUTDIR" | 19 cp "$LIBCMT" "$OUTDIR" |
20 cp "$LIBCMTPDB" "$OUTDIR" | 20 cp "$LIBCMTPDB" "$OUTDIR" |
21 | 21 |
22 | 22 |
23 # We'll remove the symbols based on paths found in either the VS2005 or VS2008 | 23 # We'll remove the symbols based on paths found in either the VS2005 or VS2008 |
24 # libcmt.lib files. | 24 # libcmt.lib files. |
25 LIBCMTSRCPATHVS2005="build\\intel\\mt_obj\\" | 25 LIBCMTSRCPATHVS2005="build\\intel\\mt_obj\\" |
26 LIBCMTSRCPATHVS2008="f:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\
\mt_obj\\" | 26 LIBCMTSRCPATHVS2008="f:\\dd\\vctools\\crt_bld\\SELF_X86\\crt\\src\\build\\INTEL\
\mt_obj\\" |
27 | 27 |
28 OBJFILES="malloc.obj free.obj realloc.obj new.obj delete.obj new2.obj delete2.ob
j align.obj msize.obj heapinit.obj expand.obj heapchk.obj heapwalk.obj heapmin.o
bj sbheap.obj calloc.obj recalloc.obj calloc_impl.obj new_mode.obj" | 28 OBJFILES="malloc.obj free.obj realloc.obj new.obj delete.obj new2.obj delete2.ob
j align.obj msize.obj heapinit.obj expand.obj heapchk.obj heapwalk.obj heapmin.o
bj sbheap.obj calloc.obj recalloc.obj calloc_impl.obj new_mode.obj newopnt.obj" |
29 | 29 |
30 for FILE in $OBJFILES | 30 for FILE in $OBJFILES |
31 do | 31 do |
32 echo ${FILE} | 32 echo ${FILE} |
33 LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2005}${FILE} $OUTC
MT | 33 LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2005}${FILE} $OUTC
MT |
34 LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2008}${FILE} $OUTC
MT | 34 LIB /NOLOGO /IGNORE:4006,4014,4221 /REMOVE:${LIBCMTSRCPATHVS2008}${FILE} $OUTC
MT |
35 done | 35 done |
OLD | NEW |