aboutsummaryrefslogtreecommitdiff
path: root/autoconfig.cpp
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2018-12-10 06:48:56 -0800
committerMike Buland <mbuland@penny-arcade.com>2018-12-10 06:48:56 -0800
commitc9aefa91df23de57e57818840555171bf4c831a1 (patch)
tree8cb6d4dbcb82c7f6f31274c205411c3379ffa074 /autoconfig.cpp
parent40e561cc553c808af8c5b5392f1fd74eacdd94b2 (diff)
downloadlibbu++-c9aefa91df23de57e57818840555171bf4c831a1.tar.gz
libbu++-c9aefa91df23de57e57818840555171bf4c831a1.tar.bz2
libbu++-c9aefa91df23de57e57818840555171bf4c831a1.tar.xz
libbu++-c9aefa91df23de57e57818840555171bf4c831a1.zip
Updated to use git for versions.
Diffstat (limited to 'autoconfig.cpp')
-rw-r--r--autoconfig.cpp20
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 }