Update r23747 -- require 2.0.10 for guile2 builds, but allow older versions

for guile 1.8 builds.  However if we don't have guile 2.0.10 then don't
allow "make dist" to run.  This also means we wont patch the guile
files unless we find swig 2.0.10.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23748 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Derek Atkins 2014-01-23 21:20:37 +00:00
parent 2cb9764459
commit 7397e4adce
15 changed files with 75 additions and 10 deletions

View File

@ -40,6 +40,7 @@ dist_doc_DATA = \
# CVS dirs.
EXTRA_DIST = \
$(SWIG_DIST_FAIL) \
make-gnucash-potfiles.in \
macros/as-scrub-include.m4 \
macros/binreloc.m4 \
@ -146,6 +147,14 @@ distuninstallcheck_listfiles = \
#dist-hook: po/POTFILES.in
# Make "make dist" fail if we have the wrong version of swig
if SWIG_DIST_FAIL
SWIG_DIST_FAIL = swig-dist-fail
swig-dist-fail:
@echo "You cannot build the dist with your version of swig"
@exit 1
endif
distcheck-hook:
@e=''; \
for X in `grep -v \# ${distdir}/po/POTFILES.in | sed 's/\[type:.*\]//'` ; do \

View File

@ -476,21 +476,51 @@ AM_CONDITIONAL(GNC_HAVE_GUILE_WWW, test "${gnc_have_guile_www}" = yes)
### --------------------------------------------------------------------------
### SWIG version checks (only when building from SCM)
#
# We need at least version 2.0.10 of SWIG because that's the first version
# that supports guile 2
# For a guile 1.8 build we could have gotten away with an older version
# but we need to apply a patch to the swig generated files that needs to
# go into the release tarball. At that point we don't know yet which
# version of guile will be used together with that tarball so we have
# to prepare the tarball for guile 2 compatibility.
# In order to build against guile 2 or build the dist we need at least
# version 2.0.10 of SWIG, because that's the first version that supports
# guile 2.
#
# For a guile 1.8 build we accept an older version, but wont allow you
# to build the dist because we need to apply a patch to the swig
# generated files that needs to go into the release tarball. At that
# point we don't know yet which version of guile will be used together
# with that tarball so we have to prepare the tarball for guile 2
# compatibility.
#
if test "${BUILDING_FROM_SCM}" = yes
then
AX_PKG_SWIG(2.0.10, [],
[AC_MSG_ERROR([
AX_PKG_SWIG(2.0.10, [gnc_have_swig_2_0_10=yes], [gnc_have_swig_2_0_10=no])
if test "${gnc_have_guile_2}" = yes
then
if test "${gnc_have_swig_2_0_10}" = no
then
AC_MSG_ERROR([
You are building from ${SCM_TYPE} but swig was not found or too old.
To build gnucash you need at least swig version 2.0.10.
])
fi
else # using guile 1.8
if test "${gnc_have_swig_2_0_10}" = no
then
AX_PKG_SWIG(1.3.31, [],
[AC_MSG_ERROR([
You are building from ${SCM_TYPE} but swig was not found or too old.
To build gnucash with guile 1.8 you need at least swig version 1.3.31.
])])
fi
fi
# If we get here then we have an okay version to build locally.
# Check if we can build dist (which always requires swig 2.0.10)
if test "${gnc_have_swig_2_0_10}" = no
then
AC_MSG_WARN([You don't have SWIG 2.0.10 so you will not be able to "make dist"])
fi
fi
AM_CONDITIONAL([SWIG_DIST_FAIL], test "${gnc_have_swig_2_0_10}" != yes)
### --------------------------------------------------------------------------
### LIBXML -- GNOME_XML_LIB is defined by GNOME_XML_CHECK

View File

@ -110,10 +110,12 @@ swig-app-utils-guile.c: app-utils.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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-app-utils-python.c: app-utils.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -python -Wall -Werror $(SWIG_ARGS) \
-I${top_srcdir}/src -o $@ $<

View File

@ -47,10 +47,12 @@ swig-core-utils-guile.c: core-utils.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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-core-utils-python.c: core-utils.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -python -Wall -Werror $(SWIG_ARGS) \
-I${top_srcdir}/src -o $@ $<

View File

@ -206,11 +206,13 @@ swig-engine.c: engine.i $(top_srcdir)/src/base-typemaps.i \
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src/libqof/qof -I${top_srcdir}/src -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
endif
iso-4217-currencies.c: iso-4217-currencies.scm iso-currencies-to-c
-chmod u+x ./iso-currencies-to-c

View File

@ -34,11 +34,13 @@ swig-gnc-module.c: gnc-module.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
EXTRA_DIST = \
${gncmod_DATA} \

View File

@ -26,11 +26,13 @@ if BUILDING_FROM_SCM
swig-bar.c: bar.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module -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
endif
EXTRA_DIST = \
bar.i \

View File

@ -30,11 +30,13 @@ if BUILDING_FROM_SCM
swig-baz.c: baz.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module -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
endif
EXTRA_DIST = \
baz.i \

View File

@ -31,11 +31,13 @@ if BUILDING_FROM_SCM
swig-foo.c: foo.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module -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
endif
BUILT_SOURCES = swig-foo.c
MAINTAINERCLEANFILES = swig-foo.c

View File

@ -229,11 +229,13 @@ swig-gnome-utils.c: gnome-utils.i \
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
gncmod_DATA = gnome-utils.scm

View File

@ -116,11 +116,13 @@ swig-gnome.c: gnome.i dialog-progress.h ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
EXTRA_DIST = \
gnome.i \

View File

@ -60,11 +60,13 @@ swig-gnc-html.c: gnc-html.i gnc-html.h \
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
EXTRA_DIST = \
gnc-html.i

View File

@ -54,11 +54,13 @@ swig-report-gnome.c: report-gnome.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report
gncmod_DATA = report-gnome.scm

View File

@ -26,11 +26,13 @@ swig-report-system.c: report-system.i ${top_srcdir}/src/base-typemaps.i
$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
-I${top_srcdir}/src -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
endif
AM_CPPFLAGS = \
-I${top_srcdir}/src \

View File

@ -29,10 +29,12 @@ swig-unittest-support-guile.c: unittest-support.i $(top_srcdir)/src/base-typemap
-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) \