diff options
-rw-r--r-- | utils/cec-follower/.gitignore | 1 | ||||
-rw-r--r-- | utils/cec-follower/Makefile.am | 15 | ||||
-rw-r--r-- | utils/cec-follower/cec-follower.cpp | 23 |
3 files changed, 4 insertions, 35 deletions
diff --git a/utils/cec-follower/.gitignore b/utils/cec-follower/.gitignore index eecce74d..29546d1f 100644 --- a/utils/cec-follower/.gitignore +++ b/utils/cec-follower/.gitignore @@ -1,3 +1,2 @@ cec-follower cec-follower.1 -version.h diff --git a/utils/cec-follower/Makefile.am b/utils/cec-follower/Makefile.am index 96e0f890..1108708b 100644 --- a/utils/cec-follower/Makefile.am +++ b/utils/cec-follower/Makefile.am @@ -2,20 +2,7 @@ bin_PROGRAMS = cec-follower man_MANS = cec-follower.1 cec_follower_SOURCES = cec-follower.cpp cec-follower.h cec-processing.cpp cec-tuner.cpp -cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/libcecutil $(GIT_COMMIT_CNT) +cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/libcecutil $(GIT_SHA) $(GIT_COMMIT_CNT) cec_follower_LDADD = -lrt ../libcecutil/libcecutil.la -cec-follower.cpp: version.h - -version.h: - @if [ -d $(top_srcdir)/.git ]; then \ - echo -n "#define SHA " >$@ ; \ - git -C $(top_srcdir) rev-parse HEAD >>$@ ; \ - else \ - touch $@ ; \ - fi - -clean-local: - -rm -vf version.h - EXTRA_DIST = cec-follower.1 diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp index b3f9d615..b31b51d3 100644 --- a/utils/cec-follower/cec-follower.cpp +++ b/utils/cec-follower/cec-follower.cpp @@ -22,9 +22,6 @@ #include "cec-follower.h" #include "compiler.h" -#ifndef ANDROID -#include "version.h" -#endif /* Short option list @@ -76,21 +73,8 @@ static struct option long_options[] = { { 0, 0, 0, 0 } }; -static void print_sha() -{ -#ifdef SHA #define STR(x) #x #define STRING(x) STR(x) - printf("cec-follower SHA : %s\n", STRING(SHA)); -#else - printf("cec-follower SHA : not available\n"); -#endif -} - -static void print_version() -{ - printf("cec-follower %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT)); -} static void usage() { @@ -447,7 +431,8 @@ int main(int argc, char **argv) show_state = true; break; case OptVersion: - print_version(); + printf("cec-follower %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT)); + printf("cec-follower SHA: %s\n", STRING(GIT_SHA)); std::exit(EXIT_SUCCESS); case ':': fprintf(stderr, "Option '%s' requires a value\n", @@ -497,7 +482,7 @@ int main(int argc, char **argv) node.state.service_by_dig_id = options[OptServiceByDigID]; state_init(node); - print_sha(); + printf("cec-follower SHA : %s\n", STRING(GIT_SHA)); doioctl(&node, CEC_ADAP_G_PHYS_ADDR, &node.phys_addr); @@ -506,8 +491,6 @@ int main(int argc, char **argv) node.adap_la_mask = laddrs.log_addr_mask; node.cec_version = laddrs.cec_version; - printf("\n"); - struct cec_connector_info conn_info = {}; doioctl(&node, CEC_ADAP_G_CONNECTOR_INFO, &conn_info); |