diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-01-21 17:25:55 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-07-04 15:41:59 +0300 |
commit | 8e541ddaffcab6eaa36faf86304b51a0bc6a92a1 (patch) | |
tree | fc909de2e7322c9ad04e8d51d0f9e5213b552cb1 | |
parent | 17d95ceb6d3f749e9ce20747197703e40e453759 (diff) | |
download | grecs-8e541ddaffcab6eaa36faf86304b51a0bc6a92a1.tar.gz grecs-8e541ddaffcab6eaa36faf86304b51a0bc6a92a1.tar.bz2 |
Split declarations between several header files.
* Makefile.am (SUBDIRS): Add include
* am/grecs.m4 (GRECS_INCLUDES): Update
(GRECS_COND_BUILD_INSTALL)
(GRECS_COND_BUILD_SHARED)
(GRECS_COND_BUILD_STATIC): New conditions.
Build include/Makefile and include/grecs/Makefile.
* configure.ac: Use src/grecs-gram.y as a source
validity marker
* include/Makefile.a: New file.
* src/grecs.hin: Remove. Split into include/*. See below.
* include/grecs.h: New file.
* include/grecs/.gitignore: New file.
* include/grecs/Makefile.am: New file.
* include/grecs/doc.h: New file.
* include/grecs/error.h: New file.
* include/grecs/format.h: New file.
* include/grecs/lex.h: New file.
* include/grecs/list.h: New file.
* include/grecs/mem.h: New file.
* include/grecs/node.h: New file.
* include/grecs/parser.h: New file.
* include/grecs/preproc.h: New file.
* include/grecs/sockaddr.h: New file.
* include/grecs/symtab.h: New file.
* include/grecs/table.h: New file.
* include/grecs/tree.h: New file.
* include/grecs/txtacc.h: New file.
* include/grecs/types.h.in: New file.
* include/grecs/util.h: New file.
* include/grecs/value.h: New file.
* include/grecs/version.h: New file.
* src/grecs-locus.h: Move to ...
* include/grecs/locus.h: ... here
* src/grecsopt.h: Move to ...
* include/grecs/opt.h: ... here
* src/json.h: Move to ...
* include/grecs/json.h: ... here
* src/wordsplit.h: Move to ...
* include/wordsplit.h: ... here
* src/Make-inst.am (include_HEADERS): Remove.
* src/Make-shared.am (grecsinclude_HEADERS)
(noinst_HEADERS): Remove.
* src/Make-static.am (noinst_HEADERS): Remove.
* src/Make.am: Remove header-related stuff
* src/bind-gram.y: Fix includes.
* src/bind-lex.l: Likewise.
* src/cidr.c: Likewise.
* src/dhcpd-gram.y: Likewise.
* src/dhcpd-lex.l: Likewise.
* src/diag.c: Likewise.
* src/format.c: Likewise.
* src/grecs-gram.y: Likewise.
* src/grecs-lex.l: Likewise.
* src/json-gram.y: Likewise.
* src/json-lex.l: Likewise.
* src/jsonfmt.c: Likewise.
* src/lookup.c: Likewise.
* src/meta1-gram.y: Likewise.
* src/meta1-lex.l: Likewise.
* src/opthelp.c: Likewise.
* src/preproc.c: Likewise.
* src/sockaddr.c: Likewise.
* src/txtacc.c: Likewise.
* src/version.c: Likewise.
* tests/gcfenum.c: Likewise.
* tests/gcffmt.c: Likewise.
* tests/gcfpeek.c: Likewise.
* tests/gcfset.c: Likewise.
* tests/gcfver.c: Likewise.
* tests/json.c: Likewise.
60 files changed, 1067 insertions, 629 deletions
diff --git a/Makefile.am b/Makefile.am index e499bb4..3eaa8df 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -15,7 +15,7 @@ | |||
15 | # along with Grecs. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with Grecs. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | ||
17 | ACLOCAL_AMFLAGS = -I am | 17 | ACLOCAL_AMFLAGS = -I am |
18 | SUBDIRS=. src @GRECS_TESTDIR@ @GRECS_DOCDIR@ | 18 | SUBDIRS=. include src @GRECS_TESTDIR@ @GRECS_DOCDIR@ |
19 | EXTRA_DIST=build-aux/yyrename @GRECS_BUILD_AUX@ @GRECS_DISTDOC@ gitid.h | 19 | EXTRA_DIST=build-aux/yyrename @GRECS_BUILD_AUX@ @GRECS_DISTDOC@ gitid.h |
20 | 20 | ||
21 | noinst_HEADERS = gitid.h | 21 | noinst_HEADERS = gitid.h |
diff --git a/am/grecs.m4 b/am/grecs.m4 index 74b7840..60244a1 100644 --- a/am/grecs.m4 +++ b/am/grecs.m4 | |||
@@ -202,13 +202,14 @@ AC_DEFUN([GRECS_SETUP],[ | |||
202 | AC_SUBST([GRECS_CHANGELOG]) | 202 | AC_SUBST([GRECS_CHANGELOG]) |
203 | AC_SUBST([GRECS_DISTCK_AT]) | 203 | AC_SUBST([GRECS_DISTCK_AT]) |
204 | AC_SUBST([GRECS_README]) | 204 | AC_SUBST([GRECS_README]) |
205 | AC_SUBST([GRECS_INCLUDES],['-I$(top_srcdir)/]grecsdir[src] [-I$(top_builddir)/]grecsdir[src]') | 205 | AC_SUBST([GRECS_INCLUDES],['-I$(top_srcdir)/]grecsdir[include] [-I$(top_builddir)/]grecsdir[include]') |
206 | AC_SUBST([GRECS_HOST_PROJECT_INCLUDES]) | 206 | AC_SUBST([GRECS_HOST_PROJECT_INCLUDES]) |
207 | AC_SUBST([GRECS_DISTDOC]) | 207 | AC_SUBST([GRECS_DISTDOC]) |
208 | AC_SUBST([GRECS_INCLUDE_DIR],['$(pkgincludedir)']) | 208 | AC_SUBST([GRECS_INCLUDE_DIR],['$(pkgincludedir)']) |
209 | 209 | ||
210 | _GRECS_OPTION_SWITCH([install],[ | 210 | _GRECS_OPTION_SWITCH([install],[ |
211 | LT_INIT | 211 | LT_INIT |
212 | GRECS_BUILD_TYPE=install | ||
212 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] | 213 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] |
213 | GRECS_DOCDIR='doc' | 214 | GRECS_DOCDIR='doc' |
214 | GRECS_CHANGELOG= | 215 | GRECS_CHANGELOG= |
@@ -218,18 +219,27 @@ AC_DEFUN([GRECS_SETUP],[ | |||
218 | grecsdir[doc/Makefile]) | 219 | grecsdir[doc/Makefile]) |
219 | ],[shared],[ | 220 | ],[shared],[ |
220 | LT_INIT | 221 | LT_INIT |
222 | GRECS_BUILD_TYPE=shared | ||
221 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] | 223 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.la'] |
222 | GRECS_CHANGELOG='#' | 224 | GRECS_CHANGELOG='#' |
223 | GRECS_README=README.submodule | 225 | GRECS_README=README.submodule |
224 | _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) | 226 | _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) |
225 | AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-shared.in]) | 227 | AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-shared.in]) |
226 | ],[ | 228 | ],[ |
229 | GRECS_BUILD_TYPE=static | ||
227 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.a'] | 230 | GRECS_LDADD=['$(top_builddir)/]grecsdir[src/libgrecs.a'] |
228 | GRECS_CHANGELOG='#' | 231 | GRECS_CHANGELOG='#' |
229 | GRECS_README=README.submodule | 232 | GRECS_README=README.submodule |
230 | _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) | 233 | _GRECS_IF_OPTION_SET([syntax-doc],[GRECS_DISTDOC=doc/grecs-syntax.texi]) |
231 | AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-static.in]) | 234 | AC_CONFIG_FILES(grecsdir[src/Makefile]:grecsdir[src/Make-static.in]) |
232 | ]) | 235 | ]) |
233 | AC_CONFIG_FILES(grecsdir[Makefile] grecsdir[src/grecs.h]:grecsdir[src/grecs.hin]) | 236 | AM_CONDITIONAL([GRECS_COND_BUILD_INSTALL],[test $GRECS_BUILD_TYPE = install]) |
237 | AM_CONDITIONAL([GRECS_COND_BUILD_SHARED],[test $GRECS_BUILD_TYPE = shared]) | ||
238 | AM_CONDITIONAL([GRECS_COND_BUILD_STATIC],[test $GRECS_BUILD_TYPE = static]) | ||
239 | |||
240 | AC_CONFIG_FILES(grecsdir[Makefile] | ||
241 | grecsdir[include/Makefile] | ||
242 | grecsdir[include/grecs/Makefile] | ||
243 | grecsdir[include/grecs/types.h]:grecsdir[include/grecs/types.h.in]) | ||
234 | m4_popdef([grecsdir]) | 244 | m4_popdef([grecsdir]) |
235 | ]) | 245 | ]) |
diff --git a/configure.ac b/configure.ac index b923c9b..6ffa55b 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | AC_PREREQ(2.63) | 17 | AC_PREREQ(2.63) |
18 | AC_INIT([libgrecs], [1.0], [gray+grecs@gnu.org.ua]) | 18 | AC_INIT([libgrecs], [1.0], [gray+grecs@gnu.org.ua]) |
19 | AC_CONFIG_SRCDIR([src/grecs.hin]) | 19 | AC_CONFIG_SRCDIR([src/grecs-gram.y]) |
20 | AC_CONFIG_AUX_DIR([build-aux]) | 20 | AC_CONFIG_AUX_DIR([build-aux]) |
21 | AC_CONFIG_HEADER([config.h]) | 21 | AC_CONFIG_HEADER([config.h]) |
22 | AM_INIT_AUTOMAKE([1.11 gnu tar-ustar dist-xz std-options silent-rules]) | 22 | AM_INIT_AUTOMAKE([1.11 gnu tar-ustar dist-xz std-options silent-rules]) |
diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..21a51e7 --- /dev/null +++ b/include/Makefile.am | |||
@@ -0,0 +1,19 @@ | |||
1 | SUBDIRS = grecs | ||
2 | GRECS_HDR = grecs.h wordsplit.h | ||
3 | |||
4 | if GRECS_COND_BUILD_INSTALL | ||
5 | include_HEADERS = $(GRECS_HDR) | ||
6 | endif | ||
7 | |||
8 | if GRECS_COND_BUILD_SHARED | ||
9 | if GRECS_COND_INSTALLHEADERS | ||
10 | grecsincludedir = @GRECS_INCLUDE_DIR@ | ||
11 | grecsinclude_HEADERS = $(GRECS_HDR) | ||
12 | else | ||
13 | noinst_HEADERS = $(GRECS_HDR) | ||
14 | endif | ||
15 | endif | ||
16 | |||
17 | if GRECS_COND_BUILD_STATIC | ||
18 | noinst_HEADERS = $(GRECS_HDR) | ||
19 | endif | ||
diff --git a/include/grecs.h b/include/grecs.h new file mode 100644 index 0000000..eac11d4 --- /dev/null +++ b/include/grecs.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* grecs - Gray's Extensible Configuration System -*- c -*- | ||
2 | Copyright (C) 2007-2016 Sergey Poznyakoff | ||
3 | |||
4 | Grecs 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 | Grecs 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 Grecs. If not, see <http://www.gnu.org/licenses/>. */ | ||
16 | |||
17 | #ifndef _GRECS_H | ||
18 | #define _GRECS_H | ||
19 | |||
20 | #include <grecs/types.h> | ||
21 | #include <grecs/version.h> | ||
22 | #include <grecs/doc.h> | ||
23 | #include <grecs/error.h> | ||
24 | #include <grecs/format.h> | ||