source: git/kernel/gccversion.sh @ e585b6

spielwiese
Last change on this file since e585b6 was 66b5b8, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes: solaris port git-svn-id: file:///usr/local/Singular/svn/trunk@8916 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100755
File size: 609 bytes
Line 
1#!/bin/sh
2#
3# FILE:    gccversion
4# USAGE:   gccversion
5# PURPOSE: prints to stdout the gcc version type
6# AUTHOR:  hannes
7# CREATED: May 2003
8#
9#####################################################
10
11if test "x$CC" = x
12then
13  CC=cc
14fi
15cat >tmp.c <<EOF
16int main() {
17#ifdef __GNUC__
18char *p=__VERSION__;
19if (p[0]=='2') printf("gcc2\n");
20else if (p[0]=='3') printf("gcc3\n");
21else printf("gcc_unknown\n");
22#else
23printf("unknown\n");
24#endif
25exit(0); }
26EOF
27$CC tmp.c
28if test -e ./a.out; then
29  ./a.out
30  /bin/rm -f a.out tmp.c
31elif test -e a.exe; then
32  ./a.exe
33  /bin/rm -f tmp.c a.exe
34else
35  echo run_unknown
36fi
Note: See TracBrowser for help on using the repository browser.