mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
package: involve $CCFLAGS when determing 64-bit arch (re: 9a48ba15
)
bin/package, src/cmd/INIT/package.sh: - It can depend on the compiler flags passed whether the compiler produces code for a 64-bit architecture, so pass $CCFLAGS to the compiler when testing whether it creates 64-bit object code. README.md: - Copy-edit of build instructions.
This commit is contained in:
parent
580ff61617
commit
4cfe49aebb
3 changed files with 18 additions and 6 deletions
20
README.md
20
README.md
|
@ -55,15 +55,27 @@ improved release out there.
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
After cloning this repo, cd to the top directory of it and run:
|
After downloading a release or cloning the ksh git repository, cd to the top
|
||||||
|
directory of it and run:
|
||||||
```sh
|
```sh
|
||||||
bin/package make
|
bin/package make
|
||||||
```
|
```
|
||||||
If you have trouble or want to tune the binaries, you may pass additional
|
If you have trouble or want to tune the binaries, you may pass additional
|
||||||
compiler and linker flags by appending it to the command shown above. E.g.:
|
compiler and linker flags. It is usually best to export these as environment
|
||||||
|
variables *before* running `bin/package` as they could change the name of
|
||||||
|
the build subdirectory of the `arch` directory, so exporting them is a
|
||||||
|
convenient way to keep them consistent between build and test commands.
|
||||||
|
**Note that this system uses `CCFLAGS` instead of the usual `CFLAGS`.**
|
||||||
|
An example that makes Solaris Studio cc produce a 64-bit binary:
|
||||||
```sh
|
```sh
|
||||||
bin/package make \
|
export CCFLAGS="-xc99 -m64 -O2" LDFLAGS="-m64"
|
||||||
SHELL=/bin/bash CCFLAGS="-xc99 -D_XPG6 -m64 -xO4" LDFLAGS="-m64"
|
bin/package make
|
||||||
|
```
|
||||||
|
Alternatively you can append these to the command, and they will only be
|
||||||
|
used for that command. You can also specify an alternative shell in which
|
||||||
|
to run the build scripts this way. For example:
|
||||||
|
```sh
|
||||||
|
bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" LDFLAGS="-L/opt/local/lib"
|
||||||
```
|
```
|
||||||
For more information run
|
For more information run
|
||||||
```sh
|
```sh
|
||||||
|
|
|
@ -2529,7 +2529,7 @@ int b() { return 0; }
|
||||||
tmp=hi$$
|
tmp=hi$$
|
||||||
trap 'rm -f $tmp.*' 0 1 2
|
trap 'rm -f $tmp.*' 0 1 2
|
||||||
echo 'int main() { return 0; }' > $tmp.a.c
|
echo 'int main() { return 0; }' > $tmp.a.c
|
||||||
$cc -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1
|
$cc $CCFLAGS -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1
|
||||||
file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" `
|
file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" `
|
||||||
case $bits in
|
case $bits in
|
||||||
*64*) bits=64 ;;
|
*64*) bits=64 ;;
|
||||||
|
|
|
@ -2528,7 +2528,7 @@ int b() { return 0; }
|
||||||
tmp=hi$$
|
tmp=hi$$
|
||||||
trap 'rm -f $tmp.*' 0 1 2
|
trap 'rm -f $tmp.*' 0 1 2
|
||||||
echo 'int main() { return 0; }' > $tmp.a.c
|
echo 'int main() { return 0; }' > $tmp.a.c
|
||||||
$cc -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1
|
$cc $CCFLAGS -o $tmp.a.exe $tmp.a.c </dev/null >/dev/null 2>&1
|
||||||
file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" `
|
file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" `
|
||||||
case $bits in
|
case $bits in
|
||||||
*64*) bits=64 ;;
|
*64*) bits=64 ;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue