From 811d3046e1d4498ff19d1007a0cc55b7ea5900ae Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Fri, 18 Mar 2016 23:36:07 +0100 Subject: [PATCH] rename to "[lib]capnp_c", use lib/ subdir --- Makefile.am | 23 ++++++++++++----------- compiler/c++.capnp.h | 4 ++-- compiler/capnpc-c.c | 4 ++-- compiler/schema.capnp.h | 4 ++-- compiler/str.h | 2 +- compiler/test.capnp.h | 4 ++-- configure.ac | 2 +- capn-list.inc => lib/capn-list.inc | 0 capn-malloc.c => lib/capn-malloc.c | 2 +- capn-stream.c => lib/capn-stream.c | 2 +- capn.c => lib/capn.c | 2 +- capn.h => lib/capnp_c.h | 6 +++--- 12 files changed, 28 insertions(+), 27 deletions(-) rename capn-list.inc => lib/capn-list.inc (100%) rename capn-malloc.c => lib/capn-malloc.c (99%) rename capn-stream.c => lib/capn-stream.c (99%) rename capn.c => lib/capn.c (99%) rename capn.h => lib/capnp_c.h (99%) diff --git a/Makefile.am b/Makefile.am index 2df7611..493cbe5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,25 +9,26 @@ noinst_HEADERS = include_HEADERS = +AM_CPPFLAGS = -I${srcdir}/lib -lib_LTLIBRARIES += libcapn.la -libcapn_la_LDFLAGS = -version-info 1:0:0 -libcapn_la_SOURCES = \ - capn-malloc.c \ - capn-stream.c \ - capn.c +lib_LTLIBRARIES += libcapnp_c.la +libcapnp_c_la_LDFLAGS = -version-info 0:0:0 +libcapnp_c_la_SOURCES = \ + lib/capn-malloc.c \ + lib/capn-stream.c \ + lib/capn.c +EXTRA_DIST += \ + lib/capn-list.inc bin_PROGRAMS += capnpc-c capnpc_c_SOURCES = \ compiler/capnpc-c.c \ compiler/schema.capnp.c \ compiler/str.c -capnpc_c_LDADD = libcapn.la +capnpc_c_LDADD = libcapnp_c.la include_HEADERS += \ - capn.h + lib/capnp_c.h -EXTRA_DIST += \ - capn-list.inc noinst_HEADERS += \ compiler/str.h \ compiler/schema.capnp.h \ @@ -45,6 +46,6 @@ capn_test_SOURCES = \ compiler/schema-test.cpp \ compiler/schema.capnp.c capn_test_CFLAGS = $(GTEST_CFLAGS) -capn_test_LDADD = libcapn.la $(GTEST_LDFLAGS) +capn_test_LDADD = libcapnp_c.la $(GTEST_LDFLAGS) TESTS = capn-test endif diff --git a/compiler/c++.capnp.h b/compiler/c++.capnp.h index babead7..afe1b1c 100644 --- a/compiler/c++.capnp.h +++ b/compiler/c++.capnp.h @@ -1,10 +1,10 @@ #ifndef CAPN_BDF87D7BB8304E81 #define CAPN_BDF87D7BB8304E81 /* AUTO GENERATED - DO NOT EDIT */ -#include +#include #if CAPN_VERSION != 1 -#error "version mismatch between capn.h and generated code" +#error "version mismatch between capnp_c.h and generated code" #endif diff --git a/compiler/capnpc-c.c b/compiler/capnpc-c.c index 0336712..3ec7f2c 100644 --- a/compiler/capnpc-c.c +++ b/compiler/capnpc-c.c @@ -1185,9 +1185,9 @@ int main() { str_addf(&HDR, "#ifndef CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id); str_addf(&HDR, "#define CAPN_%X%X\n", (uint32_t) (file_node->n.id >> 32), (uint32_t) file_node->n.id); str_addf(&HDR, "/* AUTO GENERATED - DO NOT EDIT */\n"); - str_addf(&HDR, "#include \n\n"); + str_addf(&HDR, "#include \n\n"); str_addf(&HDR, "#if CAPN_VERSION != 1\n"); - str_addf(&HDR, "#error \"version mismatch between capn.h and generated code\"\n"); + str_addf(&HDR, "#error \"version mismatch between capnp_c.h and generated code\"\n"); str_addf(&HDR, "#endif\n\n"); for (j = 0; j < capn_len(file_req.imports); j++) { diff --git a/compiler/schema.capnp.h b/compiler/schema.capnp.h index e4f53db..f23a82b 100644 --- a/compiler/schema.capnp.h +++ b/compiler/schema.capnp.h @@ -1,10 +1,10 @@ #ifndef CAPN_A93FC509624C72D9 #define CAPN_A93FC509624C72D9 /* AUTO GENERATED - DO NOT EDIT */ -#include +#include #if CAPN_VERSION != 1 -#error "version mismatch between capn.h and generated code" +#error "version mismatch between capnp_c.h and generated code" #endif #include "c++.capnp.h" diff --git a/compiler/str.h b/compiler/str.h index fdd6523..540993e 100644 --- a/compiler/str.h +++ b/compiler/str.h @@ -7,7 +7,7 @@ * of the MIT license. See the LICENSE file for details. */ -#include +#include #include struct str { diff --git a/compiler/test.capnp.h b/compiler/test.capnp.h index 98ea44e..26dd224 100644 --- a/compiler/test.capnp.h +++ b/compiler/test.capnp.h @@ -1,10 +1,10 @@ #ifndef CAPN_D508EEBDC2DC42B8 #define CAPN_D508EEBDC2DC42B8 /* AUTO GENERATED - DO NOT EDIT */ -#include +#include #if CAPN_VERSION != 1 -#error "version mismatch between capn.h and generated code" +#error "version mismatch between capnp_c.h and generated code" #endif #include "c++.capnp.h" diff --git a/configure.ac b/configure.ac index f6e62cc..b28fb69 100755 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_PREREQ(2.60) AC_INIT(c-capnproto, 0.1, []) -AC_CONFIG_SRCDIR(capn.h) +AC_CONFIG_SRCDIR(lib/capnp_c.h) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([ac]) diff --git a/capn-list.inc b/lib/capn-list.inc similarity index 100% rename from capn-list.inc rename to lib/capn-list.inc diff --git a/capn-malloc.c b/lib/capn-malloc.c similarity index 99% rename from capn-malloc.c rename to lib/capn-malloc.c index 91dfe14..3d8093e 100644 --- a/capn-malloc.c +++ b/lib/capn-malloc.c @@ -8,7 +8,7 @@ * of the MIT license. See the LICENSE file for details. */ -#include "capn.h" +#include "capnp_c.h" #include #include #include diff --git a/capn-stream.c b/lib/capn-stream.c similarity index 99% rename from capn-stream.c rename to lib/capn-stream.c index 061a5f5..577129f 100644 --- a/capn-stream.c +++ b/lib/capn-stream.c @@ -7,7 +7,7 @@ * of the MIT license. See the LICENSE file for details. */ -#include "capn.h" +#include "capnp_c.h" #include #ifndef min diff --git a/capn.c b/lib/capn.c similarity index 99% rename from capn.c rename to lib/capn.c index a2fc12f..0612a54 100644 --- a/capn.c +++ b/lib/capn.c @@ -7,7 +7,7 @@ * of the MIT license. See the LICENSE file for details. */ -#include "capn.h" +#include "capnp_c.h" #include #include diff --git a/capn.h b/lib/capnp_c.h similarity index 99% rename from capn.h rename to lib/capnp_c.h index 308311f..30d0b21 100644 --- a/capn.h +++ b/lib/capnp_c.h @@ -1,5 +1,5 @@ /* vim: set sw=8 ts=8 sts=8 noet: */ -/* capn.h +/* capnp_c.h * * Copyright (C) 2013 James McKaskill * Copyright (C) 2014 Steve Dee @@ -8,8 +8,8 @@ * of the MIT license. See the LICENSE file for details. */ -#ifndef CAPN_H -#define CAPN_H +#ifndef CAPNP_C_H +#define CAPNP_C_H #include #include