File: runcheck.sh

package info (click to toggle)
gcc-4.8 4.8.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 587,180 kB
  • ctags: 425
  • sloc: makefile: 65,711; sh: 1,248; perl: 165; awk: 23; cpp: 14
file content (23 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (30)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#! /bin/sh

mkdir -p build

abi=${CC##* }
base=build/runcheck$abi

cat >$base.c <<EOF
#include <stdio.h>
int main()
{
	printf("$abi");
	return 0;
}
EOF


if ${CC:-gcc} -o $base $base.c 2>/dev/null; then
  if [ "$($base 2>&1)" = "$abi" ]; then
    printf "%s" $abi > $base.out
    printf "%s" $abi
  fi
fi