Commit aec016fb authored by Vivien Kraus's avatar Vivien Kraus
Browse files

Compile the bindings as part of the tests

parent 0b519f34
......@@ -23,9 +23,6 @@ EOF
dnf reinstall -y glibc-common || exit 1
dnf install -y \
gcc \
guile \
libtool-ltdl \
\
mingw64-gcc \
mingw64-nettle \
......@@ -34,8 +31,6 @@ dnf install -y \
mingw64-cairo \
mingw64-gtk3 \
mingw64-hicolor-icon-theme \
mingw64-libffi \
mingw64-libltdl \
\
make \
wget \
......@@ -44,30 +39,8 @@ dnf install -y \
mingw32-nsis.x86_64 \
|| exit 1
dnf install -y $(dnf deplist guile | awk '/provider:/ {print $2}' | sort -u | grep -v 'i686') || exit 1
mkdir -p public || exit 1
echo "Build libunistring"
wget https://ftp.gnu.org/gnu/libunistring/libunistring-0.9.10.tar.gz || exit 1
tar xf libunistring-0.9.10.tar.gz || exit 1
(cd libunistring-0.9.10 && ./configure --help && mingw64-configure && make -j && make -j install) || exit 1
wget https://github.com/ivmai/libatomic_ops/releases/download/v7.6.10/libatomic_ops-7.6.10.tar.gz || exit 1
tar xf libatomic_ops-7.6.10.tar.gz || exit 1
(cd libatomic_ops-7.6.10 && mingw64-configure && make -j && make -j install) || exit 1
echo "Building gc"
wget https://www.hboehm.info/gc/gc_source/gc-8.0.4.tar.gz || exit 1
tar xf gc-8.0.4.tar.gz || exit 1
(cd gc-8.0.4 && mingw64-configure && make -j && make -j install) || exit 1
echo "Build guile"
wget https://ftp.gnu.org/gnu/guile/guile-2.2.6.tar.gz || exit 1
tar xf guile-2.2.6.tar.gz || exit 1
(cd guile-2.2.6 && ./configure && make -j && make -j install && make clean) || exit 1
(cd guile-2.2.6 && mingw64-configure && make -j && make -j install) || exit 1
echo "Build tarot"
VERSION=$(cat dist/version)
......
......@@ -137,12 +137,13 @@ AC_ARG_WITH([static_program_name],
AS_IF([test "x$with_static_program_name" != "xno"], [
CPPFLAGS="$CPPFLAGS -Dprogram_name=tarot_libtarot_program_name"
])
HAVE_GUILE="1"
PKG_CHECK_MODULES([GUILE], [guile-2.2],, [
PKG_CHECK_MODULES([GUILE], [guile-2.0],, [
HAVE_GUILE="0"
HAVE_GUILE="0"
for guile_version in 2.2 2.0
do
AS_IF([test "x$HAVE_GUILE" == x0], [
PKG_CHECK_MODULES([GUILE], [guile-$guile_version], [HAVE_GUILE="1"], [true])
])
])
done
AC_DEFINE_UNQUOTED(HAVE_GUILE, $HAVE_GUILE, [Whether the tarot_guile_init () function works with guile])
AM_CONDITIONAL([HAVE_GUILE], [test "x$HAVE_GUILE" != "x0"])
......
......@@ -15,9 +15,15 @@
AM_CPPFLAGS += -I $(srcdir)/%reldir% -I %reldir%
EXTRA_DIST += %reldir%/test_guile.c
if HAVE_GUILE
src_libtarot_libtarot_la_SOURCES += \
src/libtarot/semantic-api/tarot_guile.c
else
src_libtarot_libtarot_la_SOURCES += %reldir%/tarot_noguile.c
AM_CFLAGS += $(GUILE_CFLAGS)
AM_LIBS += $(GUILE_LIBS)
check_PROGRAMS += %reldir%/test-guile
%canon_reldir%_test_guile_SOURCES = \
src/libtarot/semantic-api/tarot_guile.c \
%reldir%/test_guile.c
%canon_reldir%_test_guile_LDADD = src/libtarot/libtarot.la $(AM_LIBS)
TESTS += %reldir%/test-guile
endif
/* tarot implements the rules of the tarot game
* Copyright (C) 2019 Vivien Kraus
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <tarot.h>
#include <stdio.h>
#include <stdlib.h>
#include <libguile.h>
void tarot_guile_init ();
static void
inner_main (void *data, int argc, char **argv)
{
(void) data;
(void) argc;
(void) argv;
tarot_guile_init ();
}
int
main (int argc, char *argv[])
{
scm_boot_guile (argc, argv, inner_main, NULL);
return EXIT_SUCCESS;
}
......@@ -24,5 +24,5 @@ lib_LTLIBRARIES += %reldir%/libtarot.la
lib/libgnu.la
INDENTED += $(%canon_reldir%_libtarot_la_SOURCES)
AM_CFLAGS += $(NETTLE_CFLAGS) $(XML_CFLAGS) $(GUILE_CFLAGS)
AM_LIBS += $(NETTLE_LIBS) $(XML_LIBS) $(GUILE_LIBS)
AM_CFLAGS += $(NETTLE_CFLAGS) $(XML_CFLAGS)
AM_LIBS += $(NETTLE_LIBS) $(XML_LIBS)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment