diff options
| -rw-r--r-- | .gitignore | 74 | ||||
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | COPYING | 121 | ||||
| -rw-r--r-- | ChangeLog | 0 | ||||
| -rw-r--r-- | Makefile.am | 27 | ||||
| l--------- | NEWS | 1 | ||||
| -rw-r--r-- | NEWS.md | 0 | ||||
| l--------- | README | 1 | ||||
| -rw-r--r-- | README.md | 0 | ||||
| -rw-r--r-- | VERSION | 1 | ||||
| -rw-r--r-- | VERSION_SO | 1 | ||||
| -rwxr-xr-x | autogen.sh | 5 | ||||
| -rw-r--r-- | build/.keep | 0 | ||||
| -rw-r--r-- | configure.ac | 65 | ||||
| -rw-r--r-- | include/Makefile.am | 2 | ||||
| -rw-r--r-- | include/foobar.h | 14 | ||||
| -rw-r--r-- | m4/.gitignore | 2 | ||||
| -rw-r--r-- | make/shared.am | 14 | ||||
| -rw-r--r-- | src/common.c | 10 | ||||
| -rw-r--r-- | src/common.h | 6 | ||||
| -rw-r--r-- | src/lib.c | 12 | ||||
| -rw-r--r-- | src/main.c | 8 | ||||
| -rw-r--r-- | tests/.gitignore | 1 | ||||
| -rw-r--r-- | tests/Makefile.am | 8 | ||||
| -rw-r--r-- | tests/test_foobar.c | 15 |
25 files changed, 389 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0087de4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +################################ +# A place to build out-of-tree # +################################ + +/build/* +!/build/.keep + +########################## +# Common generated files # +########################## + +*.a +*.c.d +*.core +*.la +*.lo +*.o + +.deps/ +.dirstamp +.libs/ + +############################ +# Always generated in root # +############################ + +/INSTALL +/aclocal.m4 +/ar-lib +/autom4te.cache/ +/autoscan.log +/compile +/config.guess +/config.h.in +/config.h.in~ +/config.sub +/configure +/configure.ac~ +/configure~ +/depcomp +/install-sh +/ltmain.sh +/missing +/test-driver + +# Custom + +/Makefile.in +/include/Makefile.in +/tests/Makefile.in + +########################################### +# Only generated when configuring in root # +########################################### + +/config.h +/config.log +/config.status +/libtool +/stamp-h1 + +# Test subdirs + +/tests/test-suite.log +/tests/test*.log +/tests/test*.trs + +# Custom + +/foobar + +/Makefile +/include/Makefile +/tests/Makefile @@ -0,0 +1 @@ +foo <foo@foobar.org> @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..9d501b7 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,27 @@ +include $(top_srcdir)/make/shared.am + +ACLOCAL_AMFLAGS = -I m4 --install +EXTRA_DIST = autogen.sh + +SUBDIRS = include +SUBDIRS += . + +if ENABLE_CHECKS +SUBDIRS += tests +endif + +bin_PROGRAMS = foobar +lib_LTLIBRARIES = libfoobar.la +noinst_LIBRARIES = libfoobar.a + +foobar_LDADD = libfoobar.a +foobar_SOURCES = \ + src/main.c + +libfoobar_la_LIBADD = libfoobar.a +libfoobar_la_SOURCES = \ + src/lib.c + +libfoobar_a_SOURCES = \ + src/common.h \ + src/common.c @@ -0,0 +1 @@ +NEWS.md
\ No newline at end of file @@ -0,0 +1 @@ +README.md
\ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +0.0.0 diff --git a/VERSION_SO b/VERSION_SO new file mode 100644 index 0000000..f730b58 --- /dev/null +++ b/VERSION_SO @@ -0,0 +1 @@ +0:0:0 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..b273a20 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -eux + +exec autoreconf -isf -Wall diff --git a/build/.keep b/build/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/build/.keep diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..5a49e23 --- /dev/null +++ b/configure.ac @@ -0,0 +1,65 @@ +############################ +# Specify program versions # +############################ + +AC_PREREQ([2.70]) +LT_PREREQ([2.4.2]) + + + +################################## +# Initialize Autoconf & Automake # +################################## + +AC_INIT([foobar], + m4_normalize(m4_include([VERSION])), + [mailto:user@foobar.org], + [foobar], + [https://foobar.org]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_SRCDIR([src/main.c]) +AC_CONFIG_FILES([ + Makefile + include/Makefile + tests/Makefile +]) + +AM_INIT_AUTOMAKE([1.16 subdir-objects]) + +AC_SUBST([PACKAGE_DESCR], ['Foo Bar']) +AC_SUBST([PACKAGE_VERSION_SO], m4_normalize(m4_include([VERSION_SO]))) + + + +################# +# Customization # +################# + +AC_LANG([C]) + +AC_PROG_CC + +AC_CHECK_HEADER_STDBOOL +AS_IF([test "$ac_cv_header_stdbool_h" != yes], AC_MSG_ERROR([standard headers])) + +AC_ARG_ENABLE([werror], AS_HELP_STRING([--disable-werror], [disable -Werror])) +AS_IF([test "$enable_werror" != no], [enable_werror=yes], [enable_werror=no]) +AM_CONDITIONAL([ENABLE_WERROR], [test "$enable_werror" = yes]) + +AC_ARG_ENABLE([checks], AS_HELP_STRING([--enable-checks], [enable checks])) +AS_IF([test "$enable_checks" != yes], [enable_werror=no], [enable_werror=yes]) +AM_CONDITIONAL([ENABLE_CHECKS], [test "$enable_checks" = yes]) + + + +########## +# Finish # +########## + +LT_INIT +AC_OUTPUT diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..fe70870 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +nobase_include_HEADERS = \ + foobar.h diff --git a/include/foobar.h b/include/foobar.h new file mode 100644 index 0000000..f9e1967 --- /dev/null +++ b/include/foobar.h @@ -0,0 +1,14 @@ +#ifndef _FOOBAR_H +#define _FOOBAR_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +int foobar(int a, int b); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..a68d087 --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,2 @@ +/* +!/.gitignore diff --git a/make/shared.am b/make/shared.am new file mode 100644 index 0000000..1fce541 --- /dev/null +++ b/make/shared.am @@ -0,0 +1,14 @@ +# vim: set syntax=automake: + +AM_CFLAGS = \ + -std=c99 \ + -pedantic \ + -Wall \ + -Wextra \ + -D_POSIX_C_SOURCE=200809L \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include + +if ENABLE_WERROR +AM_CFLAGS += -Werror +endif diff --git a/src/common.c b/src/common.c new file mode 100644 index 0000000..0a5c687 --- /dev/null +++ b/src/common.c @@ -0,0 +1,10 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "common.h" + +int foobar_internal(const int a, const int b) +{ + return a + b; +} diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..6c1d0a4 --- /dev/null +++ b/src/common.h @@ -0,0 +1,6 @@ +#ifndef _FOOBAR_SRC_COMMON_H +#define _FOOBAR_SRC_COMMON_H + +int foobar_internal(int a, int b); + +#endif diff --git a/src/lib.c b/src/lib.c new file mode 100644 index 0000000..959b5d5 --- /dev/null +++ b/src/lib.c @@ -0,0 +1,12 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <foobar.h> + +#include "common.h" + +int foobar(const int a, const int b) +{ + return foobar_internal(a, b); +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..c12bda8 --- /dev/null +++ b/src/main.c @@ -0,0 +1,8 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +int main(void) +{ + return 0; +} diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..8430234 --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +/test_foobar diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..227a1a2 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,8 @@ +include $(top_srcdir)/make/shared.am + +TESTS = +noinst_PROGRAMS = $(TESTS) + +TESTS += test_foobar +test_foobar_LDADD = $(top_builddir)/libfoobar.a +test_foobar_SOURCES = test_foobar.c diff --git a/tests/test_foobar.c b/tests/test_foobar.c new file mode 100644 index 0000000..bcde749 --- /dev/null +++ b/tests/test_foobar.c @@ -0,0 +1,15 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#undef NDEBUG + +#include <assert.h> + +#include "../src/common.h" + +int main(void) +{ + assert(foobar_internal(2, 3) == 5); + return 0; +} |
