Made criterion a shared library

This commit is contained in:
Snaipe 2015-05-03 23:24:29 +02:00
commit 1b635dccdc
8 changed files with 32 additions and 17 deletions

20
.ci/install-libcsptr.sh Executable file
View file

@ -0,0 +1,20 @@
#!/bin/bash
repo="https://github.com/Snaipe/libcsptr.git"
tag="v2.0.2"
mkdir dependencies
git clone --branch ${tag} --depth 1 ${repo} dependencies/libcsptr &&
(
cd dependencies/libcsptr &&
./autogen.sh &&
./configure "$@" &&
make &&
{
if command -v sudo; then
sudo make install
else
make install
fi
}
)
rm -Rf dependencies

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "dependencies/csptr"]
path = dependencies/csptr
url = https://github.com/Snaipe/c-smart-pointers.git

View file

@ -7,6 +7,7 @@ before_install:
- sudo apt-get -qq install -y check gcc-4.9 gettext autopoint
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 90
- sudo pip install cpp-coveralls
- .ci/install-libcsptr.sh --prefix=/usr
script:
- ./autogen.sh && ./configure --enable-gcov CFLAGS="-g -O0" && make && make -C samples check
after_success:

View file

@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -DLOCALEDIR='"$(localedir)"'
SUBDIRS = po dependencies/csptr samples
SUBDIRS = po samples
lib_LTLIBRARIES = libcriterion.la
@ -12,13 +12,9 @@ libcriterion_la_CFLAGS = \
-std=gnu11 \
-I$(top_srcdir)/src/ \
-I$(top_srcdir)/include/ \
-I$(top_srcdir)/dependencies/csptr/include/ \
$(COVERAGE_CFLAGS)
libcriterion_la_LDFLAGS = $(COVERAGE_LDFLAGS) -version-info 1:0:0
# dirty but unless someone has a better alternative...
libcriterion_la_LIBADD = dependencies/csptr/src/libcsptr_la-*.lo
libcriterion_la_LDFLAGS = $(COVERAGE_LDFLAGS) -no-undefined -version-info 1:0:0
EXTRA_DIST = config.rpath LICENSE

View file

@ -31,13 +31,12 @@ the user would have with other frameworks:
reported and tested.
* [x] Progress and statistics can be followed in real time with report hooks.
* [x] TAP output format can be enabled with an option.
* [x] Runs on Linux, FreeBSD, Mac OS X, and Windows (Compiles only with MinGW or Cygwin).
* [x] Runs on Linux, FreeBSD, and Mac OS X (Windows is currenly not completely supported).
## Downloads
* [Linux (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v1.2.0/criterion-1.2.0-linux-x86_64.tar.bz2)
* [OS X (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v1.2.0/criterion-1.2.0-osx-x86_64.tar.bz2)
* [Windows (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v1.2.0/criterion-1.2.0-win-x86_64.tar.bz2)
* [FreeBSD (x86_64)](https://github.com/Snaipe/Criterion/releases/download/v1.2.0/criterion-1.2.0-freebsd-x86_64.tar.bz2)
If you have a different platform, you can still [build the library from source](http://criterion.readthedocs.org/en/latest/setup.html#installation)
@ -99,8 +98,8 @@ A. I worked with CUnit and Check, and I must say that they do their job
**Q. Where has this been tested?**
A. Currently, on Linux 2.6.32 and Linux 3.15.7, although it should work on
most \*nix systems; Mac OS X Yosemite 10.10, FreeBSD 10.0, and finally
Windows 7 (with the MinGW and Cygwin ports of GCC).
most \*nix systems; Mac OS X Yosemite 10.10, and FreeBSD 10.0.
Windows is currently not supported, but it being worked on.
[online-docs]: http://criterion.readthedocs.org/
[pdf-docs]: http://readthedocs.org/projects/criterion/downloads/pdf/latest/

View file

@ -53,6 +53,7 @@ configuration: Release
install:
- 'set GCOV_PREFIX=%APPVEYOR_BUILD_FOLDER%'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; .ci/install-libcsptr.sh --prefix=/usr/i686-w64-mingw32 --host i686-w64-mingw32"'
- "%CYG_BASH% -lc 'cd $APPVEYOR_BUILD_FOLDER; ./autogen.sh'"
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./configure CC=i686-w64-mingw32-gcc CFLAGS=\"-g -O0\" --enable-gcov"'

View file

@ -7,7 +7,7 @@ LT_PREREQ([2.2.4])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip foreign subdir-objects parallel-tests color-tests])
LT_INIT([disable-shared])
LT_INIT([disable-static])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CC
@ -20,6 +20,10 @@ AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_SUBST([LIBTOOL_DEPS])
AC_CHECK_LIB([csptr], [smalloc], [], [AC_MSG_ERROR([Could not find libcsptr dependency. \
Please go to https://github.com/Snaipe/c-smart-pointers.git \
and follow the installation instructions.])])
AC_FUNC_FNMATCH
enable_rt_tests="no"
@ -43,6 +47,4 @@ AC_ARG_ENABLE([gcov],
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([Makefile samples/Makefile po/Makefile.in])
AC_CONFIG_SUBDIRS([dependencies/csptr])
AC_OUTPUT

1
dependencies/csptr vendored

@ -1 +0,0 @@
Subproject commit 4f3e63aca586939ed734f4e76c4f7f7f8c07d247