1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:34:48 -07:00

Build changes to support work on the BSDs.

This does still contain some FreeBSD-specific bits, but
it's a pain to do partial diffs.

R=rsc
https://golang.org/cl/152138
This commit is contained in:
Devon H. O'Dell 2009-11-14 15:29:09 -08:00 committed by Russ Cox
parent 96bcdff662
commit 553be8427e
20 changed files with 65 additions and 48 deletions

View File

@ -69,7 +69,7 @@ dir:
@echo $(dir)
%.make:
(cd $* && make)
(cd $* && gomake)
# To use cgo in a Go package, add a line
#

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -13,6 +13,6 @@ do(
if test -f clean.bash; then
bash clean.bash
else
make clean
gomake clean
fi
)done

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -6,6 +6,6 @@
for i in cc 6l 6a 6c 8l 8a 8c 8g 5l 5a 5c 5g gc 6g gopack nm cgo cov ebnflint godefs godoc gofmt gotest goyacc hgpatch prof
do
cd $i
make clean
gomake clean
cd ..
done

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -94,8 +94,8 @@ fi
set -e
make testpackage-clean
make testpackage "GOTESTFILES=$gofiles"
gomake testpackage-clean
gomake testpackage "GOTESTFILES=$gofiles"
if $havex; then
$GC -o $xofile $xgofiles
fi
@ -107,7 +107,7 @@ trap "rm -f _testmain.go _testmain.$O" 0 1 2 3 14 15
MAKEFLAGS=
MAKELEVEL=
importpath=$(make -s importpath)
importpath=$(gomake -s importpath)
{
# test functions are named TestFoo
# the grep -v eliminates methods and other special names

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -15,13 +15,13 @@ fi
cd ${O}l
bash mkenam
make enam.o
gomake enam.o
cd ..
for i in cc ${O}l ${O}a ${O}c gc ${O}g gopack nm cov godefs prof gotest
do
echo; echo; echo %%%% making $i %%%%; echo
cd $i
make install
gomake install
cd ..
done

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -29,7 +29,7 @@ amd64 | 386 | arm)
esac
case "$GOOS" in
darwin | linux | nacl)
darwin | linux | nacl | freebsd)
;;
*)
echo '$GOOS is set to <'$GOOS'>, must be darwin, linux, or nacl' 1>&2
@ -41,6 +41,14 @@ CC=${CC:-gcc}
sed -e "s|@CC@|$CC|" < quietgcc.bash > $GOBIN/quietgcc
chmod +x $GOBIN/quietgcc
rm -f $GOBIN/gomake
MAKE=make
if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then
MAKE=gmake
fi
(echo '#!/bin/sh'; echo 'exec '$MAKE' "$@"') >$GOBIN/gomake
chmod +x $GOBIN/gomake
if ! (cd lib9 && which quietgcc) >/dev/null 2>&1; then
echo "installed quietgcc as $GOBIN/quietgcc but 'which quietgcc' fails" 1>&2
echo "double-check that $GOBIN is in your "'$PATH' 1>&2
@ -83,7 +91,7 @@ do
bash make.bash
;;
*)
make install
gomake install
esac
) || exit 1
esac

View File

@ -120,16 +120,16 @@ nuke.dirs: $(addsuffix .nuke, $(DIRS))
test.dirs: $(addsuffix .test, $(TEST))
%.clean:
+cd $* && make clean
+cd $* && gomake clean
%.install:
+cd $* && make install
+cd $* && gomake install
%.nuke:
+cd $* && make nuke
+cd $* && gomake nuke
%.test:
+cd $* && make test
+cd $* && gomake test
clean: clean.dirs

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -99,6 +99,10 @@ _* | *_ | _)
echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2
exit 1
;;
freebsd_amd64)
mksysnum="mksysnum_freebsd.sh /usr/src/sys/kern/syscalls.master"
mktypes="godefs -gsyscall -f-m64"
;;
darwin_386)
mksyscall="mksyscall.sh -l32"
mksysnum="mksysnum_darwin.sh /home/rsc/pub/xnu-1228/bsd/kern/syscalls.master"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -38,6 +38,11 @@ includes_Darwin='
#include <sys/event.h>
'
includes_FreeBSD='
#include <sys/wait.h>
#include <sys/event.h>
'
includes='
#include <sys/types.h>
#include <fcntl.h>

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
@ -19,10 +19,10 @@ maketest() {
do
(
xcd $i
make clean
time make
make install
make test
gomake clean
time gomake
gomake install
gomake test
) || exit $?
done
}
@ -34,31 +34,31 @@ maketest \
# from what maketest does.
(xcd pkg/sync;
make clean;
time make
GOMAXPROCS=10 make test
gomake clean;
time gomake
GOMAXPROCS=10 gomake test
) || exit $?
(xcd cmd/gofmt
make clean
time make
time make smoketest
gomake clean
time gomake
time gomake smoketest
) || exit $?
(xcd cmd/ebnflint
make clean
time make
time make test
gomake clean
time gomake
time gomake test
) || exit $?
(xcd ../misc/cgo/stdio
make clean
gomake clean
./test.bash
) || exit $?
(xcd pkg/exp/ogle
make clean
time make ogle
gomake clean
time gomake ogle
) || exit $?
(xcd ../doc/progs

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.