309ff4672b7f5cba9bca1ce8657f767b51f32220 — Drew DeVault 4 months ago 18ea282
Add pkg-config file, scdoc -v
5 files changed, 16 insertions(+), 3 deletions(-)

M Makefile
R include/{string.h => str.h}
A scdoc.pc
M src/main.c
M src/string.c
M Makefile => Makefile +2 -0
@@ 6,6 6,7 @@ _INSTDIR=$(DESTDIR)$(PREFIX)
  BINDIR?=$(_INSTDIR)/bin
  MANDIR?=$(_INSTDIR)/share/man
+ PCDIR?=$(_INSTDIR)/lib/pkgconfig
  OUTDIR=.build
  HOST_SCDOC=./scdoc
  .DEFAULT_GOAL=all


@@ 43,6 44,7 @@ install -Dm755 scdoc $(BINDIR)/scdoc
  	install -Dm644 scdoc.1 $(MANDIR)/man1/scdoc.1
  	install -Dm644 scdoc.5 $(MANDIR)/man5/scdoc.5
+ 	install -Dm644 scdoc.pc $(PCDIR)/scdoc.pc
  
  check: scdoc scdoc.1 scdoc.5
  	@find test -perm -111 -exec '{}' \;

R include/string.h => include/str.h +0 -0

        
A scdoc.pc => scdoc.pc +7 -0
@@ 0,0 1,7 @@
+ prefix=/usr
+ exec_prefix=${prefix}
+ scdoc=${exec_prefix}/bin/scdoc
+ 
+ Name: scdoc
+ Description: Man page generator
+ Version: 1.8.1

M src/main.c => src/main.c +6 -2
@@ 6,9 6,10 @@ #include <stdbool.h>
  #include <stdio.h>
  #include <stdlib.h>
+ #include <string.h>
  #include <time.h>
  #include <unistd.h>
- #include "string.h"
+ #include "str.h"
  #include "unicode.h"
  #include "util.h"
  


@@ 686,7 687,10 @@ }
  
  int main(int argc, char **argv) {
- 	if (argc > 1) {
+ 	if (argc == 2 && strcmp(argv[1], "-v") == 0) {
+ 		printf("scdoc " VERSION "\n");
+ 		return 0;
+ 	} else if (argc > 1) {
  		fprintf(stderr, "Usage: scdoc < input.scd > output.roff\n");
  		return 1;
  	}

M src/string.c => src/string.c +1 -1
@@ 1,6 1,6 @@ #include <stdlib.h>
  #include <stdint.h>
- #include "string.h"
+ #include "str.h"
  #include "unicode.h"
  
  static int ensure_capacity(str_t *str, size_t len) {