aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2019-06-20 08:56:22 -0700
committerPaul Eggert2019-06-20 08:57:25 -0700
commitb6af27927c2f06c5a091fbc1b04e819a70e0e2a2 (patch)
tree3e227d83e43b2e94e1dad66590a2fd83b21f4871 /lib-src
parentde4e1bddb1c4823af4d04f0bff5b4a0217e9701d (diff)
downloademacs-b6af27927c2f06c5a091fbc1b04e819a70e0e2a2.tar.gz
emacs-b6af27927c2f06c5a091fbc1b04e819a70e0e2a2.zip
Simplify lib-src version printing
* lib-src/Makefile.in (etags_cflags): Remove. All uses replaced by a simple ‘-o $@’. (ebrowse${EXEEXT}, emacsclient${EXEEXT}, emacsclientw${EXEEXT}): Omit -DVERSION= option. * lib-src/ebrowse.c (VERSION): * lib-src/emacsclient.c (VERSION): * lib-src/etags.c (EMACS_NAME, VERSION): Remove. All uses replaced by PACKAGE_NAME and PACKAGE_VERSION. * lib-src/ebrowse.c (version): * lib-src/etags.c (print_version): Use fputs to output the version info, since that’s fputs_unlocked. * lib-src/etags.c (PROGRAM_NAME): New macro. (print_version): Use it.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/Makefile.in12
-rw-r--r--lib-src/ebrowse.c16
-rw-r--r--lib-src/emacsclient.c6
-rw-r--r--lib-src/etags.c19
4 files changed, 19 insertions, 34 deletions
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 40222174bde..9cb733d8e16 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -362,23 +362,21 @@ TAGS: etags${EXEEXT} ${tagsfiles}
362 $(MAKE) -C ../lib all 362 $(MAKE) -C ../lib all
363 363
364etags_deps = ${srcdir}/etags.c $(NTLIB) $(config_h) 364etags_deps = ${srcdir}/etags.c $(NTLIB) $(config_h)
365etags_cflags = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" -o $@
366etags_libs = $(NTLIB) $(LOADLIBES) 365etags_libs = $(NTLIB) $(LOADLIBES)
367 366
368etags${EXEEXT}: ${etags_deps} 367etags${EXEEXT}: ${etags_deps}
369 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) 368 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -o $@ $< $(etags_libs)
370 369
371## ctags.c is distinct from etags.c so that parallel makes do not write two 370## ctags.c is distinct from etags.c so that parallel makes do not write two
372## etags.o files on top of each other. 371## etags.o files on top of each other.
373## FIXME? 372## FIXME?
374## Can't we use a wrapper that calls 'etags --ctags'? 373## Can't we use a wrapper that calls 'etags --ctags'?
375ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps} 374ctags${EXEEXT}: ${srcdir}/ctags.c ${etags_deps}
376 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(etags_cflags) $< $(etags_libs) 375 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -o $@ $< $(etags_libs)
377 376
378ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ 377ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \
379 $(config_h) 378 $(config_h)
380 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ 379 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} -o $@ $< $(NTLIB) $(LOADLIBES)
381 $< $(NTLIB) $(LOADLIBES) -o $@
382 380
383make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) 381make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h)
384 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@ 382 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< $(NTLIB) $(LOADLIBES) -o $@
@@ -395,12 +393,12 @@ pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h)
395 393
396emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) 394emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h)
397 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \ 395 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $< \
398 -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) \ 396 $(NTLIB) $(LOADLIBES) \
399 $(LIB_WSOCK32) $(LIB_EACCESS) $(LIBS_ECLIENT) -o $@ 397 $(LIB_WSOCK32) $(LIB_EACCESS) $(LIBS_ECLIENT) -o $@
400 398
401emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) 399emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h)
402 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \ 400 $(AM_V_CCLD)$(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows $< \
403 -DVERSION="\"${version}\"" $(LOADLIBES) \ 401 $(LOADLIBES) \
404 $(LIB_WSOCK32) $(LIB_EACCESS) $(LIBS_ECLIENT) -o $@ 402 $(LIB_WSOCK32) $(LIB_EACCESS) $(LIBS_ECLIENT) -o $@
405 403
406NTINC = ${srcdir}/../nt/inc 404NTINC = ${srcdir}/../nt/inc
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index 938b405f3cf..aaa0893ea44 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -3573,21 +3573,15 @@ usage (int error)
3573} 3573}
3574 3574
3575 3575
3576/* Display version and copyright info. The VERSION macro is set 3576/* Display version and copyright info. */
3577 from config.h and contains the Emacs version. */
3578
3579#ifndef VERSION
3580# define VERSION "21"
3581#endif
3582 3577
3583static _Noreturn void 3578static _Noreturn void
3584version (void) 3579version (void)
3585{ 3580{
3586 char emacs_copyright[] = COPYRIGHT; 3581 fputs (("ebrowse " PACKAGE_VERSION "\n"
3587 3582 COPYRIGHT "\n"
3588 printf ("ebrowse %s\n", VERSION); 3583 "This program is distributed under the same terms as Emacs.\n"),
3589 puts (emacs_copyright); 3584 stdout);
3590 puts ("This program is distributed under the same terms as Emacs.");
3591 exit (EXIT_SUCCESS); 3585 exit (EXIT_SUCCESS);
3592} 3586}
3593 3587
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index fd56007b156..4da532b42de 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -84,10 +84,6 @@ char *w32_getenv (const char *);
84#include <min-max.h> 84#include <min-max.h>
85#include <unlocked-io.h> 85#include <unlocked-io.h>
86 86
87#ifndef VERSION
88#define VERSION "unspecified"
89#endif
90
91/* Work around GCC bug 88251. */ 87/* Work around GCC bug 88251. */
92#if GNUC_PREREQ (7, 0, 0) 88#if GNUC_PREREQ (7, 0, 0)
93# pragma GCC diagnostic ignored "-Wformat-truncation=2" 89# pragma GCC diagnostic ignored "-Wformat-truncation=2"
@@ -546,7 +542,7 @@ decode_options (int argc, char **argv)
546 break; 542 break;
547 543
548 case 'V': 544 case 'V':
549 message (false, "emacsclient %s\n", VERSION); 545 message (false, "emacsclient %s\n", PACKAGE_VERSION);
550 exit (EXIT_SUCCESS); 546 exit (EXIT_SUCCESS);
551 break; 547 break;
552 548
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 6bd04d1f1c3..d2395cea33a 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -867,21 +867,18 @@ For detailed help on a given language use, for example,\n\
867etags --help --lang=ada."); 867etags --help --lang=ada.");
868} 868}
869 869
870#ifndef EMACS_NAME 870#if CTAGS
871# define EMACS_NAME "standalone" 871# define PROGRAM_NAME "ctags"
872#endif 872#else
873#ifndef VERSION 873# define PROGRAM_NAME "etags"
874# define VERSION "17.38.1.4"
875#endif 874#endif
876static _Noreturn void 875static _Noreturn void
877print_version (void) 876print_version (void)
878{ 877{
879 char emacs_copyright[] = COPYRIGHT; 878 fputs ((PROGRAM_NAME " (" PACKAGE_NAME " " PACKAGE_VERSION ")\n"
880 879 COPYRIGHT "\n"
881 printf ("%s (%s %s)\n", (CTAGS) ? "ctags" : "etags", EMACS_NAME, VERSION); 880 "This program is distributed under the terms in ETAGS.README\n"),
882 puts (emacs_copyright); 881 stdout);
883 puts ("This program is distributed under the terms in ETAGS.README");
884
885 exit (EXIT_SUCCESS); 882 exit (EXIT_SUCCESS);
886} 883}
887 884