Descriptioncmd/dist, cmd/go, cmd/cgo: allow $CC_FOR_TARGET and $CXX_FOR_TARGET to be differnet for each target
Currently, building Go with a value for $CC_FOR_TARGET and $CXX_FOR_TARGET will overwrite whatever value of defaultCC and defaultCXX was previously there, causing packages to fail when attempting to compile them for a target other than the last one built for.
This change changes defaultCC and defaultCXX to functions that look up a map[string]string. The keys are GOOS/GOARCH; the values are the expected value of $CC_FOR_TARGET/$CXX_FOR_TARGET.
The zdefaultcc.go file is generated with the help of two new z-files in src/cmd/go that contain the maps's values: defaultccs and defaultcxxs. Each of these files consists of lines of the form
d[`GOOS/GOARCH`] = `command`
These are put into functions and new compiles add to the end of each file. The intention of this design is that if recompiling a target with a different $CC_FOR_TARGET, the new value will replace the old target without us having to go through the defaultccs file each time.
The two new z-files are also cleaned properly.
Tested on linux/amd64 with successful cross-compilation sets for linux/amd64 and windows/386.
Patch Set 1 #Patch Set 2 : diff -r aecdc70c44ac https://code.google.com/p/go #Patch Set 3 : diff -r aecdc70c44ac https://code.google.com/p/go #Patch Set 4 : diff -r 77632b0a1c94 https://code.google.com/p/go #Patch Set 5 : diff -r f39dff1bf0d4 https://code.google.com/p/go #
Total comments: 1
MessagesTotal messages: 15
|