diff options
Diffstat (limited to '')
-rw-r--r-- | autoconfig.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/autoconfig.cpp b/autoconfig.cpp index 0df3dbd..244fedf 100644 --- a/autoconfig.cpp +++ b/autoconfig.cpp | |||
@@ -130,15 +130,21 @@ int main( int argc, char *argv[] ) | |||
130 | fprintf( fOut, | 130 | fprintf( fOut, |
131 | "#ifndef BU_VERSION_H\n" | 131 | "#ifndef BU_VERSION_H\n" |
132 | "#define BU_VERSION_H\n\n" | 132 | "#define BU_VERSION_H\n\n" |
133 | "#define LIBBU_VERSION 0\n" | 133 | "#define LIBBU_VERSION 0\n" |
134 | "#define LIBBU_REVISION 1\n" | 134 | "#define LIBBU_REVISION 1\n" |
135 | "#define LIBBU_VERSION_STR \"%s\"\n" | 135 | "#define LIBBU_VERSION_STR \"%s\"\n" |
136 | "#define LIBBU_API 0\n" | 136 | "#define LIBBU_API 0\n" |
137 | "#define LIBBU_VC_ID \"", | 137 | "#define LIBBU_VC_ID \"", |
138 | buf | 138 | buf |
139 | ); | 139 | ); |
140 | FILE *psub = popen("svnversion -n", "r"); | 140 | |
141 | fwrite( buf, fread( buf, 1, 1024, psub ), 1, fOut ); | 141 | char buf2[1024]; |
142 | FILE *psub = popen("git describe --always", "r"); | ||
143 | buf2[fread( buf2, 1, 1024, psub )] = '\0'; | ||
144 | for( int j = 0; buf2[j]; j++ ) | ||
145 | if( buf2[j] == '\n' ) | ||
146 | buf2[j] = '\0'; | ||
147 | fwrite( buf2, strlen(buf2), 1, fOut ); | ||
142 | pclose( psub ); | 148 | pclose( psub ); |
143 | fprintf( fOut, "\"\n\n#endif\n"); | 149 | fprintf( fOut, "\"\n\n#endif\n"); |
144 | } | 150 | } |