source: git/IntegerProgramming/gccversion.sh.SAVE @ 76f3a18

spielwiese
Last change on this file since 76f3a18 was 76f3a18, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
added building binary programs from IntegerProgramming: toric_ideal, solve_IP, change_cost, gen_test and LLL ADD: IntegerProgramming is a SUBPACKAGE of the main package CHG: removing obsolette stuff (gccversion.sh) CHG: use gmp.h instead of si_gmp.h! TODO: install help files properly (only distributed for now)
  • 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.