File: runcheck.sh

package info (click to toggle)
gcc-15 15.2.0-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 132,908 kB
  • sloc: makefile: 2,768; python: 1,036; sh: 982; awk: 23; perl: 18; cpp: 14
file content (23 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (61)
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