Commit 302b262f authored by Karl Wette's avatar Karl Wette

SWIG: do not bundle dependency files with tarballs

- dependency files include files external to tarball (e.g. other LAL library
  headers) which will not be in the same location when tarball is built
- no longer any safeguard against library headers being patched without SWIG
  source being regenerated, instead left to packager to ensure SWIG sources
  are rebuilt if needed (unlikely to be the case for LALSuite anyway)
Original: 1dd7190dad87fe7ce55fa5b5d1cdfb55e4f75066
parent b5d125bb
......@@ -22,7 +22,6 @@ swig_flags = -MP -MD -Wextra -Werror -I$(top_builddir)/include $(SWIG_CPPFLAGS)
swig_cppflags = -shared -I. -I$(top_builddir)/include $(SWIG_CPPFLAGS)
swig_ldflags = -module -avoid-version -version-info 0:0:0 $(SWIG_LDFLAGS)
swig_libtoolflags = --tag=disable-static
swig_deps_filter = $(SED) -e '/^ *swiglal[a-z0-9_]*\.[a-z0-9][a-z0-9]* *\\$$/d'
swig_octave_flags = $(swig_flags) -octave -globals . -DSWIG_CPLUSPLUS_CAST
swig_python_flags = $(swig_flags) -python -O -builtin -globals globalvar
......@@ -58,8 +57,6 @@ CLEANFILES += \
if SWIG_BUILD_OCTAVE
@SWIG_include_deps@/swiglal_octave.deps
octexec_LTLIBRARIES = swiglal_octave.la
nodist_swiglal_octave_la_SOURCES = swiglal_octave.cpp
swiglal_octave_la_CPPFLAGS = $(SWIG_OCTAVE_CPPFLAGS_IOCTAVE) $(swig_cppflags) $(SWIG_OCTAVE_CPPFLAGS)
......@@ -95,15 +92,12 @@ test_scripts += SWIGTest$(PACKAGE_NAME)Octave.m
EXTRA_DIST += \
swiglal_octave.cpp \
swiglal_octave.deps \
$(END_OF_LIST)
endif # SWIG_BUILD_OCTAVE
if SWIG_BUILD_PYTHON
@SWIG_include_deps@/swiglal_python.deps
pkgpyexec_LTLIBRARIES = swiglal_python.la
nodist_pkgpyexec_PYTHON = swiglal_python/$(PACKAGE).py
nodist_swiglal_python_la_SOURCES = swiglal_python.c
......@@ -145,7 +139,6 @@ test_scripts += SWIGTest$(PACKAGE_NAME)Python.py
EXTRA_DIST += \
swiglal_python.c \
swiglal_python.deps \
swiglal_python/$(PACKAGE).py \
$(END_OF_LIST)
......@@ -153,8 +146,6 @@ endif # SWIG_BUILD_PYTHON
if SWIG_GENERATE
@SWIG_include_deps@/swiglal_preproc.deps
# swiglal_preproc.i.tmp is always generated, but replaces swiglal_preproc.i only if they differ
swiglal_preproc.i: force-swig-preproc-generation
$(AM_V_at)echo '// $@: generated by $(subdir)/Makefile' >$@.tmp; \
......@@ -193,12 +184,14 @@ swiglal_preproc.i: force-swig-preproc-generation
mv -f $@.tmp $@; \
fi
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swiglal_preproc.deps@am__quote@
swiglal_preproc.xml: swiglal_preproc.i Makefile
$(AM_V_GEN)if $(SWIG) -MF swiglal_preproc.deps.tmp $(swig_preproc_flags) -o $@ $<; then \
mv -f swiglal_preproc.deps.tmp swiglal_preproc.deps; \
$(AM_V_GEN)if $(SWIG) -MF ./$(DEPDIR)/swiglal_preproc.deps.tmp $(swig_preproc_flags) -o $@ $<; then \
mv -f ./$(DEPDIR)/swiglal_preproc.deps.tmp ./$(DEPDIR)/swiglal_preproc.deps; \
exit 0; \
else \
rm -f swiglal_preproc.deps.tmp $@; \
rm -f ./$(DEPDIR)/swiglal_preproc.deps.tmp $@; \
exit 1; \
fi
......@@ -212,25 +205,27 @@ $(swig_iface): swiglal_preproc.xml $(srcdir)/generate_swig_iface.py
exit 1; \
fi
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swiglal_octave.deps@am__quote@
swiglal_octave.cpp: $(swig_iface) swiglal_config.h
$(AM_V_GEN)$(MKDIR_P) swiglal_octave/ && \
if $(SWIG) -MF swiglal_octave.deps.tmp -outdir swiglal_octave/ $(swig_octave_flags) -o $@ $<; then \
$(swig_deps_filter) swiglal_octave.deps.tmp > swiglal_octave.deps; \
rm -f swiglal_octave.deps.tmp; \
if $(SWIG) -MF ./$(DEPDIR)/swiglal_octave.deps.tmp -outdir swiglal_octave/ $(swig_octave_flags) -o $@ $<; then \
mv -f ./$(DEPDIR)/swiglal_octave.deps.tmp ./$(DEPDIR)/swiglal_octave.deps; \
exit 0; \
else \
rm -f swiglal_octave.deps.tmp $@; \
rm -f ./$(DEPDIR)/swiglal_octave.deps.tmp $@; \
exit 1; \
fi
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swiglal_python.deps@am__quote@
swiglal_python.c: $(swig_iface) swiglal_config.h
$(AM_V_GEN)$(MKDIR_P) swiglal_python/ && \
if $(SWIG) -MF swiglal_python.deps.tmp -outdir swiglal_python/ $(swig_python_flags) -o $@ $<; then \
$(swig_deps_filter) swiglal_python.deps.tmp > swiglal_python.deps; \
rm -f swiglal_python.deps.tmp; \
if $(SWIG) -MF ./$(DEPDIR)/swiglal_python.deps.tmp -outdir swiglal_python/ $(swig_python_flags) -o $@ $<; then \
mv -f ./$(DEPDIR)/swiglal_python.deps.tmp ./$(DEPDIR)/swiglal_python.deps; \
exit 0; \
else \
rm -f swiglal_python.deps.tmp $@; \
rm -f ./$(DEPDIR)/swiglal_python.deps.tmp $@; \
exit 1; \
fi
......@@ -250,19 +245,6 @@ CLEANFILES += \
swiglal_python/$(PACKAGE).py \
$(END_OF_LIST)
distclean-local: swig-distclean-generate-local
swig-distclean-generate-local:
-rm -f swig_*.deps
else # !SWIG_GENERATE
swiglal_octave.cpp swiglal_python.c:
@printf "\nERROR: these dependencies of $@ have changed:\n $?\n" >&2; \
printf "but SWIG is not available to re-generate $@.\n" >&2; \
printf "Please ensure SWIG is installed and re-run ./configure with\n" >&2; \
printf "either --enable-swig=generate or --enable-swig-<lang>=generate.\n\n" >&2; \
exit 1
endif # SWIG_GENERATE
endif # SWIG_BUILD
......
......@@ -2,7 +2,7 @@
# lalsuite_swig.m4 - SWIG configuration
# Author: Karl Wette, 2011--2014
#
# serial 72
# serial 73
AC_DEFUN([_LALSUITE_CHECK_SWIG_VERSION],[
# $0: check the version of $1, and store it in ${swig_version}
......@@ -112,7 +112,7 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
# configure SWIG binding languages
swig_min_version=2.0.11
swig_min_version_info=""
swig_dep_files=""
swig_src_files=""
LALSUITE_USE_SWIG_OCTAVE
LALSUITE_USE_SWIG_PYTHON
......@@ -152,29 +152,21 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
# if SWIG bindings are not being generated, check that the SWIG version
# used to generate the bindings satisfies ${swig_min_version}
srcfile_swig_version_regex='s/^#.*define *SWIGVERSION *0x\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\).*$/\1 \2 \3/p'
src_file_swig_version_regex='s/^#.*define *SWIGVERSION *0x\([0-9][0-9]\)\([0-9][0-9]\)\([0-9][0-9]\).*$/\1 \2 \3/p'
AS_IF([test "${swig_generate}" != true],[
for file in ${swig_dep_files}; do
depfile="${srcdir}/swig/${file}"
AS_IF([test "${swig_generate}" = true],[
test -f "swig/${file}" || echo '#empty' > "swig/${file}"
],[test -f "${depfile}"],[
srcfilename=`cat "${depfile}" | ${SED} -n -e '1p' | ${SED} -e 's/:.*$//'`
srcfile="${srcdir}/swig/${srcfilename}"
AS_IF([test -f "${srcfile}"],[
AC_MSG_CHECKING([if SWIG version ${swig_min_version} or later generated ${srcfilename}])
srcfile_swig_verargs=[`${SED} -n -e "${srcfile_swig_version_regex}" "${srcfile}"`]
srcfile_swig_version=[`printf '%d.%d.%d' ${srcfile_swig_verargs}`]
LALSUITE_VERSION_COMPARE([${srcfile_swig_version}],[<],[${swig_min_version}],[
AC_MSG_RESULT([no (${srcfile_swig_version})])
AC_MSG_ERROR([SWIG version ${swig_min_version} or later is required ${swig_min_version_info}])
])
AC_MSG_RESULT([yes (${srcfile_swig_version})])
],[
AC_MSG_ERROR([could not determine source file from ${depfile}])
for file in ${swig_src_files}; do
src_file="${srcdir}/swig/${file}"
AS_IF([test -f "${src_file}"],[
AC_MSG_CHECKING([if SWIG version ${swig_min_version} or later generated ${src_file}])
src_file_swig_verargs=[`${SED} -n -e "${src_file_swig_version_regex}" "${src_file}"`]
src_file_swig_version=[`printf '%d.%d.%d' ${src_file_swig_verargs}`]
LALSUITE_VERSION_COMPARE([${src_file_swig_version}],[<],[${swig_min_version}],[
AC_MSG_RESULT([no (${src_file_swig_version})])
AC_MSG_ERROR([SWIG version ${swig_min_version} or later is required ${swig_min_version_info}])
])
AC_MSG_RESULT([yes (${src_file_swig_version})])
],[
AC_MSG_ERROR([${depfile} does not exist])
AC_MSG_ERROR([${src_file} does not exist])
])
done
])
......@@ -214,42 +206,6 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
AC_MSG_RESULT([${SWIG_DEPENDENCIES}])
])
# substitute command to import SWIG make dependency files
AS_IF([test "${swig_generate}" = true],[
SWIG_include_deps='include .'
],[
SWIG_include_deps='include $(srcdir)'
])
AC_SUBST([SWIG_include_deps])
AM_SUBST_NOTMAKE([SWIG_include_deps])
# make sure SWIG make dependency files exist, and that
# SWIG sources, if distributed, have new timestamps
AC_CONFIG_COMMANDS([swig_depfiles],[
AS_IF([test "${swig_generate}" = true],[
test -f "swig/swiglal_preproc.deps" || echo '#empty' > "swig/swiglal_preproc.deps"
])
for file in ${swig_dep_files}; do
depfile="${srcdir}/swig/${file}"
AS_IF([test "${swig_generate}" = true],[
test -f "swig/${file}" || echo '#empty' > "swig/${file}"
],[test -f "${depfile}"],[
srcfilename=`cat "${depfile}" | ${SED} -n -e '1p' | ${SED} -e 's/:.*$//'`
srcfile="${srcdir}/swig/${srcfilename}"
AS_IF([test -f "${srcfile}"],[
touch "${srcfile}"
],[
AC_MSG_ERROR([could not determine source file from ${depfile}])
])
],[
AC_MSG_ERROR([${depfile} does not exist])
])
done
],[
swig_generate="${swig_generate}"
swig_dep_files="${swig_dep_files}"
])
])
AM_CONDITIONAL([SWIG_BUILD],[test "${swig_build_any}" = true])
AM_CONDITIONAL([SWIG_GENERATE],[test "${swig_generate}" = true])
......@@ -261,9 +217,9 @@ AC_DEFUN([LALSUITE_USE_SWIG_LANGUAGE],[
m4_pushdef([uppercase],m4_translit([$1],[a-z],[A-Z]))
m4_pushdef([lowercase],m4_translit([$1],[A-Z],[a-z]))
AS_IF([test "${swig_build_]lowercase[}" = true],[
$2
swig_build=true
swig_dep_files="${swig_dep_files} swiglal_[]lowercase[].deps"
swig_src_files="${swig_src_files} swiglal_[]lowercase[].$2"
$3
])
m4_popdef([uppercase])
m4_popdef([lowercase])
......@@ -272,7 +228,7 @@ AC_DEFUN([LALSUITE_USE_SWIG_LANGUAGE],[
AC_DEFUN([LALSUITE_USE_SWIG_OCTAVE],[
# $0: configure SWIG Octave bindings
LALSUITE_USE_SWIG_LANGUAGE([Octave],[
LALSUITE_USE_SWIG_LANGUAGE([Octave],[cpp],[
# check for Octave
AC_PATH_PROG(OCTAVE,[octave],[],[])
......@@ -393,7 +349,7 @@ AC_DEFUN([LALSUITE_USE_SWIG_OCTAVE],[
AC_DEFUN([LALSUITE_USE_SWIG_PYTHON],[
# $0: configure SWIG Python bindings
LALSUITE_USE_SWIG_LANGUAGE([Python],[
LALSUITE_USE_SWIG_LANGUAGE([Python],[c],[
# check for distutils
AC_MSG_CHECKING([for distutils])
......
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