Przeglądaj źródła

exec/Makefile.am: require that copied code stays in sync

* exec/Makefile.am (check_logsys_log_printf_functions): New rule.
(check): Depend on check_logsys_log_printf_functions.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2129 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering 17 lat temu
rodzic
commit
e512d1f811
1 zmienionych plików z 11 dodań i 0 usunięć
  1. 11 0
      exec/Makefile.am

+ 11 - 0
exec/Makefile.am

@@ -135,3 +135,14 @@ uninstall-local:
 
 
 clean-local:
 clean-local:
 	rm -f corosync *.o *.lcrso gmon.out *.da *.bb *.bbg *.so*
 	rm -f corosync *.o *.lcrso gmon.out *.da *.bb *.bbg *.so*
+
+# Since we're requiring that _logsys_log_printf and _logsys_log_vprintf
+# have nearly identical code, here we require that they stay in sync.
+check_logsys_log_printf_functions:
+	$(AWK) '/^void _logsys_log_printf \(/, /^}/' $(srcdir)/logsys.c \
+	  | sed '/^[	 ]*va_/d;s/\.\.\.)$$/va_list ap)/' > $@-1
+	$(AWK) '/^void _logsys_log_vprintf \(/, /^}/' $(srcdir)/logsys.c \
+	  | sed 's/log_vprintf/log_printf/' > $@-2
+	diff $@-1 $@-2 && rm -f $@-1 $@-2
+
+check: check_logsys_log_printf_functions