diff --git a/common.c b/common.c index 5fae31af..2376ae48 100644 --- a/common.c +++ b/common.c @@ -83,6 +83,8 @@ #include #endif +#include "build_details.h" + #ifdef CONFIG_ALSA void set_alsa_out_dev(char *); #endif @@ -1282,11 +1284,15 @@ char *get_version_string() { char *version_string = malloc(1024); if (version_string) { strcpy(version_string, PACKAGE_VERSION); + if (strlen(GITDESCRIPTION)) { + strcat(version_string, "-"); + strcat(version_string, GITDESCRIPTION); + } #ifdef CONFIG_LIBDAEMON - strcat(version_string, "-libdaemon"); + strcat(version_string, "-libdaemon"); #endif #ifdef CONFIG_MBEDTLS - strcat(version_string, "-mbedTLS"); + strcat(version_string, "-mbedTLS"); #endif #ifdef CONFIG_POLARSSL strcat(version_string, "-PolarSSL"); diff --git a/shairport.c b/shairport.c index cb9f132c..54573004 100644 --- a/shairport.c +++ b/shairport.c @@ -1510,6 +1510,19 @@ int main(int argc, char **argv) { // make sure the program can create files that group and world can read umask(S_IWGRP | S_IWOTH); + + /* print out version */ + + char *version_dbs = get_version_string(); + if (version_dbs) { + debug(1, "software version: \"%s\"", version_dbs); + free(version_dbs); + } else { + debug(1, "can't print the version information!"); + } + + debug(1, "log verbosity is %d.", debuglev); + config.output = audio_get_output(config.output_name); if (!config.output) { audio_ls_outputs(); @@ -1555,18 +1568,7 @@ int main(int argc, char **argv) { BUFFER_FRAMES * 352 - 22050); } - /* print out version */ - - char *version_dbs = get_version_string(); - if (version_dbs) { - debug(1, "software version: \"%s\"", version_dbs); - free(version_dbs); - } else { - debug(1, "can't print the version information!"); - } - /* Print out options */ - debug(1, "log verbosity is %d.", debuglev); debug(1, "disable resend requests is %s.", config.disable_resend_requests ? "on" : "off"); debug(1, "diagnostic_drop_packet_fraction is %f. A value of 0.0 means no packets will be dropped " "deliberately.",