mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
1. Tell the engine to look in the build dir for the backend modules Guile compilation loads the engine libraries for some guile modules. This triggers the engine initialization code which tries to load the xml backend module and optionally the dbi module as well. By default it looks for these modules in the installed directory but during build they are not installed yet, so use a few environment variables to tell the engine to look in the build dir instead. 2. Wait for the c library to be linked before attempting to compile the guile files. Some guile files need the library to be available. Note that neither fix is necessary for all directories that has scheme files to compile. For consistency between makefiles, I have chosen to add them to all, which won't hurt.
129 lines
3.0 KiB
Makefile
129 lines
3.0 KiB
Makefile
noinst_LTLIBRARIES = libtest-core.la
|
|
|
|
SWIG_FILES = \
|
|
unittest-support.i
|
|
|
|
libtest_core_la_SOURCES = \
|
|
test-stuff.c \
|
|
unittest-support.c
|
|
|
|
libtest_core_la_LIBADD = \
|
|
${top_builddir}/src/libqof/qof/libgnc-qof.la \
|
|
${GLIB_LIBS}
|
|
|
|
noinst_HEADERS = \
|
|
test-stuff.h \
|
|
unittest-support.h
|
|
|
|
libtest_core_la_CPPFLAGS = \
|
|
-I${top_srcdir}/src \
|
|
-I${top_srcdir}/src/libqof/qof \
|
|
${GLIB_CFLAGS}
|
|
|
|
libtest_core_la_LDFLAGS = \
|
|
-rpath ${exec-prefix}/lib
|
|
|
|
if BUILDING_FROM_SCM
|
|
swig-unittest-support-guile.c: unittest-support.i $(top_srcdir)/src/base-typemaps.i
|
|
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
|
|
-I${top_srcdir}/src \
|
|
${AM_CPPFLAGS} -o $@ $<
|
|
if ! OS_WIN32
|
|
if ! SWIG_DIST_FAIL
|
|
if ! `grep "define scm_from_utf8_string" $@ > /dev/null 2>&1`; then \
|
|
patch $@ $(top_srcdir)/src/swig-utf8.patch; \
|
|
fi
|
|
endif
|
|
endif
|
|
|
|
swig-unittest-support-python.c: unittest-support.i $(top_srcdir)/src/base-typemaps.i
|
|
$(SWIG) -python -Wall -Werror $(SWIG_ARGS) \
|
|
-I${top_srcdir}/src \
|
|
${AM_CPPFLAGS} -o $@ $<
|
|
|
|
unittest-support.py: swig-unittest-support-python.c ${SWIG_FILES}
|
|
endif
|
|
noinst_LTLIBRARIES += libtest-core-guile.la
|
|
libtest_core_guile_la_SOURCES = swig-unittest-support-guile.c
|
|
libtest_core_guile_la_LIBADD = \
|
|
${GUILE_LIBS} \
|
|
${GLIB_LIBS} \
|
|
libtest-core.la
|
|
|
|
libtest_core_guile_la_CFLAGS = \
|
|
${libtest_core_la_CPPFLAGS} \
|
|
${GUILE_CFLAGS}
|
|
|
|
libtest_core_guile_la_LDFLAGS = \
|
|
-rpath ${exec-prefix}/lib
|
|
|
|
if WITH_PYTHON
|
|
|
|
noinst_LTLIBRARIES += _unittest_support.la
|
|
|
|
_unittest_support_la_SOURCES = \
|
|
swig-unittest-support-python.c
|
|
_unittest_support_la_CFLAGS = \
|
|
${libtest_core_la_CPPFLAGS} \
|
|
${PYTHON_CPPFLAGS}
|
|
_unittest_support_la_LDFLAGS = \
|
|
${PYTHON_LDFLAGS} \
|
|
-module \
|
|
-rpath ${exec-prefix}/lib
|
|
|
|
_unittest_support_la_LIBADD = \
|
|
${PYTHON_LIBS} \
|
|
${PYTHON_EXTRA_LIBS} \
|
|
libtest-core.la
|
|
|
|
endif
|
|
|
|
gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
|
|
gncscmmod_DATA = unittest-support.scm
|
|
|
|
SCM_FILES = $(gncscmmod_DATA)
|
|
|
|
.scm-links:
|
|
$(RM) -rf gnucash
|
|
mkdir -p gnucash
|
|
if GNUCASH_SEPARATE_BUILDDIR
|
|
for X in ${SCM_FILES} ; do \
|
|
$(LN_S) -f ${srcdir}/$$X . ; \
|
|
done
|
|
endif
|
|
( cd gnucash; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
|
|
if ! OS_WIN32
|
|
# Windows knows no "ln -s" but uses "cp": must copy every time (see bug #566567).
|
|
touch .scm-links
|
|
endif
|
|
|
|
if GNC_HAVE_GUILE_2
|
|
GUILE_COMPILE_ENV = \
|
|
--library-dir ${top_builddir}/src/test-core
|
|
|
|
%.go : %.scm .scm-links $(pkglib_LTLIBRARIES)
|
|
GNC_UNINSTALLED=yes \
|
|
GNC_BUILDDIR=${top_builddir} \
|
|
$(shell ${top_builddir}/src/gnc-test-env --no-exports ${GUILE_COMPILE_ENV}) \
|
|
$(GUILD) compile -o $@ $<
|
|
|
|
gncscmmodcachedir = ${GNC_SHAREDIR}/guile-modules/ccache/@GUILE_EFFECTIVE_VERSION@/gnucash
|
|
gncscmmodcache_DATA = $(gncscmmod_DATA:.scm=.go)
|
|
endif
|
|
|
|
clean-local:
|
|
$(RM) -rf gnucash
|
|
|
|
noinst_DATA = .scm-links
|
|
CLEANFILES = .scm-links
|
|
|
|
EXTRA_DIST = \
|
|
$(SCM_FILES) \
|
|
swig-unittest-support-python.c \
|
|
swig-unittest-support-guile.c \
|
|
unittest-support.i
|
|
|
|
MAINTAINERCLEANFILES = \
|
|
swig-unittest-support-guile.c \
|
|
swig-unittest-support-python.c
|