summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2009-06-28 11:44:29 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-06-28 11:44:29 (GMT)
commit4b66e93d434d2a4fe8fd3f277e222de768475605 (patch) (side-by-side diff)
treed8e7eba5366ea9356aa1f4ba19f0cf8df5dfc349
parentd80d146b2c78a9ea114748129cde0fae017bbfbc (diff)
downloadcflow-4b66e93d434d2a4fe8fd3f277e222de768475605.tar.gz
cflow-4b66e93d434d2a4fe8fd3f277e222de768475605.tar.bz2
Minor changes.
* Makefile.am: Improve ChangeLog rule * configure.ac: Remove AH_BOTTOM * gnulib.modules: Add argp-version-etc, progname. Remove version-etc. * src/main.c: Use argp-version-etc
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile.am56
-rw-r--r--configure.ac6
-rw-r--r--gnulib.modules3
-rw-r--r--src/main.c18
4 files changed, 37 insertions, 46 deletions
diff --git a/Makefile.am b/Makefile.am
index ce24bbd..9c99ca0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,36 +24,34 @@ SUBDIRS = lib src elisp po doc tests
EXTRA_DIST = ChangeLog.2007
+# Define the following variables in order to use the ChangeLog rule below:
+# prev_change_log [optional] Name of the previous ChangeLog file.
+# gen_start_date [optional] Start ChangeLog from this date.
+# changelog_dir [mandatory] Directory where to create ChangeLog
gen_start_date = 2007-06-29
-.PHONY: make-ChangeLog
-make-ChangeLog:
- if test -d .git; then \
- $(top_srcdir)/build-aux/gitlog-to-changelog \
- --since=$(gen_start_date) | \
- sed '/<unknown>$$/d' | fmt -s > $(distdir)/cl-t; \
- echo " " >> $(distdir)/cl-t; \
- echo "Local Variables:" >> $(distdir)/cl-t; \
- echo "mode: change-log" >> $(distdir)/cl-t; \
- echo "version-control: never" >> $(distdir)/cl-t; \
- echo "buffer-read-only: t" >> $(distdir)/cl-t; \
- echo "End:" >> $(distdir)/cl-t; \
- rm -f $(distdir)/ChangeLog; \
- mv $(distdir)/cl-t $(distdir)/ChangeLog; \
- fi
-
-dist-hook: make-ChangeLog
+prev_change_log = ChangeLog.2007
+changelog_dir = .
.PHONY: ChangeLog
ChangeLog:
- if test -d .git; then \
- $(top_srcdir)/build-aux/gitlog-to-changelog \
- --since=$(gen_start_date) | \
- sed '/<unknown>$$/d' | fmt -s > ChangeLog; \
- echo " " >> ChangeLog; \
- echo "Local Variables:" >> ChangeLog; \
- echo "mode: change-log" >> ChangeLog; \
- echo "version-control: never" >> ChangeLog; \
- echo "buffer-read-only: t" >> ChangeLog; \
- echo "End:" >> ChangeLog; \
- fi
-
+ if test -d .git; then \
+ cmd=$(top_srcdir)/build-aux/gitlog-to-changelog; \
+ if test -n "$(gen_start_date)"; then \
+ cmd="$$cmd --since=\"$(gen_start_date)\""; \
+ fi; \
+ $$cmd | \
+ sed '/<unknown>$$/d' | fmt -s > $(changelog_dir)/cl-t; \
+ if test -n "$(prev_change_log)" && test -f "$(prev_change_log)"; \
+ then \
+ echo "" >> $(changelog_dir)/cl-t; \
+ cat "$(prev_change_log)" | \
+ sed '/^Local Variables:/,/^End:/d' >> $(changelog_dir)/cl-t; \
+ fi; \
+ echo "Local Variables:" >> $(changelog_dir)/cl-t; \
+ echo "mode: change-log" >> $(changelog_dir)/cl-t; \
+ echo "version-control: never" >> $(changelog_dir)/cl-t; \
+ echo "buffer-read-only: t" >> $(changelog_dir)/cl-t; \
+ echo "End:" >> $(changelog_dir)/cl-t; \
+ rm -f $(changelog_dir)/ChangeLog; \
+ mv $(changelog_dir)/cl-t $(changelog_dir)/ChangeLog; \
+ fi
diff --git a/configure.ac b/configure.ac
index 052e13f..da2ede4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,12 +42,6 @@ AC_CHECK_FUNCS([memmove memset strdup strerror strtol setlocale])
gl_INIT
MU_DEBUG_MODE
-AH_BOTTOM([
-/* program_name is used by lib/error.c */
-#define program_name program_invocation_name
-#include <errno.h>
-])
-
### Check for Emacs site-lisp directory
AM_PATH_LISPDIR
diff --git a/gnulib.modules b/gnulib.modules
index 5c5e1dc..87b9346 100644
--- a/gnulib.modules
+++ b/gnulib.modules
@@ -2,6 +2,7 @@
# A module name per line. Empty lines and comments are ignored.
argp
+argp-version-etc
obstack
lstat
malloc
@@ -9,5 +10,5 @@ error
hash
gettext-h
gitlog-to-changelog
+progname
snprintf
-version-etc \ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 5ad565a..cbb472e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -18,15 +18,20 @@
#include <cflow.h>
#include <argp.h>
+#include <argp-version-etc.h>
+#include <progname.h>
#include <stdarg.h>
#include <parser.h>
#include <version-etc.h>
-const char *argp_program_version = "cflow (" PACKAGE_NAME ") " VERSION;
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
static char doc[] = N_("generate a program flowgraph")
"\v"
N_("* The effect of each option marked with an asterisk is reversed if the option's long name is prefixed with `no-'. For example, --no-cpp cancels --cpp.");
+const char *program_authors[] = {
+ "Sergey Poznyakoff",
+ NULL
+};
enum option_code {
OPT_DEFINES = 256,
@@ -732,20 +737,13 @@ const char version_etc_copyright[] =
year. */
"Copyright %s 2005, 2006, %d Sergey Poznyakoff";
-static void
-cflow_version(FILE *stream, struct argp_state *state)
-{
- version_etc(stream, "cflow", PACKAGE_NAME, PACKAGE_VERSION,
- "Sergey Poznyakoff", NULL);
-}
-
int
main(int argc, char **argv)
{
int index;
- program_name = argv[0]; /* Until gnulib provides a better way */
- argp_program_version_hook = cflow_version;
+ set_program_name(argv[0]);
+ argp_version_setup("cflow", program_authors);
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);

Return to:

Send suggestions and report system problems to the System administrator.