From fe330cf5bb28c3e29514ce78ed4b88ba89508de7 Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Mon, 24 Feb 2014 16:34:51 +0900 Subject: [PATCH] syscall: make mkerrors.sh work with clang LGTM=iant R=golang-codereviews, minux.ma, gobot, iant CC=golang-codereviews https://golang.org/cl/67170043 --- src/pkg/syscall/mkerrors.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh index 9a2988a072..35f195413e 100755 --- a/src/pkg/syscall/mkerrors.sh +++ b/src/pkg/syscall/mkerrors.sh @@ -11,7 +11,7 @@ unset LANG export LC_ALL=C export LC_CTYPE=C -GCC=gcc +CC=${CC:-gcc} uname=$(uname) @@ -194,7 +194,7 @@ ccflags="$@" # The gcc command line prints all the #defines # it encounters while processing the input - echo "${!indirect} $includes" | $GCC -x c - -E -dM $ccflags | + echo "${!indirect} $includes" | $CC -x c - -E -dM $ccflags | awk ' $1 != "#define" || $2 ~ /\(/ || $3 == "" {next} @@ -263,24 +263,24 @@ ccflags="$@" # Pull out the error names for later. errors=$( - echo '#include ' | $GCC -x c - -E -dM $ccflags | + echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' | sort ) # Pull out the signal names for later. signals=$( - echo '#include ' | $GCC -x c - -E -dM $ccflags | + echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' | egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | sort ) # Again, writing regexps to a file. -echo '#include ' | $GCC -x c - -E -dM $ccflags | +echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' | sort >_error.grep -echo '#include ' | $GCC -x c - -E -dM $ccflags | +echo '#include ' | $CC -x c - -E -dM $ccflags | awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' | egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' | sort >_signal.grep @@ -390,4 +390,4 @@ main(void) ' ) >_errors.c -$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out +$CC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out