commit 4658be866bf2c7d9349b972160d8c5b59b478a10 Author: Alex Kotov Date: Sat Dec 3 19:00:13 2022 +0400 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1441d4d --- /dev/null +++ b/.gitignore @@ -0,0 +1,59 @@ +########################## +# Common generated files # +########################## + +*.a +*.c.d +*.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 + +/m4/* +!/m4/.keep + +# Custom + +/Makefile.in +/include/Makefile.in + +########################################### +# Only generated when configuring in root # +########################################### + +/config.h +/config.log +/config.status +/libtool +/stamp-h1 + +# Custom + +/Makefile +/include/Makefile diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..3a0bbea --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Alex Kotov diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..8793f33 --- /dev/null +++ b/COPYING @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-2022 Alex Kotov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..8092ec0 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ +include $(top_srcdir)/make/shared.am + +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = autogen.sh + +SUBDIRS = include + +lib_LTLIBRARIES = libdrivers.la + +libdrivers_la_SOURCES = \ + src/foobar.c diff --git a/NEWS b/NEWS new file mode 120000 index 0000000..7b97b99 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ +NEWS.md \ No newline at end of file diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..e69de29 diff --git a/README b/README new file mode 120000 index 0000000..42061c0 --- /dev/null +++ b/README @@ -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..dccc95c --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +Drivers +======= + + + +Table of contents +----------------- + +* [Overview](#drivers) +* [Table of contents](#table-of-contents) diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..77d6f4c --- /dev/null +++ b/VERSION @@ -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/configure.ac b/configure.ac new file mode 100644 index 0000000..d42b770 --- /dev/null +++ b/configure.ac @@ -0,0 +1,63 @@ +############################ +# Specify program versions # +############################ + +AC_PREREQ([2.68]) +LT_PREREQ([2.4.6]) + + + +################################## +# Initialize Autoconf & Automake # +################################## + +AC_INIT([drivers], + m4_normalize(m4_include([VERSION])), + [https://github.com/tailix/drivers/issues], + [drivers], + [https://github.com/tailix/drivers]) + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AC_CONFIG_MACRO_DIRS([m4]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_SRCDIR([src/foobar.c]) +AC_CONFIG_FILES([ + Makefile + include/Makefile +]) + +AM_INIT_AUTOMAKE([1.16 subdir-objects]) + + + +############## +# Run checks # +############## + +AC_LANG([C]) + +AM_PROG_AR +AM_PROG_AS +AC_PROG_CC +AC_PROG_CC_C99 +AC_C_INLINE +AC_CHECK_HEADER_STDBOOL +AC_CHECK_HEADERS([stdarg.h stddef.h stdint.h]) + + + +###################### +# Initialize Libtool # +###################### + +LT_INIT([disable-shared]) + + + +########## +# Finish # +########## + +AC_OUTPUT diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..316fd0f --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +nobase_include_HEADERS = \ + drivers.h diff --git a/include/drivers.h b/include/drivers.h new file mode 100644 index 0000000..c0f6c88 --- /dev/null +++ b/include/drivers.h @@ -0,0 +1,14 @@ +#ifndef DRIVERS_INCLUDED +#define DRIVERS_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +int drivers_foobar(int a, int b); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/m4/.keep b/m4/.keep new file mode 100644 index 0000000..e69de29 diff --git a/make/shared.am b/make/shared.am new file mode 100644 index 0000000..0b5a04e --- /dev/null +++ b/make/shared.am @@ -0,0 +1,10 @@ +# vim: set syntax=automake: + +AM_CFLAGS = \ + -std=c99 \ + -pedantic \ + -Wall \ + -Wextra \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -D_POSIX_C_SOURCE=200809L diff --git a/src/foobar.c b/src/foobar.c new file mode 100644 index 0000000..52f41f3 --- /dev/null +++ b/src/foobar.c @@ -0,0 +1,10 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +int drivers_foobar(const int a, const int b) +{ + return a + b; +}