source: git/IntegerProgramming/gccversion.sh @ 3e0c94f

spielwiese
Last change on this file since 3e0c94f was c0f7e2, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: fix git-svn-id: file:///usr/local/Singular/svn/trunk@10795 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100755
File size: 690 bytes
Line 
1#!/bin/sh
2#
3# FILE:    gccversion
4# USAGE:   gccversion
5# PURPOSE: creates si_gcc_v.h with SI_GCC2 or SI_GCC_3 defined
6# AUTHOR:  hannes
7# CREATED: June 2008
8#
9#####################################################
10
11if test "x$CC" = x
12then
13  CC=cc
14fi
15cat >tmp.c <<EOF
16#include <stdio.h>
17int main() {
18FILE *f=fopen("si_gcc_v.h","w");
19#ifdef __GNUC__
20char *p=__VERSION__;
21if (p[0]=='2') fprintf(f,"#define SI_GCC2\n");
22else if ((p[0]=='3')||(p[0]=='4')) fprintf(f,"#define SI_GCC3\n");
23#endif
24fclose(f);
25exit(0); }
26EOF
27$CC tmp.c
28if test -f ./a.out; then
29  ./a.out
30  /bin/rm -f a.out tmp.c
31elif test -f a.exe; then
32  ./a.exe
33  /bin/rm -f tmp.c a.exe
34else
35  echo run_unknown
36fi
37touch si_gcc_v.h
Note: See TracBrowser for help on using the repository browser.