aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gediminas Jakutis <gediminas@varciai.lt> 2017-06-16 11:15:50 +0300
committerGravatar Gediminas Jakutis <gediminas@varciai.lt> 2017-06-16 11:15:50 +0300
commit2b437de5449558dd44b8966faae9b35d9bca0f88 (patch)
treef8488991db453baddd3f0fa34cfc06ce9d23d428
parentce9c8a885fc3bd828565094b06b4d201cd4f2790 (diff)
parent1cd2cd0ac5fe6ad74e9ef0a4fbf62b74aedbef74 (diff)
downloadlibrin-2b437de5449558dd44b8966faae9b35d9bca0f88.tar.gz
librin-2b437de5449558dd44b8966faae9b35d9bca0f88.tar.bz2
librin-2b437de5449558dd44b8966faae9b35d9bca0f88.zip
Merge branch 'meson'
-rw-r--r--INSTALL8
-rw-r--r--Makefile.am19
-rw-r--r--configure.ac51
-rw-r--r--include/meson.build1
-rw-r--r--include/rin/meson.build9
-rw-r--r--meson.build35
-rw-r--r--meson_options.txt6
-rw-r--r--src/Makefile.am45
-rw-r--r--src/diagnostic/Makefile.am27
-rw-r--r--src/diagnostic/meson.build10
-rw-r--r--src/float/Makefile.am26
-rw-r--r--src/float/meson.build10
-rw-r--r--src/gpio/Makefile.am26
-rw-r--r--src/gpio/meson.build10
-rw-r--r--src/meson.build6
-rw-r--r--test/Makefile.am72
-rw-r--r--test/meson.build8
17 files changed, 99 insertions, 270 deletions
diff --git a/INSTALL b/INSTALL
index a9003fd..33fcd47 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
Installation Instructions
=========================
-1. Creaate configure scripts with 'autoreconf -iv'
-2. Run './configure'
-3. Run 'make -jN' where 'N' is number of CPU cores + 1
-4. run 'make install'
+1. Create a build directory by running 'meson [your build directory]'
+2. Go to the aforementioned build directory
+3. Run 'ninja'
+4. Run 'ninja install' (might need to be root)
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index 1c226f6..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2015 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-SUBDIRS = src test
-
-ACLOCAL_AMFLAGS = -I m4
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index cb40a30..0000000
--- a/configure.ac
+++ /dev/null
@@ -1,51 +0,0 @@
-dnl Copyright (C) 2015-2017 Gediminas Jakutis
-dnl
-dnl This configure.ac is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; version 2.1
-dnl of the License.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-# Process this file with autoconf to produce a configure script.
-
-AC_PREREQ([2.13])
-
-m4_define(LIBRIN_VERSION, m4_normalize(m4_include(VERSION)))
-AC_INIT([librin], [LIBRIN_VERSION], [gediminas@varciai.lt])
-AC_CONFIG_SRCDIR([src/float/float.c])
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_MACRO_DIRS([m4])
-
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-AM_INIT_AUTOMAKE
-LT_INIT
-
-# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdio.h stdint.h stdlib.h string.h sys/types.h sys/stat.h time,h unistd.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_SIZE_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-
-# Checks for library functions.
-
-AC_CONFIG_FILES([Makefile
- src/Makefile
- src/diagnostic/Makefile
- src/float/Makefile
- src/gpio/Makefile
- test/Makefile])
-AC_OUTPUT
diff --git a/include/meson.build b/include/meson.build
new file mode 100644
index 0000000..664b65d
--- /dev/null
+++ b/include/meson.build
@@ -0,0 +1 @@
+subdir('rin')
diff --git a/include/rin/meson.build b/include/rin/meson.build
new file mode 100644
index 0000000..cf97cd6
--- /dev/null
+++ b/include/rin/meson.build
@@ -0,0 +1,9 @@
+headers = [
+ 'definitions.h',
+ 'diagnostic.h',
+ 'float.h',
+ 'float_types.h',
+ 'gpio.h',
+]
+
+install_headers(headers , subdir : 'rin')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..50073cf
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,35 @@
+project('librin', 'c',
+ license : 'LGPL2.1',
+ default_options : 'c_std=gnu89')
+
+inc = include_directories('include')
+
+if get_option('gpio')
+ thread_dep = dependency('threads')
+else
+ thread_dep = []
+endif
+
+deps = thread_dep
+
+subdir('include')
+subdir('src')
+
+if ((not get_option('static')) and (not get_option('shared')))
+ librin = library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
+endif
+
+if get_option('static')
+ librin = static_library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
+endif
+
+if get_option('shared')
+ librin = shared_library('rin', sources, version : '0.0.0', include_directories : inc, install : true, dependencies : deps)
+endif
+
+
+if get_option('tests')
+ subdir('test')
+ test_e = executable('test executable', test_sources, include_directories : inc, link_with : librin)
+ test('librin test', test_e)
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..279996a
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,6 @@
+option('static', type : 'boolean', value : false, description : 'Enable building a static library')
+option('shared', type : 'boolean', value : false, description : 'Enable building a dynamic library')
+option('tests', type : 'boolean', value : false, description : 'Enable building and running tests')
+option('float', type : 'boolean', value : true, description : 'Enable building the floating point module')
+option('gpio', type : 'boolean', value : true, description : 'Enable building the gpio module')
+option('diagnostic', type : 'boolean', value : true, description : 'Enable building the diagnostics module')
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index 2c819b6..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright (C) 2015-2017 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-SUBDIRS = float diagnostic gpio
-
-AM_CFLAGS = \
- -I$(top_srcdir)/include/ \
- -Wall \
- -Wextra
-
-RIN_VER_MAJOR = 0
-RIN_VER_MINOR = 0
-RIN_VER_PATCH = 0
-
-lib_LTLIBRARIES = librin.la
-
-librin_la_LDFLAGS = -version-info $(RIN_VER_MAJOR):$(RIN_VER_MINOR):$(RIN_VER_PATCH)
-
-librin_la_SOURCES =
-
-librin_la_LIBADD = \
- float/librin_float.la \
- diagnostic/librin_diagnostic.la \
- gpio/librin_gpio.la
-
-librin_includedir = $(includedir)/rin
-librin_include_HEADERS = \
- $(top_srcdir)/include/rin/float.h \
- $(top_srcdir)/include/rin/float_types.h \
- $(top_srcdir)/include/rin/definitions.h \
- $(top_srcdir)/include/rin/diagnostic.h \
- $(top_srcdir)/include/rin/gpio.h
diff --git a/src/diagnostic/Makefile.am b/src/diagnostic/Makefile.am
deleted file mode 100644
index 8787230..0000000
--- a/src/diagnostic/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-
-# Copyright (C) 2015 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-AM_CFLAGS = \
- -I$(top_srcdir)/include/ \
- -Wall \
- -Wextra
-
-noinst_LTLIBRARIES = librin_diagnostic.la
-
-librin_diagnostic_la_SOURCES = \
- diagnostic.c \
- diagnostic_private.h
diff --git a/src/diagnostic/meson.build b/src/diagnostic/meson.build
new file mode 100644
index 0000000..5f066c1
--- /dev/null
+++ b/src/diagnostic/meson.build
@@ -0,0 +1,10 @@
+if get_option('diagnostic')
+ diagnostic_filenames = [
+ 'diagnostic.c',
+ 'diagnostic_private.h',
+ ]
+else
+ diagnostic_filenames = []
+endif
+
+diagnostic_sources = files(diagnostic_filenames)
diff --git a/src/float/Makefile.am b/src/float/Makefile.am
deleted file mode 100644
index d8d2675..0000000
--- a/src/float/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2015 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-AM_CFLAGS = \
- -I$(top_srcdir)/include/ \
- -Wall \
- -Wextra
-
-noinst_LTLIBRARIES = librin_float.la
-
-librin_float_la_SOURCES = \
- float.c \
- float_private.h
diff --git a/src/float/meson.build b/src/float/meson.build
new file mode 100644
index 0000000..129053e
--- /dev/null
+++ b/src/float/meson.build
@@ -0,0 +1,10 @@
+if get_option('float')
+ float_filenames = [
+ 'float.c',
+ 'float_private.h',
+ ]
+else
+ float_filenames = []
+endif
+
+float_sources = files(float_filenames)
diff --git a/src/gpio/Makefile.am b/src/gpio/Makefile.am
deleted file mode 100644
index e009cab..0000000
--- a/src/gpio/Makefile.am
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2016 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-AM_CFLAGS = \
- -I$(top_srcdir)/include/ \
- -Wall \
- -Wextra
-
-noinst_LTLIBRARIES = librin_gpio.la
-
-librin_gpio_la_SOURCES = \
- gpio.c \
- gpio_private.h
diff --git a/src/gpio/meson.build b/src/gpio/meson.build
new file mode 100644
index 0000000..82887cb
--- /dev/null
+++ b/src/gpio/meson.build
@@ -0,0 +1,10 @@
+if get_option('gpio')
+ gpio_filenames = [
+ 'gpio.c',
+ 'gpio_private.h',
+ ]
+else
+ gpio_filenames = []
+endif
+
+gpio_sources = files(gpio_filenames)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..1d98b67
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,6 @@
+subdir('float')
+subdir('gpio')
+subdir('diagnostic')
+
+sources = [float_sources, gpio_sources, diagnostic_sources]
+
diff --git a/test/Makefile.am b/test/Makefile.am
deleted file mode 100644
index 65e6c2c..0000000
--- a/test/Makefile.am
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright (C) 2015 Gediminas Jakutis
-#
-# This Makefile.am is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; version 2.1
-# of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-
-AM_CFLAGS = \
- -I$(top_srcdir)/include/ \
- -Wall \
- -Wextra
-
-check_PROGRAMS = test
-check_LTLIBRARIES = \
- libtest.la \
- libfloat_test.la \
- libdiagnostic_test.la
-
-# test program
-test_LDADD = \
- libtest.la \
- libfloat_test.la \
- libdiagnostic_test.la
-
-test_SOURCES = \
- main.c \
- test.h \
- float_test.h \
- diagnostic_test.h
-
-# test lib
-libtest_la_SOURCES = \
- test.c \
- test.h
-
-# float module test
-libfloat_test_la_SOURCES = \
- float.c \
- float_test.h \
- float_test_private.h \
- test.h
-
-libfloat_test_la_LIBADD = \
- libtest.la \
- $(top_srcdir)/src/librin.la
-
-# diagnostic module test
-libdiagnostic_test_la_SOURCES = \
- diagnostic.c \
- diagnostic_test.h \
- diagnostic_test_private.h \
- test.h
-
-libdiagnostic_test_la_LIBADD = \
- libtest.la \
- $(top_srcdir)/src/librin.la
-
-noinst_HEADERS = \
- test.h \
- float_test.h \
- float_test_private.h \
- diagnostic_test.h \
- diagnostic_test_private.h
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..70dfcf9
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,8 @@
+test_filenames = [
+ 'main.c',
+ 'test.c',
+ 'float.c',
+ 'diagnostic.c',
+ ]
+
+test_sources = files(test_filenames)