Last change
on this file since 111 was 27, checked in by Sanahuja Guillaume, 8 years ago |
m
|
-
Property svn:executable
set to
*
|
File size:
851 bytes
|
Line | |
---|
1 | #usage svn_revision.sh gcc dir file
|
---|
2 | #gcc: gcc path
|
---|
3 | #dir: directory to get svn revision
|
---|
4 | #file: output file to put revision
|
---|
5 |
|
---|
6 | USER=$(whoami)@$(hostname)
|
---|
7 | DATE=$(date)
|
---|
8 | GCC_REV=$($1 -dumpversion)
|
---|
9 | SVN_PATH=$(readlink -f $2)
|
---|
10 | SVN_REV=$(svnversion $(readlink -f $2))
|
---|
11 |
|
---|
12 | mkdir -p $(dirname $3)
|
---|
13 |
|
---|
14 | cat > $3 <<EOF
|
---|
15 | //file generated automatically by compile_info.sh script
|
---|
16 | //do not edit it manually
|
---|
17 |
|
---|
18 | #include <string>
|
---|
19 |
|
---|
20 | #define USER "${USER}"
|
---|
21 | #define DATE "${DATE}"
|
---|
22 | #define GCC_REV "${GCC_REV}"
|
---|
23 | #define GCC_PATH "$1"
|
---|
24 | #define SVN_PATH "${SVN_PATH}"
|
---|
25 | #define SVN_REV "${SVN_REV}"
|
---|
26 |
|
---|
27 | inline void compile_info(std::string name) {
|
---|
28 | fprintf(stderr,"Using %s library:\n",name.c_str());
|
---|
29 | fprintf(stderr," -built by " USER " on " DATE "\n");
|
---|
30 | fprintf(stderr," -with GCC " GCC_REV " from " GCC_PATH "\n");
|
---|
31 | fprintf(stderr," -svnversion of " SVN_PATH " is " SVN_REV "\n\n");
|
---|
32 | }
|
---|
33 | EOF
|
---|
Note:
See
TracBrowser
for help on using the repository browser.