diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2017-08-19 14:57:01 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2017-08-19 17:15:58 +0300 |
commit | 511f9c9765eb2a9992ea4470703ebcd96faca52b (patch) | |
tree | e0414383c4bc9cc9a95f5f32aae6fd2e8557e204 | |
parent | ead370a83f981ccf3d288dbe222fd362ec801f79 (diff) | |
download | runcap-511f9c9765eb2a9992ea4470703ebcd96faca52b.tar.gz runcap-511f9c9765eb2a9992ea4470703ebcd96faca52b.tar.bz2 |
Switch to autotools
* .gitignore: Update.
* Makefile: Remove.
* Make.am: New file.
* install.am: New file.
* shared.am: New file.
* static.am: New file.
* configure.ac: New file.
* runcap.m4: New file.
* t/Makefile: Remove.
* t/Makefile.am: New file.
* t/testsuite: Don't use relative directory addressing.
-rw-r--r-- | .gitignore | 21 | ||||
-rw-r--r-- | Make.am | 41 | ||||
-rw-r--r-- | Makefile | 103 | ||||
-rw-r--r-- | configure.ac | 15 | ||||
-rw-r--r-- | install.am | 7 | ||||
-rw-r--r-- | runcap.3 | 4 | ||||
-rw-r--r-- | runcap.m4 | 39 | ||||
-rw-r--r-- | shared.am | 6 | ||||
-rw-r--r-- | static.am | 6 | ||||
-rw-r--r-- | t/Makefile.am (renamed from t/Makefile) | 27 | ||||
-rwxr-xr-x | t/testsuite | 16 |
11 files changed, 153 insertions, 132 deletions
@@ -6,3 +6,24 @@ core | |||
6 | .gdbinit | 6 | .gdbinit |
7 | tmp | 7 | tmp |
8 | *.tar.gz | 8 | *.tar.gz |
9 | .deps | ||
10 | Makefile | ||
11 | Makefile.in | ||
12 | .deps | ||
13 | .libs/ | ||
14 | aclocal.m4 | ||
15 | autom4te.cache/ | ||
16 | compile | ||
17 | config.guess | ||
18 | config.log | ||
19 | config.status | ||
20 | config.sub | ||
21 | configure | ||
22 | depcomp | ||
23 | *.lo | ||
24 | install-sh | ||
25 | *.in | ||
26 | *.la | ||
27 | libtool | ||
28 | ltmain.sh | ||
29 | missing | ||
@@ -0,0 +1,41 @@ | |||
1 | # Main Makefile.am source for runcap | ||
2 | # Copyright (C) 2017 Sergey Poznyakoff | ||
3 | # | ||
4 | # Runcap is free software; you can redistribute it and/or modify it | ||
5 | # under the terms of the GNU General Public License as published by the | ||
6 | # Free Software Foundation; either version 3 of the License, or (at your | ||
7 | # option) any later version. | ||
8 | # | ||
9 | # Runcap is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License along | ||
15 | # with Runcap. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | # The runcap library can be built in three distinct flavours: | ||
18 | # 1. as a standalone library | ||
19 | # 2. as a shared convenience library | ||
20 | # 3. as a static convenience library | ||
21 | # Due to various Automake/libtools subtleties, the three builds cannot be | ||
22 | # defined in a single Makefile.am. Therefore, three distinct Automake sources | ||
23 | # are provided for each of the above types. Each of them contains the rules | ||
24 | # and variables for its particular build flavour, and obtains common rules and | ||
25 | # and variables by including Make.am. The actual build flavour is determined by | ||
26 | # the second argument to the RUNCAP_SETUP macro invocation (see runcap.m4). | ||
27 | # The files and the corresponding 2nd argument for each build type are: | ||
28 | # 1. install.am install | ||
29 | # 2. shared.am shared | ||
30 | # 3. static.am static | ||
31 | |||
32 | RUNCAP_SRC = \ | ||
33 | getc.c\ | ||
34 | getl.c\ | ||
35 | runcap.c\ | ||
36 | seek.c\ | ||
37 | tell.c | ||
38 | EXTRA_DIST = Make.am installed.am shared.am static.am | ||
39 | check: | ||
40 | $(MAKE) -C t check | ||
41 | SUBDIRS = . t | ||
diff --git a/Makefile b/Makefile deleted file mode 100644 index 47bcf17..0000000 --- a/Makefile +++ /dev/null | |||
@@ -1,103 +0,0 @@ | |||
1 | # runcap - run program and capture its output | ||
2 | # Copyright (C) 2017 Sergey Poznyakoff | ||
3 | # | ||
4 | # Runcap is free software; you can redistribute it and/or modify it | ||
5 | # under the terms of the GNU General Public License as published by the | ||
6 | # Free Software Foundation; either version 3 of the License, or (at your | ||
7 | # option) any later version. | ||
8 | # | ||
9 | # Runcap is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License along | ||
15 | # with Runcap. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | PREFIX = /usr | ||
18 | BINDIR = $(PREFIX)/bin | ||
19 | MANDIR = $(PREFIX)/share/man | ||
20 | |||
21 | MAN3DIR = $(MANDIR)/man3 | ||
22 | MAN3FILES = runcap.3 | ||
23 | |||
24 | # The install program. Use cp(1) if not available. | ||
25 | INSTALL = install | ||
26 | # Program to make directory hierarchy. | ||
27 | MKHIER = install -d | ||
28 | |||
29 | # Compiler options | ||
30 | O = -ggdb -Wall | ||
31 | |||
32 | PROJECT = libruncap | ||
33 | VERSION = 1.0 | ||
34 | |||
35 | SOURCES = runcap.c getc.c getl.c seek.c tell.c | ||
36 | OBJECTS = $(SOURCES:.c=.o) | ||
37 | HEADERS = runcap.h | ||
38 | |||
39 | CFLAGS = $(O) | ||
40 | LDFLAGS = | ||
41 | ARFLAGS = cru | ||
42 | |||
43 | .c.o: | ||
44 | $(CC) -c -o$@ $(CPPFLAGS) $(CFLAGS) $< | ||
45 | |||
46 | all: libruncap.a | ||
47 | |||
48 | $(OBJECTS): $(HEADERS) | ||
49 | |||
50 | libruncap.a: $(OBJECTS) | ||
51 | ar $(ARFLAGS) libruncap.a $(OBJECTS) | ||
52 | ranlib libruncap.a | ||
53 | |||
54 | clean: subdirs-clean | ||
55 | rm -f libruncap.a $(OBJECTS) | ||
56 | |||
57 | subdirs-clean: | ||
58 | @$(MAKE) -C t clean | ||
59 | |||
60 | install: install-lib install-headers install-man | ||
61 | |||
62 | install-lib: libruncap.a | ||
63 | $(MKHIER) $(DESTDIR)$(LIBDIR) | ||
64 | $(INSTALL) libruncap.a $(DESTDIR)$(LIBDIR) | ||
65 | |||
66 | install-headers: runcap.h | ||
67 | $(MKHIER) $(DESTDIR)$(INCLUDEDIR) | ||
68 | $(INSTALL) runcap.h $(DESTDIR)$(INCLUDEDIR) | ||
69 | |||
70 | install-man:; | ||
71 | $(MKHIER) $(DESTDIR)$(MAN3DIR) | ||
72 | $(INSTALL) $(MAN3FILES) $(DESTDIR)$(MAN3DIR) | ||
73 | |||
74 | .PHONY: check distdir | ||
75 | check: all | ||
76 | $(MAKE) -C t check | ||
77 | |||
78 | DISTDIR=$(PROJECT)-$(VERSION) | ||
79 | DISTFILES=Makefile $(SOURCES) $(HEADERS) $(MAN3FILES) | ||
80 | |||
81 | distdir: | ||
82 | test -d $(DISTDIR) || mkdir $(DISTDIR) | ||
83 | cp $(DISTFILES) $(DISTDIR) | ||
84 | $(MAKE) -C t distdir TOPDISTDIR=`cd $(DISTDIR); pwd` | ||
85 | |||
86 | dist: distdir | ||
87 | tar hzcf $(DISTDIR).tar.gz $(DISTDIR) | ||
88 | rm -rf $(DISTDIR) | ||
89 | |||
90 | distcheck: dist | ||
91 | @mkdir _build _inst; \ | ||
92 | cd _build; \ | ||
93 | tar xzf ../$(DISTDIR).tar.gz; \ | ||
94 | if $(MAKE) -C $(DISTDIR) check \ | ||
95 | && $(MAKE) -C $(DISTDIR) install DESTDIR=`cd ../_inst; pwd`; then \ | ||
96 | cd ..; \ | ||
97 | rm -rf _build _inst; \ | ||
98 | echo "$(DISTDIR).tar.gz is ready for distribution";\ | ||
99 | else \ | ||
100 | echo "Please, inspect " `pwd`;\ | ||
101 | fi | ||
102 | |||
103 | |||
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..365a128 --- /dev/null +++ b/configure.ac | |||
@@ -0,0 +1,15 @@ | |||
1 | AC_PREREQ(2.63) | ||
2 | AC_INIT([libruncap], [1.0], [gray+runcap@gnu.org.ua]) | ||
3 | AC_CONFIG_SRCDIR([runcap.c]) | ||
4 | AM_INIT_AUTOMAKE([1.11 foreign tar-ustar silent-rules]) | ||
5 | |||
6 | # Enable silent rules by default: | ||
7 | AM_SILENT_RULES([yes]) | ||
8 | |||
9 | # Checks for programs. | ||
10 | AC_PROG_CC | ||
11 | |||
12 | RUNCAP_SETUP([.],[install]) | ||
13 | |||
14 | # Generate files | ||
15 | AC_OUTPUT | ||
diff --git a/install.am b/install.am new file mode 100644 index 0000000..3426aee --- /dev/null +++ b/install.am | |||
@@ -0,0 +1,7 @@ | |||
1 | # Automake settings for a standalone installable build of runcap. | ||
2 | # See Make.am for details. | ||
3 | include Make.am | ||
4 | lib_LTLIBRARIES=libruncap.la | ||
5 | libruncap_la_SOURCES = $(RUNCAP_SRC) | ||
6 | include_HEADERS=runcap.h | ||
7 | dist_man_MANS=runcap.3 | ||
@@ -1,5 +1,5 @@ | |||
1 | .\" This file is part of runcap -*- nroff -*- | 1 | .\" This file is part of runcap -*- nroff -*- |
2 | .\" Copyright (C) 2016 Sergey Poznyakoff | 2 | .\" Copyright (C) 2017 Sergey Poznyakoff |
3 | .\" | 3 | .\" |
4 | .\" Runcap is free software; you can redistribute it and/or modify | 4 | .\" Runcap is free software; you can redistribute it and/or modify |
5 | .\" it under the terms of the GNU General Public License as published by | 5 | .\" it under the terms of the GNU General Public License as published by |
@@ -13,7 +13,7 @@ | |||
13 | .\" | 13 | .\" |
14 | .\" You should have received a copy of the GNU General Public License | 14 | .\" You should have received a copy of the GNU General Public License |
15 | .\" along with runcap. If not, see <http://www.gnu.org/licenses/>. | 15 | .\" along with runcap. If not, see <http://www.gnu.org/licenses/>. |
16 | .TH RUNCAP 2 "July 24, 2017" "RUNCAP" "User Commands" | 16 | .TH RUNCAP 2 "August 19, 2017" "RUNCAP" "User Commands" |
17 | .SH NAME | 17 | .SH NAME |
18 | runcap \- run external process and capture its stdout and stderr | 18 | runcap \- run external process and capture its stdout and stderr |
19 | .SH SYNOPSIS | 19 | .SH SYNOPSIS |
diff --git a/runcap.m4 b/runcap.m4 new file mode 100644 index 0000000..cd4c234 --- /dev/null +++ b/runcap.m4 | |||
@@ -0,0 +1,39 @@ | |||
1 | # This file is part of runcap -*- autoconf -*- | ||
2 | # Copyright (C) 2017 Sergey Poznyakoff | ||
3 | # | ||
4 | # Runcap is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License as published by | ||
6 | # the Free Software Foundation; either version 3, or (at your option) | ||
7 | # any later version. | ||
8 | # | ||
9 | # Runcap is distributed in the hope that it will be useful, | ||
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | # GNU General Public License for more details. | ||