Commit ee19815c authored by Karl Wette's avatar Karl Wette
Browse files

SWIG: automatically determine dependencies between SWIG modules

- by parsing $LIBS and looking for LAL library names
- LALSUITE_SWIG_DEPENDS is no longer needed
- interfaces only import direct dependencies, using SWIGIMPORTED
  prevents recursive imports
Original: ef6497e5a3f1b25eedffc1690785f1cdfc763700
parent 3a4eaea2
# SWIG configuration
# Author: Karl Wette, 2011, 2012
#
# serial 33
# serial 34
# enable SWIG wrapping modules
AC_DEFUN([LALSUITE_ENABLE_SWIG],[
......@@ -243,18 +243,29 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
])
AC_SUBST(SWIG_LD_LIBPATH_NAME)
# list of other LAL SWIG modules that this module depends on
AC_SUBST(SWIG_MODULE_DEPENDS,[""])
for arg in ${swig_save_LIBS}; do
swig_module=["`echo ${arg} | ${SED} -n 's|^.*/lib\(lal[^.]*\)\.la$|\1|p'`"]
AS_IF([test "x${swig_module}" != x && test "x${swig_module}" != xlalsupport],[
SWIG_MODULE_DEPENDS="${SWIG_MODULE_DEPENDS} ${swig_module}"
])
done
# scripting-language path to search for pre-installed SWIG modules
AC_SUBST(SWIG_PREINST_PATH,["\$(SWIG_OUTDIR)"])
AS_IF([test "x${LALSUITE_BUILD}" = xtrue],[
for dir in ${LALSUITE_SUBDIRS}; do
SWIG_PREINST_PATH="${SWIG_PREINST_PATH}:\$(abs_top_builddir)/../${dir}/\$(subdir)/${objdir}"
done
])
])
# configure SWIG languages
LALSUITE_USE_SWIG_OCTAVE
LALSUITE_USE_SWIG_PYTHON
# list of other LAL libraries SWIG wrapping module depends on
AC_SUBST(SWIG_MODULE_DEPENDS,[""])
# scripting-language path to search for pre-installed SWIG modules
AC_SUBST(SWIG_PREINST_PATH,["\$(SWIG_OUTDIR)"])
# restore global compiler/linker variables
CPPFLAGS=${swig_save_CPPFLAGS}
CFLAGS=${swig_save_CFLAGS}
......@@ -264,20 +275,6 @@ AC_DEFUN([LALSUITE_USE_SWIG],[
])
# add to list of other LAL libraries SWIG wrapping module depends on
# args: $1=LAL library, $2=enable dependency?
AC_DEFUN([LALSUITE_SWIG_DEPENDS],[
AS_IF([test "x$2" = xtrue],[
SWIG_MODULE_DEPENDS="${SWIG_MODULE_DEPENDS} $1"
# add to scripting-language path to search for pre-installed SWIG modules
AS_IF([test "x${LALSUITE_BUILD}" = xtrue],[
SWIG_PREINST_PATH="${SWIG_PREINST_PATH}:\$(abs_top_builddir)/../$1/\$(subdir)/${objdir}"
])
])
])
# configure SWIG language wrapping module
# args: $1=language, $2=actions if enabled
AC_DEFUN([LALSUITE_USE_SWIG_LANGUAGE],[
......
......@@ -320,8 +320,10 @@ iface_file.write('%%module %s;\n' % module_name)
iface_file.write('%include <lal/swiglal_common.i>\n')
# import dependent modules
iface_file.write('#ifndef SWIGIMPORTED\n')
for module in module_depends.split():
iface_file.write('%%import <lal/%sswig.i>\n' % module)
iface_file.write('#endif\n')
# include interface headers in wrapping code
iface_file.write('%header %{\n')
......
......@@ -139,7 +139,6 @@ LALSUITE_CHECK_LIB([LALSimulation],[0.7.0],[XLALSimDetectorStrainREAL8TimeSeries
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -141,7 +141,6 @@ LALSUITE_CHECK_LIB([LALBurst],[1.1.2],[XLALEPSearch],[lal/EPSearch.h])
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -162,7 +162,6 @@ INOTIFY_ENABLE_VAL="`eval test x$inotify = xtrue && echo "ENABLED" || echo "DISA
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -197,7 +197,6 @@ LALSUITE_CHECK_OPT_LIB([LALXML],[1.1.5],[XLALXMLFilePrintElements],[lal/LALXML.h
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLALInference LALInference XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -156,7 +156,6 @@ LALSUITE_CHECK_LIB([LALFrame],[1.0.10],[LALFrOpen],[lal/LALFrameL.h])
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -125,7 +125,6 @@ LALSUITE_CHECK_LIB([LALSupport],[6.10.0],[LALOpenDataFile],[lal/FileIO.h])
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -162,8 +162,6 @@ LALSUITE_CHECK_OPT_LIB([LALXML],[1.1.5],[XLALXMLFilePrintElements],[lal/LALXML.h
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
LALSUITE_SWIG_DEPENDS([lalxml],[$lalxml])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -135,7 +135,6 @@ LALSUITE_CHECK_LIB([LALSupport],[6.10.0],[LALOpenDataFile],[lal/FileIO.h])
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -125,7 +125,6 @@ LALSUITE_CHECK_LIB([LALMetaIO],[1.1.0],[XLALCreateMetaTableDir],[lal/LIGOLwXMLRe
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
......@@ -137,7 +137,6 @@ LALSUITE_CHECK_LIB([LALSupport],[6.10.0],[LALOpenDataFile],[lal/FileIO.h])
# configure SWIG wrapping modules
LALSUITE_USE_SWIG([XLAL LAL])
LALSUITE_SWIG_DEPENDS([lal],[true])
# add gcc specific flags
LALSUITE_ADD_GCC_FLAGS
......
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