Commit 86366d53 authored by Karl Wette's avatar Karl Wette Committed by Adam Mercer

lalsuite_build.m4: define LAL*_DATADIR data directory variables

- point to installed ${pkgdatadir} for each library
- determine either from environment or pkg-config
- saved between ./configure calls with AC_ARG_VAR (except LALSupport)
- LALSUITE_TOP_SRCDIR no longer needed
- refs #608
Original: 78aa03560f5874fc6b2acc6069fa747821d50e9e
parent 48c53452
......@@ -34,12 +34,12 @@ lalsuite_top_builddir='$(top_builddir)/..'
lalsuite_top_srcdir='$(top_srcdir)/..'
LALSUITE_BUILD="true"
LALSUITE_TOP_SRCDIR="${lalsuite_top_srcdir}"
export LALSUITE_BUILD LALSUITE_TOP_SRCDIR
export LALSUITE_BUILD
LAL_LIBS="-L${libdir} ${lalsuite_top_builddir}/lal/lib/lal/liblal.la"
LAL_CFLAGS="-I${lalsuite_top_builddir}/lal/include"
export LAL_LIBS LAL_CFLAGS
LAL_DATADIR="${lalsuite_top_srcdir}/lal/test"
export LAL_LIBS LAL_CFLAGS LAL_DATADIR
LALSUPPORT_LIBS="-L${libdir} ${lalsuite_top_builddir}/lal/lib/lalsupport/src/liblalsupport.la"
LALSUPPORT_CFLAGS="-I${lalsuite_top_builddir}/lal/include"
......@@ -48,61 +48,71 @@ export LALSUPPORT_LIBS LALSUPPORT_CFLAGS
if test "$lalframe" = "true"; then
LALFRAME_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalframe/src/liblalframe.la"
LALFRAME_CFLAGS="-I${lalsuite_top_builddir}/lalframe/include"
export LALFRAME_LIBS LALFRAME_CFLAGS
LALFRAME_DATADIR="${lalsuite_top_srcdir}/lalframe/test"
export LALFRAME_LIBS LALFRAME_CFLAGS LALFRAME_DATADIR
fi
if test "$lalmetaio" = "true"; then
LALMETAIO_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalmetaio/src/liblalmetaio.la"
LALMETAIO_CFLAGS="-I${lalsuite_top_builddir}/lalmetaio/include"
export LALMETAIO_LIBS LALMETAIO_CFLAGS
LALMETAIO_DATADIR="${lalsuite_top_srcdir}/lalmetaio/test"
export LALMETAIO_LIBS LALMETAIO_CFLAGS LALMETAIO_DATADIR
fi
if test "$lalxml" = "true"; then
LALXML_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalxml/src/liblalxml.la"
LALXML_CFLAGS="-I${lalsuite_top_builddir}/lalxml/include"
export LALXML_LIBS LALXML_CFLAGS
LALXML_DATADIR="${lalsuite_top_srcdir}/lalxml/test"
export LALXML_LIBS LALXML_CFLAGS LALXML_DATADIR
fi
if test "$lalsimulation" = "true"; then
LALSIMULATION_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalsimulation/src/liblalsimulation.la"
LALSIMULATION_CFLAGS="-I${lalsuite_top_builddir}/lalsimulation/include"
export LALSIMULATION_LIBS LALSIMULATION_CFLAGS
LALSIMULATION_DATADIR="${lalsuite_top_srcdir}/lalsimulation/test"
export LALSIMULATION_LIBS LALSIMULATION_CFLAGS LALSIMULATION_DATADIR
fi
if test "$laldetchar" = "true"; then
LALDETCHAR_LIBS="-L${libdir} ${lalsuite_top_builddir}/laldetchar/src/liblaldetchar.la"
LALDETCHAR_CFLAGS="-I${lalsuite_top_builddir}/laldetchar/include"
export LALDETCHAR_LIBS LALDETCHAR_CFLAGS
LALDETCHAR_DATADIR="${lalsuite_top_srcdir}/laldetchar/test"
export LALDETCHAR_LIBS LALDETCHAR_CFLAGS LALDETCHAR_DATADIR
fi
if test "$lalburst" = "true"; then
LALBURST_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalburst/src/liblalburst.la"
LALBURST_CFLAGS="-I${lalsuite_top_builddir}/lalburst/include"
export LALBURST_LIBS LALBURST_CFLAGS
LALBURST_DATADIR="${lalsuite_top_srcdir}/lalburst/test"
export LALBURST_LIBS LALBURST_CFLAGS LALBURST_DATADIR
fi
if test "$lalinspiral" = "true"; then
LALINSPIRAL_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalinspiral/src/liblalinspiral.la"
LALINSPIRAL_CFLAGS="-I${lalsuite_top_builddir}/lalinspiral/include"
export LALINSPIRAL_LIBS LALINSPIRAL_CFLAGS
LALINSPIRAL_DATADIR="${lalsuite_top_srcdir}/lalinspiral/test"
export LALINSPIRAL_LIBS LALINSPIRAL_CFLAGS LALINSPIRAL_DATADIR
fi
if test "$lalstochastic" = "true"; then
LALSTOCHASTIC_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalstochastic/src/liblalstochastic.la"
LALSTOCHASTIC_CFLAGS="-I${lalsuite_top_builddir}/lalstochastic/include"
export LALSTOCHASTIC_LIBS LALSTOCHASTIC_CFLAGS
LALSTOCHASTIC_DATADIR="${lalsuite_top_srcdir}/lalstochastic/test"
export LALSTOCHASTIC_LIBS LALSTOCHASTIC_CFLAGS LALSTOCHASTIC_DATADIR
fi
if test "$lalpulsar" = "true"; then
LALPULSAR_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalpulsar/src/liblalpulsar.la"
LALPULSAR_CFLAGS="-I${lalsuite_top_builddir}/lalpulsar/include"
export LALPULSAR_LIBS LALPULSAR_CFLAGS
LALPULSAR_DATADIR="${lalsuite_top_srcdir}/lalpulsar/test"
export LALPULSAR_LIBS LALPULSAR_CFLAGS LALPULSAR_DATADIR
fi
if test "$lalinference" = "true"; then
LALINFERENCE_LIBS="-L${libdir} ${lalsuite_top_builddir}/lalinference/src/liblalinference.la"
LALINFERENCE_CFLAGS="-I${lalsuite_top_builddir}/lalinference/include"
export LALINFERENCE_LIBS LALINFERENCE_CFLAGS
LALINFERENCE_DATADIR="${lalsuite_top_srcdir}/lalinference/test"
export LALINFERENCE_LIBS LALINFERENCE_CFLAGS LALINFERENCE_DATADIR
fi
AC_CONFIG_SUBDIRS([lal])
......
# lalsuite_build.m4 - top level build macros
#
# serial 48
# serial 49
AC_DEFUN([LALSUITE_CHECK_GIT_REPO],[
# check for git
......@@ -98,7 +98,6 @@ AC_LANG(_AC_LANG)[]dnl
AC_DEFUN([LALSUITE_ARG_VAR],[
AC_ARG_VAR(LALSUITE_BUILD,[Set if part of lalsuite build])
AC_ARG_VAR(LALSUITE_TOP_SRCDIR,[Set to top source directory of lalsuite])
])
AC_DEFUN([LALSUITE_MULTILIB_LIBTOOL_HACK],
......@@ -148,7 +147,11 @@ eval $1_ENABLE_VAL="`eval test "$$2" = "true" && echo "ENABLED" || echo "DISABLE
AC_DEFUN([LALSUITE_CHECK_LIB],[
m4_pushdef([lowercase],translit([[$1]], [A-Z], [a-z]))
m4_pushdef([uppercase],translit([[$1]], [a-z], [A-Z]))
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"],[lowercase="false"])
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"
if test "x${uppercase[]_DATADIR}" = x; then
uppercase[]_DATADIR=`${PKG_CONFIG} --variable=pkgdatadir "lowercase >= $2" 2>/dev/null`
fi
],[lowercase="false"])
if test "$lowercase" = "true"; then
CPPFLAGS="$CPPFLAGS $[]uppercase[]_CFLAGS"
for arg in $[]uppercase[]_LIBS; do
......@@ -172,6 +175,9 @@ else
AC_MSG_ERROR([could not find the $1 library])
fi
LALSUITE_ENABLE_MODULE(uppercase,lowercase)
m4_if(lowercase,[lalsupport],[],[
AC_ARG_VAR(uppercase[]_DATADIR, [data directory for ]uppercase[, overriding pkg-config])
])
m4_popdef([lowercase])
m4_popdef([uppercase])
])
......@@ -180,7 +186,11 @@ AC_DEFUN([LALSUITE_CHECK_OPT_LIB],[
m4_pushdef([lowercase],translit([[$1]], [A-Z], [a-z]))
m4_pushdef([uppercase],translit([[$1]], [a-z], [A-Z]))
if test "$lowercase" = "true"; then
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"],[lowercase="false"])
PKG_CHECK_MODULES(uppercase,[lowercase >= $2],[lowercase="true"
if test "x${uppercase[]_DATADIR}" = x; then
uppercase[]_DATADIR=`${PKG_CONFIG} --variable=pkgdatadir "lowercase >= $2" 2>/dev/null`
fi
],[lowercase="false"])
if test "$lowercase" = "true"; then
CPPFLAGS="$CPPFLAGS $[]uppercase[]_CFLAGS"
for arg in $[]uppercase[]_LIBS; do
......@@ -210,6 +220,9 @@ if test "$lowercase" = "true"; then
fi
fi
LALSUITE_ENABLE_MODULE(uppercase,lowercase)
m4_if(lowercase,[lalsupport],[],[
AC_ARG_VAR(uppercase[]_DATADIR, [data directory for ]uppercase[, overriding pkg-config])
])
m4_popdef([lowercase])
m4_popdef([uppercase])
])
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LAL
Description: LSC Algorithm Library
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALBurst
Description: LAL Burst Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALDetChar
Description: LAL DetChar Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALFrame
Description: LAL Frame Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALInference
Description: LAL Inference Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALInspiral
Description: LAL Inspiral Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALMetaIO
Description: LAL MetaIO Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALPulsar
Description: LAL Pulsar Library
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALSimulation
Description: LAL Simulation Library Support
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALStochastic
Description: LAL Stochastic Library
......
......@@ -2,6 +2,9 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@
pkgdatadir=@datadir@/@PACKAGE@
Name: LALXML
Description: LAL XML Library Support
......
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