diff options
Diffstat (limited to '')
-rw-r--r-- | autoconfig.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/autoconfig.cpp b/autoconfig.cpp index acd052e..c2649ad 100644 --- a/autoconfig.cpp +++ b/autoconfig.cpp | |||
@@ -64,17 +64,26 @@ int main( int argc, char *argv[] ) | |||
64 | } | 64 | } |
65 | else if( strcmp( argv[1], "src/version.h" ) == 0 ) | 65 | else if( strcmp( argv[1], "src/version.h" ) == 0 ) |
66 | { | 66 | { |
67 | FILE *fVer = fopen("version", "rt"); | ||
68 | char buf[1024]; | ||
69 | buf[fread( buf, 1, 1024, fVer )] = '\0'; | ||
70 | for( int j = 0; buf[j]; j++ ) | ||
71 | if( buf[j] == '\n' ) | ||
72 | buf[j] = '\0'; | ||
73 | fclose( fVer ); | ||
74 | |||
67 | fOut = fopen( argv[1], "w" ); | 75 | fOut = fopen( argv[1], "w" ); |
68 | fprintf( fOut, | 76 | fprintf( fOut, |
69 | "#ifndef BU_VERSION_H\n" | 77 | "#ifndef BU_VERSION_H\n" |
70 | "#define BU_VERSION_H\n\n" | 78 | "#define BU_VERSION_H\n\n" |
71 | "#define LIBBU_VERSION 0\n" | 79 | "#define LIBBU_VERSION 0\n" |
72 | "#define LIBBU_REVISION 1\n" | 80 | "#define LIBBU_REVISION 1\n" |
73 | "#define LIBBU_VERSION_STR \"0.1\"\n" | 81 | "#define LIBBU_VERSION_STR \"%s\"\n" |
74 | "#define LIBBU_API 0\n" | 82 | "#define LIBBU_API 0\n" |
75 | "#define LIBBU_VC_ID \""); | 83 | "#define LIBBU_VC_ID \"", |
84 | buf | ||
85 | ); | ||
76 | FILE *psub = popen("svnversion -n", "r"); | 86 | FILE *psub = popen("svnversion -n", "r"); |
77 | char buf[1024]; | ||
78 | fwrite( buf, fread( buf, 1, 1024, psub ), 1, fOut ); | 87 | fwrite( buf, fread( buf, 1, 1024, psub ), 1, fOut ); |
79 | pclose( psub ); | 88 | pclose( psub ); |
80 | fprintf( fOut, "\"\n\n#endif\n"); | 89 | fprintf( fOut, "\"\n\n#endif\n"); |