Import precosat-465r2-2ce82ba-100514
[cl-satwrap.git] / backends / precosat / mkconfig
blob0eac247c1061612aea00ddc4221f2978f3a1dfd3
1 #!/bin/sh
3 die () {
4 echo "*** mkconfig: $*" 1>&2
5 exit 1
8 [ -f makefile ] || die "can not find 'makefile'"
10 cat<<EOF
11 /**********************************************************/
12 /* Automatically generated by './mkconfig': do note edit! */
13 /**********************************************************/
14 EOF
16 if [ ! x"`grep '^CXX=g++$' makefile`" = x ]
17 then
18 patchgccversion="`g++ --version|head -1`"
19 patchgccversion="s,\"g++\",\"$patchgccversion\","
20 elif [ ! x"`grep '^CXX=gcc$' makefile`" = x ]
21 then
22 patchgccversion="`gcc --version|head -1`"
23 patchgccversion="s,\"gcc\",\"$patchgccversion\","
24 else
25 patchgccversion="s,DUMMY,DUMMY,"
28 sed \
29 -e '/^C[A-Z]*=/!d' \
30 -e 's,^,#define PRECOSAT_,' \
31 -e 's,= *, ",' \
32 -e 's,$,",' \
33 makefile | sed -e "$patchgccversion"
35 echo "#define PRECOSAT_OS \"`uname -srmn`\""
36 echo "#define PRECOSAT_COMPILED \"`date`\""
37 cat<<EOF
38 #define PRECOSAT_RELEASED "Fri May 14 16:42:36 CEST 2010"
39 #define PRECOSAT_VERSION "465r2"
40 #define PRECOSAT_ID "2ce82baa03201526ca8c1c8e83d34f28d52455c7"
41 EOF