]>
git.proxmox.com Git - mirror_ovs.git/blob - build-aux/cccl
4 # Wrapper around MS's cl.exe and link.exe to make them act more like
7 # Copyright (C) 2000-2003 Geoffrey Wossum (gwossum@acm.org)
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 cccl is a wrapper around Microsoft's cl.exe and link.exe. It translates
30 parameters that Unix cc's and ld's understand to parameters that cl and link
44 # prog specifies the program that should be run (cl.exe or link.exe)
45 # We'll assume cl to start out
47 # opts specifies the command line to pass to the MSVC program
48 clopt
="${slash}nologo ${slash}FS"
49 linkopt
="${slash}nologo"
50 # gotparam is 0 if we didn't ever see a param, in which case we show usage()
54 clopt
="$clopt ${slash}EHsc"
56 ### Run through every option and convert it to the proper MS one
57 while test $# -gt 0; do
60 -*=*) optarg
=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
70 Copyright 2000-2003 Geoffrey Wossum
71 This is free software; see the source for copying conditions. There is NO
72 waranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
78 clopt
="$clopt ${slash}Za"
82 # -c (compile only) is actually the same, but for clarity...
83 clopt
="$clopt ${slash}c"
87 # cl only supports one debugging level
88 clopt
="$clopt ${slash}Zi"
89 linkopt
="$linkopt ${slash}DEBUG"
93 clopt
="$clopt ${slash}Od ${slash}D_DEBUG ${slash}MTd"
97 clopt
="$clopt ${slash}O2 ${slash}MT"
101 path
=`echo "$1" | sed 's/-L//'`
102 linkopt
="$linkopt ${slash}LIBPATH:$path"
103 cl_linkopt
="${slash}link ${slash}LIBPATH:\"$path\""
107 lib
=`echo "$1" | sed 's/-l//'`
111 linkopt
="$linkopt $lib"
115 clopt
="$clopt ${slash}G3"
119 clopt
="$clopt ${slash}G4"
123 clopt
="$clopt ${slash}G5"
127 clopt
="$clopt ${slash}G6"
131 # specifying output file, is it an object or an executable
135 clopt
="$clopt ${slash}Fo$1"
138 clopt
="$clopt ${slash}Fe$1";
139 linkopt
="$linkopt ${slash}out:$1"
148 # not all warnings are implemented
149 # the following is equivalent to
150 # Wimplicit-function-declaration but we will issue a compiler
152 clopt
="$clopt ${slash}we4013"
160 #ignore link warnings
163 -fno-strict-aliasing*)
180 # C++ source file with non .cpp extension, make sure cl understand
182 clopt
="$clopt ${slash}Tp$1"
185 *.o |
*.obj |
*.a |
*.lib
)
186 # Object files/libraries seen, this command will require link
187 # Switch the prog to link
188 linkopt
="$linkopt $1"
194 linkopt
="$linkopt $1"
195 if test x
$optarg != x
; then
196 clopt
="$clopt=$optarg"
197 linkopt
="$linkopt=$optarg"
205 if test x
$gotparam = x
; then
210 # choose which opts we built up based on which program will actually run
211 if test x
$prog = xcl
; then
212 opts
="$clopt $cl_linkopt"
217 if test x
$V = x1
; then